Prevent agents from switching worktrees unexpectedly

Hey, thanks for the feedback. This is a known issue. The agent can lose its binding to the current worktree and switch to another one for no clear reason. You’re not the first user to report this.

A few similar threads for context:

Worktree support is being actively reworked. The team knows the current implementation isn’t reliable, especially around keeping the agent tied to a specific worktree. What you’re describing, explicit and persistent binding, is part of what’s planned. There’s no timeline yet, but your report helps us prioritize it.

For now, the workaround is to keep an eye on which worktree the agent is using. If it switches, tell it in your prompt to go back to the right worktree and branch.

Let me know if you have any questions.