Skip to content
Back to skills

Branch

ASecurity

Branch this Claude Code session into a new cmux split. Current pane keeps running; new pane resumes a clone of the transcript. Use when asked to 'branch this session', 'split this off into a new pane', or invoked as '/branch'.

  • 30 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 8, 2026
ai-agentsbash

Works with

  • claude code
  • terminal
  • cli

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill branch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Branch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Branch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-branch-claude-skill-registry-data/badge)](https://www.skillsdirectory.com/skills/majiayu000-branch-claude-skill-registry-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: "Branch this Claude Code session into a new cmux split. Current pane keeps running; new pane resumes a clone of the transcript. Use when asked to 'branch this session', 'split this off into a new pane', or invoked as '/branch'."
user-invocable: true
---

# Branch Session

Branch the current Claude Code session into a new cmux split so two divergent threads can run side-by-side. The current pane keeps running the original session; the new pane resumes a clone of the transcript.

## Prerequisites

Must run inside a cmux terminal (script checks `CMUX_WORKSPACE_ID`). `cmux` CLI must be on `PATH`.

## Process

Run the worker script shipped with this plugin:

```bash
bash "${CLAUDE_PLUGIN_DIR}/scripts/branch.sh"
```

The script will:

1. Locate the current session transcript under `~/.claude/projects/<cwd>/<uuid>.jsonl` (most-recently-modified `.jsonl` in the project dir).
2. Clone the transcript to a fresh UUID and rewrite the inner `sessionId` field on every line.
3. Open a new cmux pane below the current one (`cmux new-pane --direction down`).
4. Send `claude --resume <new-uuid>` into the new pane.

After the script returns, report the original and branched session IDs to the user.

## Caveats

- Picks the most-recently modified `.jsonl` in the project dir as "the current session." If multiple concurrent Claude Code sessions write to the same project dir, the heuristic can pick the wrong one.
- The new pane's surface ref is parsed from `cmux new-pane` stdout. If the output format changes, the script falls back to sending to the focused surface (still correct because `--focus true` is set on the new pane).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.