Hey, thanks for the detailed report. This is a known issue: agents in a worktree can lose context and switch back to main. I also see @Ingvar is confirming the same thing.
The team is working on a fix, and we have a few active tickets around worktree functionality. Related reports:
- Worktrees are not working as expected
- 🐛 Bug Report: Path Resolution Inconsistency in Git Worktree Mode
To help with debugging, can you share:
- The Request ID for a specific case where the agent lost the worktree (chat context menu, then Copy Request ID)
- The exact prompt that triggered the switch
- Whether you used any @ mentions for files from the
maindirectory
Item 3 is especially important. There’s a known bug where @ mentions in a worktree can cause edits to happen in main instead of the worktree.