STRML

Cmux Restore — Development skill for Claude Code

Development community

Save and restore Claude Code sessions across cmux restarts.

How to install Cmux Restore

This entry records only its repository, not the path inside it, so there is no exact command to give. Open STRML/cmux-restore and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Cmux Restore does

Save and restore Claude Code sessions across cmux restarts.

Alternatives in Development

  • Claude Supermemory — Persistent memory across sessions and projects using Supermemory 2.3k ★
  • Tmux Claude Session Manager — Run many Claude Code sessions across your projects, each in its own tmux session — then list them, see which a 380 ★
  • Harness Remote — Native-session control plane for Codex, Claude Code, OpenCode, OMP and PI 356 ★

README

cmux-restore

Resume Claude Code sessions after restarting [cmux](https://cmux.dev). When you quit cmux, all your running Claude sessions die. This saves them and brings them back.

How it works

  1. A Claude Code hook (SessionStart) records each session's ID and cmux surface UUID as sessions start
  2. cmux-save snapshots all running Claude processes, pairing each with its surface UUID and session ID
  3. cmux-restore sends claude --resume into each surface by UUID after cmux restarts

Surface UUIDs persist across cmux restarts, so restore targets each surface directly — no position matching or prompt parsing needed.

Why not just `claude --continue`?

`--continue` resumes the most recent session per project. If you have multiple Claude sessions in the same directory (common with monorepos or long-running tasks), `--continue` can't distinguish them. The SessionStart hook tracks the exact session ID per surface.

Install

git clone https://github.com/STRML/cmux-restore.git
cd cmux-restore
bash install.sh

This symlinks `cmux-save` and `cmux-restore` into `~/bin` and installs the hook script.

Then add the hook to `~/.claude/settings.json`:

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/hooks/session-restore/on-session-start.sh",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Restart Claude Code or run `/hooks` to apply.

Usage

# Before quitting cmux: snapshot all Claude sessions
cmux-save

# After cmux restarts: resume all sessions
cmux-restore

# Preview without restoring
cmux-restore --dry-run

# Restore even if some Claude sessions are still running
cmux-restore --force

Requirements

H