Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add DJRHails/dotfiles --skill cmux-fork-sessiongit clone --depth 1 https://github.com/DJRHails/dotfilesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/djrhails/dotfiles/cmux-fork-session)<a href="https://agentmods.dev/skills/djrhails/dotfiles/cmux-fork-session"><img src="https://agentmods.dev/badge/skills/djrhails/dotfiles/cmux-fork-session/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/djrhails/dotfiles/cmux-fork-session"><img src="https://agentmods.dev/badge/skills/djrhails/dotfiles/cmux-fork-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00137 | $0.02989 |
| Opus 5.5 | $0.00055 | $0.01196 |
| Sonnet 5.5 | $0.00027 | $0.00598 |
| Haiku 4.5 | $0.00014 | $0.00299 |
Grade A, and why
cmux-fork-session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
cmux: fork this session into a new split (or tab)
Forks the current agent session into a new cmux split pane (or tab) so you can branch the
conversation and keep working in both, side by side. The new surface gets a new session id with
the same history up to the fork point, is titled fork: <session-name>, and keeps that title.
Both agents are supported; the flavour is autodetected (override with FORK_AGENT):
| agent | detected by | fork command |
|---|---|---|
| Claude Code | CLAUDE_CODE_SESSION_ID |
claude --resume <id> --fork-session |
| pi | PI_CODING_AGENT=true |
pi --fork <session.jsonl> --provider … --model … --thinking … |
pi is checked first: when nested (a pi session launched from Claude Code) pi is the innermost, and is the session the caller is actually talking to.
Usage
Run the reference script — it reads everything from the environment:
bash .../cmux-fork-session/reference/fork-session.sh # split right, title "fork: <name>"
bash .../cmux-fork-session/reference/fork-session.sh "branch: " down # split downward, custom prefix
bash .../cmux-fork-session/reference/fork-session.sh "fork: " tab # new tab instead of a split
Second arg where: right (default) | left | up | down for a split, or tab for a sibling
tab. (The skill base directory is printed when the skill loads.)
Env overrides: FORK_AGENT=claude|pi forces the flavour; PI_SESSION_FILE / PI_SESSION_DIR
pin pi's session log; CMUX_DURABLE_HOST / CMUX_APP_HOST override the remote and app hosts;
CMUX_APP_BIN pins the cmux binary.
What it does
- Resolve the session from env, never the process tree:
CLAUDE_CODE_SESSION_ID+CLAUDE_CONFIG_DIR, or pi'sPI_SESSION_FILE/PI_SESSION_ID. Read the session name and project cwd from$CLAUDE_CONFIG_DIR/sessions/<pid>.json(Claude), or the session JSONL's firstsessionentry plus lastsession_infoentry (pi). - Resolve this session's live cmux surface. Locally, trust the freshly-injected
CMUX_SURFACE_ID. On a remote, find the surface whose title contains a match key — see Surface resolution. The resolved id also heals the live-ids sidecar socmux-session-tabrecovers too. - Create the surface:
cmux rpc surface.splitbeside the caller, orsurface.createfor a tab. - Launch the fork. Claude:
cd <cwd> && <launcher> --resume <id> --fork-session, choosing the launcher that matches the session's config dir —~/.claude-ant→claude::ant(scrubs ambient API keys + ensure step),~/.claude→claude, otherwiseCLAUDE_CONFIG_DIR=<cfg> claude. Matching the wrapper matters: a bareCLAUDE_CONFIG_DIR=… claudeskipsclaude::ant's auth and lands "Not logged in". pi:cd <cwd> && pi --fork <session.jsonl> --provider … --model … --thinking …(see pi specifics). - Title the new tab
fork: <name>viarpc tab.action.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed de2f8267d283
- 3mo ago First seen · 178 lines · 137 tokens per session scan A 00ac2c6d3e87
cmux-fork-session is a skill published in the GitHub repository DJRHails/dotfiles (2 stars, last pushed today), licensed MIT. It adds 137 tokens to every session and 2,989 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
cmux-fork-session compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cmux-fork-sessionDJRHails/dotfiles | Skill | 2 | today | MIT | A | 137 | Claude Code |
| todoist-clijoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 68 | Claude Code |
| autopilot-batchjoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 75 | Claude Code |
| autopilotjoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 40 | Claude Code |
| qa-handoffjoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 41 | Claude Code |
| walkthroughjoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 33 | Claude Code |
| dustoffjoshukraine/dotfiles | Skill | 430 | yesterday | MIT | A | 64 | Claude Code |