Hey, thanks for the report. This looks like a known issue with worktrees, where the agent loses the worktree context and switches back to the main directory.
A few similar reports from the last few days:
- Multi agent mode loose worktree and Apply / Undo Apply
- π Bug Report: Path Resolution Inconsistency in Git Worktree Mode
- Worktree apply does not work (and other bugs)
The team is working on fixes for worktree functionality. To help with debugging, can you share:
- The Request ID for a specific case where the agent switched directories (chat context menu β Copy Request ID)
- The exact prompt text that triggered the switch
- Did you use file mentions (the @ symbol) to reference files from the main directory?
Item 3 is especially interesting. Thereβs a known bug where file mentions in worktrees can cause edits to be applied to files in the main branch instead of the worktree.