Worktree cwd is not restored on session resume

Resolved 💬 4 comments Opened Mar 5, 2026 by 7tsuno Closed Mar 8, 2026

Description

When Claude creates and works in a git worktree via EnterWorktree, resuming the session (via --resume or --continue) resets the working directory back to the main repository root.

Steps to reproduce

  1. Start a Claude Code session in a git repository
  2. Ask Claude to create a worktree and work in it (Claude uses EnterWorktree)
  3. Exit the session
  4. Resume the session with claude --resume or claude --continue

Expected behavior

The working directory should be restored to the worktree path where the session was last active.

Actual behavior

The working directory is reset to the main repository root.

View original on GitHub ↗

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