“Continue in worktree” creates a worktree, but Codex keeps working in the original checkout

Open 💬 1 comment Opened Jul 20, 2026 by saibotma

What version of the Codex App are you using (From “About Codex” dialog)?

26.715.52143

What subscription do you have?

Pro 200$

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Description

I started a thread in a normal local checkout and then selected Continue in worktree. The worktree was created, but the thread entered an inconsistent state where different features referred to different directories.

This has happened more than once.

Observed behavior

  • The thread list item indicates that the thread is in a worktree.
  • Open in IntelliJ opens the worktree directory.
  • Copy working directory copies the path of the original, non-worktree checkout.
  • The Environment panel still shows Local.
  • The agent’s shell working directory and writable workspace root remain pointed at the original checkout.
  • Consequently, the agent creates branches, edits files, runs tests, and starts builds in the original checkout.

This suggests that the thread’s worktree metadata and IDE integration are updated, while its runtime environment remains attached to the original directory.

Expected behavior

After selecting Continue in worktree, every part of the thread should consistently use the new worktree:

  • Agent working directory
  • Writable workspace root
  • Terminal and command execution
  • Copy working directory
  • Open in IntelliJ
  • Environment panel
  • Thread list indicator
  • Repository and Git context

The environment should identify itself as a worktree rather than continuing to display Local.

What steps can reproduce the bug?

Steps to reproduce

  1. Start a thread in a normal local repository checkout.
  2. Select Continue in worktree.
  3. Confirm that the thread list displays the worktree indicator.
  4. Compare the results of:
  • Open in IntelliJ
  • Copy working directory
  • pwd in the agent’s shell
  • The Environment panel
  1. Ask the agent to modify files or create a branch.
  2. Observe that the changes are made in the original checkout rather than the worktree.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗