Feature worktree edits land in the main worktree

Resolved 💬 2 comments Opened Oct 22, 2025 by shanev Closed Jan 10, 2026

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 ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗