Feature request: /fork should support opening in a new terminal tab
Summary
The built-in /fork command creates a fork of the current conversation, but it stays in the same terminal. It should support opening the forked session in a new terminal tab.
Use case
When building a complex feature, I often need to branch into multiple thinking threads that share the same context but explore different angles:
- Try different implementation approaches in parallel — "build it with approach A in one tab, approach B in another"
- Explore tangential concerns without derailing the main thread — "how would this affect the auth system?" or "what if we need to support X down the line?"
- Separate building from reasoning — keep the implementation moving in one tab while discussing architecture and long-term implications in another
These are multiple "discussion rooms" that share the same starting context but each need their own space. The workflow should be: hit /fork, a new tab opens with full context, and I'm immediately in a parallel conversation exploring a different angle — without interrupting the original session.
Currently this requires manually opening a tab, navigating to the directory, and resuming a forked session. The friction kills the flow.
Current workaround
I built a custom /fork-tab command that:
- Echoes a unique token (which gets written to the session's
.jsonlfile) - Greps all session
.jsonlfiles for that token to identify the current session ID - Uses AppleScript to open a new terminal tab and runs
claude --resume <id> --fork-session
This works but is a hack — the token-grep approach is necessary because there's no way to access the current session ID from within a session (no env var, no API, process doesn't keep the .jsonl file open).
Proposal
Two changes that would make this much cleaner:
- Expose
CLAUDE_SESSION_IDas an environment variable in the bash tool subprocess. This eliminates the need for the token-grep hack and enables session-aware tooling.
- Add a
--new-tabflag to/fork(or a separate/fork-tabcommand) that opens the forked session in a new terminal tab, with support for Terminal.app and iTerm2.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗