branch-pane

Forks the current Claude conversation into a new tmux pane with full history.

1|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill branch-pane-azaidrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: branch-pane
Source: https://github.com/azaidrahman/zaid-sani-dotfiles/tree/main/dot_claude/skills/branch-pane
Command: npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill branch-pane-azaidrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When working in Claude Code inside tmux, you sometimes want to explore a second angle of a problem without losing your current session. Manually copying context into a new session wastes tokens and loses nuance. This Skill forks the live conversation into a side-by-side pane so both sessions share the complete history. ## Core Features & Use Cases - Conversation Forking: Runs claude --resume <id> --fork-session in a new unfocused tmux pane, leaving your original session untouched. - Deterministic Scripting: A single bash script detects the session id (from $CLAUDE_CODE_SESSION_ID or the newest project .jsonl), splits the pane horizontally or vertically, titles it fork:<short-id>, and reports the ids. - Context Discipline Guidance: Instructs the agent to never write handoff summaries, since the fork inherits the entire conversation history. - Use Case: While debugging a production issue, fork the chat into a side pane to investigate a JWT hypothesis in parallel while the original pane continues on the database theory. ## Quick Start Ask Claude to branch this conversation into a new tmux pane, optionally specifying a vertical split.

Frequently Asked Questions about branch-pane

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fork a Claude Code conversation into a new tmux pane?

Run the branch-pane.sh script inside tmux; it reads the current session id, splits a new unfocused pane in the same directory, and launches claude --resume <id> --fork-session there. Pass "v" as an argument for a vertical split instead of the default horizontal one.

How to run two Claude sessions with the same conversation history?

Use the --fork-session flag with claude --resume to create a new session that inherits the full conversation history. The branch-pane script automates this by opening the fork in a separate tmux pane so both sessions run side by side.

Does branch-pane work outside of tmux?

No, the script aborts immediately if the $TMUX environment variable is unset, since it relies on tmux split-window to create the new pane. You must run it from within an active tmux session.

What happens if CLAUDE_CODE_SESSION_ID is not set?

The script falls back to locating the newest session .jsonl file for the current project directory under ~/.claude/projects and derives the session id from its filename. If no session file is found, it exits with an error.

Should I write a handoff summary for the forked session?

No. The fork inherits the entire conversation history, so summaries duplicate context it already has and waste tokens in the origin pane. At most, add a half-sentence assigning the fork a specific angle.