Skip to content

Feature worktree edits land in the main worktree #5483

@shanev

Description

@shanev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions