Feature worktree edits land in the main worktree

Resolved 💬 2 comments Opened Oct 22, 2025 by shanev Closed Jan 10, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.47.0

What subscription do you have?

Pro

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 25.0.0 arm64 arm

What issue are you seeing?

If a feature worktree is created while in a session on the main worktree, it often writes to the main worktree, leaving both in a bad state.

What steps can reproduce the bug?

  1. Launch Codex from the main git worktree.
  2. Ask it to create a new worktree (and branch) for a feature.
  3. It will often write to the main worktree accidentally, corrupting any ongoing work in that worktree.

What is the expected behavior?

  1. Launch Codex from the main git worktree.
  2. Ask it to create a new worktree (and branch) for a feature.
  3. It will make edits in the feature worktree / branch.

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #3727
  • #3749
  • #3748
  • #3459
  • #5057

Powered by Codex Action

etraut-openai contributor · 7 months ago

Closing old issue.