cmux-rebuild

cmux-rebuild is a skill for Claude Code, Codex from DJRHails/dotfiles. It costs 245 tokens per session (4,134 once invoked), scanned A, original, MIT.

Instructions for rebuilding durable development sessions managed with zellij, a terminal multiplexer, and cmux. They cover local and remote sessions, including connections over mosh.

In plain words
What is it for?
Use them to reconnect to local or remote zellij sessions, resume coding-agent conversations, or rebuild lost cmux tabs and panes.
Why use it?
They help recover terminal sessions after cmux restarts while preserving the underlying development work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions subagents; names the AskUserQuestion tool.

Good fit Use them to reconnect to local or remote zellij sessions, resume coding-agent conversations, or rebuild lost cmux tabs and panes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/djrhails/dotfiles/cmux-rebuild
Install

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.

Any agent
npx skills add DJRHails/dotfiles --skill cmux-rebuild
Clone the repo
git clone --depth 1 https://github.com/DJRHails/dotfiles

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for cmux-rebuild

README.md
[![agentmods](https://agentmods.dev/badge/skills/djrhails/dotfiles/cmux-rebuild.svg)](https://agentmods.dev/skills/djrhails/dotfiles/cmux-rebuild)
Your own site
<a href="https://agentmods.dev/skills/djrhails/dotfiles/cmux-rebuild"><img src="https://agentmods.dev/badge/skills/djrhails/dotfiles/cmux-rebuild.svg" alt="Measured on agentmods" height="20"></a>
Per session 245 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,134 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00245 $0.04134
Opus 5 $0.00122 $0.02067
Sonnet 5 $0.00049 $0.00827
Haiku 4.5 $0.00024 $0.00413

Measured today against content hash 9394341ce67f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cmux-rebuild 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 today.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/clean-empty-surfaces.py, scripts/judge-agent-sessions.py, scripts/rebuild-durable.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

modules/agents/skills/cmux-rebuild/SKILL.md · 229 lines

How it starts

The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cmux durable sessions

Dev work lives in zellij sessions named cmux-<host>-<id>. Remote hosts (bonbon, taffy) are reached over mosh (survives high-redraw TUIs; cmux's ws relay adds per-keystroke latency) — each surfaced as a cmux tab running mosh <host> -- zellij attach <session>. The local host (trifle) auto-attaches a local zellij wrapper in every terminal surface. Zellij sessions persist across everything; only the cmux surfaces and mosh transports come and go.

Code: modules/zellij/mosh-zellij.zsh (ssh::durable picker + zellij::resume), durable-remote.sh (remote menu/preview/reap), auto-attach.zsh (attach + de-nest handoff). claude::resume / pi::resume (modules/claude, modules/pi aliases) resolve a session id to its transcript, cd to its recorded cwd, and route the owning config dir.

TMPDIR rule: every local zellij invocation needs TMPDIR=/tmp — the socket dir follows TMPDIR, and a surface shell's macOS default (/var/folders/…) silently sees zero sessions. The scripts force it; do the same in ad-hoc commands.

Attach: ssh::durable and zellij::resume

ssh::durable <host> — fzf picker of the host's live sessions (<cwd> · <AI title> with a dim searchable id tail). Green = connected, computed exactly and fresh on each open: a local mosh-client is talking to that session's mosh-server UDP port (CPU-jiffie sampling was tried and abandoned — keepalive work is sub-jiffie). enter attach · ctrl-r re-summarise · ctrl-x kill · esc fresh. Non-interactive: --list, --attach <session>, --query <str>, --reap.

zellij::resume <session> — the local analogue: stages the attach, de-nests the auto-attach wrapper (deleting its husk), and execs zellij attach <session>.

Rebuild after a cmux restart / mass disconnect

python3 scripts/rebuild-durable.py [hosts...] --dry-run   # plan (hosts default: bonbon taffy <local>)
python3 scripts/rebuild-durable.py [hosts...]             # create surfaces + send attaches
python3 scripts/rebuild-durable.py [hosts...] --retry     # re-send to idle surfaces for stragglers
python3 scripts/rebuild-durable.py [hosts...] --retitle   # rename connected tabs to short ids
python3 scripts/rebuild-durable.py [hosts...] --bind      # backfill cmux resume bindings

Read the full file on GitHub · 229 lines

Files

What ships with it

4 files 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.

Changes

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.

  1. today Changed · +11 lines 9394341ce67f
  2. 3d ago Changed · +29 lines · +13 tokens per session e7bd9899a47c
  3. 4d ago Changed · +1 lines 6637e408ffc6
  4. 8d ago First seen · 188 lines · 232 tokens per session scan A 40519da32186

Subscribe to this mod's changes

cmux-rebuild is a skill published in the GitHub repository DJRHails/dotfiles (2 stars, last pushed today), licensed MIT. It adds 245 tokens to every session and 4,134 once invoked, about $0.0012 per session on Opus 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.

Related

Other skills, from other repositories

todoist-cli

Manage Todoist tasks, projects, labels, filters, sections, comments, reminders, and workspaces via the td CLI. Use when the user wants to view, create, update, complete, or organize Todoist items, or mentions tasks, inbox, today, upcoming, projects, labels, or filters.

joshukraine/dotfiles · 68 tokens

autopilot-batch

Fan out a batch of autopilot-queued issues to parallel background worktree subagents — each runs /autopilot at the build model from its 'model:' label — with a gating review at Opus 5 or above and never below the build (Opus reviews Sonnet and Opus builds, Fable reviews Fable builds).

joshukraine/dotfiles · 75 tokens

autopilot

Carry a well-scoped GitHub issue through the full dev loop autonomously, stopping at a per-run tier boundary (PR-ready, or merge+deploy for small reversible changes).

joshukraine/dotfiles · 40 tokens

qa-handoff

Generate a hands-on QA testing guide as a self-contained HTML page — for Rails apps or static (Hugo) sites. --publish uploads the HTML to the project's configured QA host.

joshukraine/dotfiles · 41 tokens

walkthrough

Generate a hands-on browser walkthrough of a PR's user-facing changes to exercise before review; --publish posts the final version to the PR for QA.

joshukraine/dotfiles · 33 tokens

dustoff

Assess a project that's been dormant for months and produce a prioritized re-entry plan — lifecycle stage, what's stale or broken, and how far the project's tooling has drifted from current conventions — delegating every fix to the skill that owns it, and optionally capturing the plan as a tracking issue that survives…

joshukraine/dotfiles · 64 tokens