Sessions in worktrees cannot be resumed after worktree cleanup

Resolved 💬 3 comments Opened Feb 24, 2026 by DanielPBak Closed Feb 28, 2026

Bug

When using claude --worktree / claude -w, the session runs inside a temporary worktree directory (e.g. .claude/worktrees/<name>/). On /exit, Claude prints:

Resume this session with claude --resume <session-id>

But running claude --resume <session-id> fails because the worktree directory no longer exists — it was cleaned up when the session ended.

Expected behavior

Sessions started in worktrees should always be resumable, just like any other session. The resume mechanism should not depend on the worktree directory still being present. Possible approaches:

  • Resume into the parent repo directory instead of the now-deleted worktree path
  • Recreate the worktree on resume if needed
  • Store session state in a location that survives worktree cleanup

It should never be the case that a conversation simply cannot be resumed just because it was started in a worktree. The --resume suggestion on exit is misleading if it doesn't actually work.

Repro steps

  1. claude -w (starts a session in a new worktree)
  2. Do some work, then /exit
  3. Copy the --resume command from the exit message
  4. Run claude --resume <session-id> — fails because the worktree directory is gone

View original on GitHub ↗

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