[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:
- My other terminals need to cd to the corresponding worktree folder
- 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
- Get the branch name
- 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
- when I
git checkout branch_aand runmyclaude.sh, Claude will start a session with namebranch_a - when I
git checkout branch_band runmyclaude.sh, Claude will start a session with namebranch_b - when I
git checkout branch_aand runmyclaude.sh, Claude will resume session with namebranch_a
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗