From cas
Snapshots and restores Claude Code sessions across macOS reboots via Ghostty terminal. Prevents session loss when restarting your machine.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cas:phoenix restart | snapshot | restore | arm | disarm | statusrestart | snapshot | restore | arm | disarm | statusopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
██████╗ ██╗ ██╗ ██████╗ ███████╗███╗ ██╗██╗██╗ ██╗
██╔══██╗██║ ██║██╔═══██╗██╔════╝████╗ ██║██║╚██╗██╔╝
██████╔╝███████║██║ ██║█████╗ ██╔██╗ ██║██║ ╚███╔╝
██╔═══╝ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔██╗
██║ ██║ ██║╚██████╔╝███████╗██║ ╚████║██║██╔╝ ██╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝
◎ Reboot without losing a single session ◎
CLAUDE AGENT SYSTEM
⚠ BETA — macOS + Ghostty only ⚠
MANDATORY: Output the banner above verbatim as your very first message, before any tool calls.
⚠ BETA — macOS + Ghostty only
Newly shipped and validated against a real 15-session setup, but not yet battle-tested across machines. It reopens sessions in Ghostty only (the reopen step uses
ghostty -e), and the auto-reboot needs macOS. If anything misbehaves: your sessions are armed independently of the reboot, so the safe path is/phoenix snapshot→/phoenix arm→ reboot manually. Cancel a pending restore anytime with/phoenix disarm. Feedback: https://github.com/Kasempiternal/Claude-Agent-System/issues
Phoenix makes rebooting cost-free when you have many claude sessions open. It captures the
live session set, arms a one-shot login agent, and (optionally) reboots. On the next login,
every session reopens as a tab in one Ghostty window, cd'd to its original directory and
resumed with claude --resume <id>.
All behavior lives in a single dependency-free Node script. The skill's only job is to run the right subcommand and print its stdout to the user verbatim.
ps finds the claude CLI process trees and
lsof recovers each one's working directory plus the conversation transcript
(~/.claude/projects/<enc>/<uuid>.jsonl) it holds open — the transcript basename is the
session id. This correctly separates multiple sessions sharing one directory (each tree holds
its own transcript open). The Electron desktop app and daemon "spare" processes are filtered out.open -na Ghostty --args -e zsh -lc "…cd <dir> && exec <abs claude> --resume <id>"); each
remaining session is added as a tab via keystroke automation (osascript → activate Ghostty →
Cmd+T → paste the command → Return), because Ghostty has no CLI to open a tab on macOS
(+new-window is unsupported there; new_tab exists only as a keybind). The claude path is
absolute (resolved + stored at snapshot time) because Ghostty's zsh -lc is a non-interactive
login shell that does not source ~/.zshrc, so claude would not be on PATH otherwise.~/.cas/phoenix/ (snapshot.json, ARMED flag, a copy of the
script, restore.log). The login agent is ~/Library/LaunchAgents/com.cas.phoenix.restore.plist.Treat the first word of $ARGUMENTS (default to status if empty, and confirm intent before any
destructive action):
| User typed | Run |
|---|---|
/phoenix restart | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" restart |
/phoenix snapshot | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" snapshot |
/phoenix restore | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" restore |
/phoenix arm | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" arm |
/phoenix disarm | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" disarm |
/phoenix status | node "${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js" status |
Useful flags: restart --dry-run (snapshot + arm, print the reboot command instead of rebooting);
restore --dry-run (print the exact launch commands without opening windows).
restart — the full auto path: snapshot → arm → 5-second abort countdown → reboot via
osascript … System Events restart. After login the one-shot agent reopens everything, then
removes itself. This reboots the machine and ends the current session — confirm with the user
first, and tell them their sessions (including this one) will reappear after they log back in.snapshot — capture the current sessions to ~/.cas/phoenix/snapshot.json. Non-destructive.arm / disarm — install / remove the one-shot login restore agent. arm does not reboot.restore — reopen everything from the snapshot now (also what the login agent runs). Avoid
running this while the captured sessions are still live — it would open second windows on them.status — armed? snapshot age + captured sessions, agent installed?, recent restore log.Recommended manual flow (if the user prefers to control the reboot): /phoenix snapshot →
/phoenix arm → reboot manually whenever ready → sessions auto-reopen on next login.
Ghostty.app.Cmd+T + paste),
which requires the controlling process to be allowed under System Settings → Privacy & Security →
Accessibility. Run manually (/phoenix restore) from a session that already has it and tabs build
reliably (proven). At login (the auto-restore agent), keystroke permission is less certain — if
tabs don't appear after a reboot, the first session's window still opens; re-run /phoenix restore
from it, or grant Accessibility to the relevant process. Focus briefly moves to Ghostty while tabs
are created, so don't type elsewhere during restore.System Events restart can prompt for Automation/
Accessibility consent, and macOS may pause if an app has unsaved work. If the auto-reboot doesn't
fire, sessions are already armed — just reboot manually and they reopen on next login.claude -c), which can be ambiguous if several share the dir./phoenix restart) for the next reboot. Cancel a pending restore anytime with /phoenix disarm.snapshot won't be restored — re-run
snapshot (or use restart, which snapshots automatically) right before rebooting.${CLAUDE_PLUGIN_ROOT}/skills/phoenix/scripts/phoenix.js~/.cas/phoenix/ (snapshot.json, snapshot.md, ARMED, phoenix.js copy, restore.log)~/Library/LaunchAgents/com.cas.phoenix.restore.plistnpx claudepluginhub p/kasempiternal-cas-claude-agent-system-pluginDiscovers, searches, and selectively restores Claude desktop app sessions hidden across multiple accountIds. Use when sessions disappear after account switch or when running multiple accounts.
Transfers Claude Desktop sessions between accounts, recovers old sessions with a handover brief, rebinds cwd after folder moves, and audits broken bindings.
Spawns and manages persistent tmux-based Claude Code CLI sessions with bidirectional communication. Subcommands: spawn, send, read, status, list, kill for parallel peer orchestration and multi-turn steering.