Resume message should include --worktree flag when session was in a worktree

Resolved 💬 3 comments Opened Mar 10, 2026 by ThibautCuchet Closed Mar 14, 2026

Problem

When closing a Claude Code session that was running inside a git worktree, the exit message shows:

Resume this session with:
claude --resume <session_id>

This works fine if the worktree still exists — claude --resume does successfully resume the session in the correct worktree. However, the message doesn't mention which worktree the session was running in, which makes it confusing and easy to lose track of context.

Expected behavior

The resume message should include the worktree information:

Resume this session with:
claude --resume <session_id> --worktree <worktree_name>

This way the user immediately knows which worktree the session belonged to, and can recreate it if needed.

Why this matters

  • If the worktree has been cleaned up in the meantime, the bare --resume will fail (see #28314, #28019)
  • Even when it works, the user has no visual indication of which worktree/branch context they're resuming into
  • It's a small DX improvement that makes the resume flow much clearer for worktree-based workflows

Related issues

  • #28314 — Sessions in worktrees cannot be resumed after worktree cleanup
  • #28019 — Teleport/resume should discover sessions across git worktrees
  • #31969 — Feature: Enter/resume existing worktrees, configurable branch naming

View original on GitHub ↗

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