branch-session

Fork a live Claude Code or Codex session into a new tmux session.

5|1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/buddyh/agent-skills --skill branch-session
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: branch-session
Source: https://github.com/buddyh/agent-skills/tree/main/branch-session
Command: npx skills add https://github.com/buddyh/agent-skills --skill branch-session

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tmux, claude, and includes scripts (resource) components.

What problem does it solve?

Branch the current Claude Code or Codex session into a new tmux session. Creates a true fork with a new session ID while preserving conversation state. Use when you want to explore an alternative approach without losing your current context.

Core Features & Use Cases

  • Creates a forked session with a new session ID
  • Preserves conversation state across forks
  • Works with Claude Code and Codex environments
  • Easy to attach to the branched session for continued work

Quick Start

From your working directory, execute the branch-session workflow to create and resume a new branched tmux session.

Frequently Asked Questions about branch-session

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

FAQPage Schema
How do I fork a Claude Code session into a new tmux session?▼

You can fork a Claude Code session into a new tmux session by running the branch-session workflow, which creates a true fork with a new session ID while preserving the original conversation state for parallel work.

Can I branch a Codex session without losing the original conversation context?▼

Yes, you can branch a Codex session without losing context. The workflow creates a forked session with a new ID and preserves the conversation state, allowing you to explore alternatives safely.

Do I need tmux installed to fork a live Claude or Codex session?▼

Yes, tmux is required to fork a live Claude or Codex session. The workflow also requires the claude CLI, detects the host platform, and uses a resume-with-fork mechanism to spawn and attach to the branched session.

What is the best way to explore an alternative approach in Claude Code without losing context?▼

The best way to explore an alternative approach without losing context is to branch the current Claude Code session into a separate tmux session. This preserves your original conversation state while enabling parallel experimentation.

Does branching a session work with both Claude Code and Codex environments?▼

Yes, forking a session into tmux works with both Claude Code and Codex environments. It detects the host platform and uses a resume-with-fork workflow to spawn and attach to the branched session.

How does the resume-with-fork workflow spawn a new branched tmux session?▼

The resume-with-fork workflow detects your host platform and spawns a new tmux session with a unique ID. It preserves the conversation state across the fork, allowing you to attach to the branched session for continued work.