[BUG] /resume inside worktree session switches cwd to main repo
Resolved 💬 3 comments Opened Apr 8, 2026 by yfguo Closed Apr 9, 2026
Bug Description
When using /resume inside a worktree session to resume a previous session from the same worktree, the cwd switches to the main git repository root instead of staying in the worktree.
Steps to Reproduce
- In a git repo, start a worktree session:
claude -w my-feature - Claude creates a worktree and starts the session in it
- Do some work, create a commit, then exit the session while keeping the worktree
- Start a new session in the same worktree:
claude -w my-feature - Confirm cwd is the worktree directory -- this works correctly
- Use
/resumeto resume the previous session from step 2 - Observe that cwd changes to the main repo root instead of staying in the worktree
Expected Behavior
After /resume, the cwd should remain in (or switch back to) the worktree directory, per the v2.1.81 changelog: "Resuming a session that was in a worktree now switches back to that worktree."
Actual Behavior
The cwd switches to the main git repository root after /resume.
Environment Info
- Platform: macOS (darwin)
- Version: 2.1.96
- Terminal: Ghostty
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗