[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

  1. In a git repo, start a worktree session: claude -w my-feature
  2. Claude creates a worktree and starts the session in it
  3. Do some work, create a commit, then exit the session while keeping the worktree
  4. Start a new session in the same worktree: claude -w my-feature
  5. Confirm cwd is the worktree directory -- this works correctly
  6. Use /resume to resume the previous session from step 2
  7. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗