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

Open
#36,559 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, rust

Research direction

Start by tracing Codex Desktop's worktree-creation path and the internal Git commands shown in the logs, checking whether -c core.hooksPath=/dev/null is applied there. Reproduce with a repository post-checkout hook and compare the app's behavior with git worktree add. Done means hooks run during app-managed creation or the supported opt-in setup behavior is documented and tested.

Written by the indexing model from the issue text.

Description

app bug hooks
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.
Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.