/mjmendo-plugins:cmux-claude-resumefrom mjmendo-plugins
Re-attach Claude Code sessions to restored cmux panes after a reboot. Records cwd → session_id on Claude start and replays `claude --resume <id>` into each restored pane.
Ships in mjmendo-plugins. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
cmux restores window layout, workspaces, and per-pane cwd after relaunch — but it does not restore the process running in each pane. After a reboot, panes come back empty: you lose the claude process and its session context, even though Claude Code itself keeps the session on disk and can be resumed.
This skill closes that gap by adding two pieces:
cwd → session_id to a small JSON state file.claude --resume <session_id> into every restored terminal pane whose cwd is known.Restore is anchored by directory, not by cmux pane UUID — robust to UUID churn and matches the one-worktree-per-directory mental model.
# Install everything (scripts → ~/.local/bin, hook → ~/.claude/settings.json,
# LaunchAgent → ~/Library/LaunchAgents)
bash "$(dirname "$0")/install.sh"
Re-run the installer at any time — it is idempotent.
# 1. Confirm the Claude hook is wired.
jq '.hooks.SessionStart' ~/.claude/settings.json
# 2. After opening a Claude Code session inside a cmux pane,
# confirm the state file got updated.
cat ~/.local/share/cmux-claude-resume/state.json
# 3. Preview what the restorer would do without sending anything.
cmux-claude-restore --dry-run
bash "$(dirname "$0")/uninstall.sh"
State file is preserved on uninstall — delete ~/.local/share/cmux-claude-resume/state.json manually if you want a clean slate.
| File | Path | Purpose |
|---|---|---|
cmux-claude-record | ~/.local/bin/ | Claude SessionStart hook handler |
cmux-claude-restore | ~/.local/bin/ | One-shot restorer (run by watcher or manually) |
cmux-claude-resume-watcher | ~/.local/bin/ | Polls for cmux up-transitions and fires the restorer |
com.mjmendo.cmux-claude-resume.plist | ~/Library/LaunchAgents/ | Keeps watcher running across login sessions |
| state | ~/.local/share/cmux-claude-resume/state.json | cwd → {session_id, ts} mapping |
| logs | ~/Library/Logs/cmux-claude-resume.log | Watcher & restore output |
cwd has a recorded session_id.read-screen).cwd, only the first one gets resumed. Open a worktree-per-pane for clean 1:1.htop open).# Tail the watcher log
tail -f ~/Library/Logs/cmux-claude-resume.log
# Re-load the LaunchAgent (after install changes)
launchctl unload ~/Library/LaunchAgents/com.mjmendo.cmux-claude-resume.plist
launchctl load ~/Library/LaunchAgents/com.mjmendo.cmux-claude-resume.plist
# See where Claude's session files live (so you know what's being resumed)
ls ~/.claude/projects/
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mjmendo/claude-plugins --plugin mjmendo-plugins4 skills in this plugin
/cmux-agents1. Locate current positionSpin up parallel Claude subagents in cmux panes, delegate tasks, monitor, and close when done./cmux-agents-isolationDecision tableChoose the right isolation strategy when spinning parallel cmux agents — shared filesystem, file ownership, or git worktrees./cmux-agents-promptsFive required elementsWrite effective standalone prompts for cmux subagents. Subagents have no memory of the current conversation — every prompt must be a self-contained spec.