Codex Desktop worktree creation does not run repository post-checkout hooks

Open 💬 0 comments Opened Aug 2, 2026 by xinnjie

Describe the bug

When Codex Desktop creates a Git worktree, the worktree is created successfully, but the repository's Git post-checkout hook is not run. The hook's output is absent and the setup commands it normally runs are not executed.

Steps to reproduce

  1. Configure a repository Git post-checkout hook that prints a marker and performs setup.
  2. Verify that the hook runs when creating a worktree from a normal terminal with git worktree add.
  3. In Codex Desktop, create a new worktree for the same repository.
  4. Observe output similar to:
[info] Starting worktree creation
Preparing worktree (detached HEAD cb882b3)
HEAD is now at cb882b3 docs: add main page UI/UX (#98)
Worktree created at /Users/.../.codex/worktrees/3268/firehorse
No local environment selected
  1. The post-checkout hook's marker/output is absent, and the hook-based setup does not run.

Expected behavior

Codex Desktop should either:

  • run the repository's post-checkout hook as normal Git worktree add does; or
  • explicitly document that app-managed worktree creation skips Git hooks and provide a supported opt-in worktree setup step.

Additional context

  • Platform: macOS
  • Git: 2.50.1 (Apple Git-155)
  • The same repository hook runs when git worktree add is executed from a normal terminal.
  • Git normally invokes post-checkout after git worktree add, unless checkout is disabled.
  • A Codex Desktop log shows internal Git commands invoked with -c core.hooksPath=/dev/null, which disables configured Git hooks. Please confirm whether the same setting is applied to the worktree-creation path.
  • Related, but not duplicates: #27133 discusses project-level Codex hooks being ignored inside a Git worktree; #23446 documents Codex Git helpers using core.hooksPath=/dev/null.

View original on GitHub ↗