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
- Configure a repository Git
post-checkouthook that prints a marker and performs setup. - Verify that the hook runs when creating a worktree from a normal terminal with
git worktree add. - In Codex Desktop, create a new worktree for the same repository.
- 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
- The
post-checkouthook's marker/output is absent, and the hook-based setup does not run.
Expected behavior
Codex Desktop should either:
- run the repository's
post-checkouthook as normal Gitworktree adddoes; 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 addis executed from a normal terminal. - Git normally invokes
post-checkoutaftergit 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.