[FEATURE] Allow resuming a non-existing session and create it on the fly

Resolved 💬 3 comments Opened Apr 5, 2026 by variable Closed Apr 9, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I often need to switch between branches and work on them simultaneously, having a consistent Claude session per branch is essential. I think naming the session by the git branch name would help to achieve this.

I have tried the worktree approach, while it isolates the Claude instances in parallel, it still posts these problems for me:

  1. My other terminals need to cd to the corresponding worktree folder
  2. Claude does not automatically resume the last session

Proposed Solution

If Claude supports resuming a non-existing session, and creates it if it doesn't exist...

then it's pretty trivial to write up a shell script like myclaude.sh that

  1. Get the branch name
  2. Feed the branch name to Claude cli such as claude -r <branch_name>

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. when I git checkout branch_a and run myclaude.sh, Claude will start a session with name branch_a
  2. when I git checkout branch_b and run myclaude.sh, Claude will start a session with name branch_b
  3. when I git checkout branch_a and run myclaude.sh, Claude will resume session with name branch_a

Additional Context

_No response_

View original on GitHub ↗

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