/cc-self:restart [session-id] [-- extra-resume-flags]from cc-self
This skill should be used when the user asks to "restart your session", "restart yourself", "reload your session", or when the session itself determines a restart is needed (e.g. after a plugin update or harness change that requires a fresh process). Restarts the current Claude Code session in place via /exit + claude --resume, preserving the full conversation.
Ships in cc-self. 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.
None: SKILL.md is the whole skill.
The session cannot restart itself directly — its own death kills its Bash tool.
The bundled script delegates a driver to the tmux server, which outlives the
session: it waits for the current turn to end, types /exit, relaunches
claude --resume <sid> in the same pane, waits for the resumed TUI to draw
its own (framed) input box and settle, and types a wake-up message so the
resumed session reports back.
../../scripts/cc-self (i.e. <plugin-root>/scripts/cc-self). Invoke it
through bash — plugin files may lose the executable bit on install.bash <plugin-root>/scripts/cc-self sid (uses $CLAUDE_SESSION_ID, falling
back to the newest transcript in ~/.claude/projects/<encoded-cwd>/).$TMUX_PANE is set (the session must run inside tmux)~/.claude/projects/<encoded-cwd>/<sid>.jsonl existsbash <plugin-root>/scripts/cc-self restart <sid>
The driver pins the session's current model and effort onto the resume
command automatically. To deliberately change them (or pass any other
resume flag), append them after -- — they replace the pinned ones:
bash <plugin-root>/scripts/cc-self restart <sid> -- --effort max
~/.claude/settings.json) and passes --model/--effort explicitly on
resume. A bare --resume would reset effort to the default, and the changed
system prompt would break the warm prompt cache. Setting effort via the TUI
after resume is too late for the same reason — resume-time CLI args are the
only cache-safe path.claude-fable-5[1m] for 1M context) the driver pins that form. All typed
flag values — pinned and -- passthrough alike — are single-quoted when
typed, because the resume command lands in a live zsh where a bare [1m]
is a glob ("no matches found" and the relaunch never runs). Pass raw values
after --; the driver quotes each token itself.CC_SELF_BASELINE, CC_SELF_GUARD_DISABLED)
are read from the session's environment at arm time and typed as an
assignment prefix on the resume command, so the relaunched process keeps
them (self only; a --pane target's environment is unknown to us).--dangerously-skip-permissions
only if the footer showed "bypass permissions on" before exiting./exit opens a "Background work is running"
confirm dialog instead of exiting; the driver detects it and confirms the
preselected "Exit and stop tasks". This is why step 3 checks for critical
background work before arming — anything still running is stopped./exit is staged, not typed blind: at idle the leading / opens the
command palette, which can swallow same-tick characters (a live incident
submitted the stray remainder as a fake user message). The driver pastes
it and presses Enter only after the input box visibly holds /exit; if
staging fails three times it aborts with the session left intact.restart refuses to arm while a recover or restart
driver is alive for the session (--force supersedes it). State is in
~/.cc-self/state/restart-<sid>.json; drivers always exit 0 (tmux would
echo a non-zero exit as a view-mode overlay on the focused pane).~/.cc-self.log — every driver phase is
logged. Manual recovery: claude --resume <sid> in the pane.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/model-recoveryThis skill should be used when a "[model-guard]" note reports the session is running below its declared baseline model (e.g. "This session runs as Opus 4.8 … Declared baseline: Fable 5"), when the user asks to "recover the model", "switch back to the baseline model", "restore Fable 5", or after a "[cc-self recover]" verification wake message arrives. Runs the deterministic compact-first recovery built into cc-self./self-controlThis skill should be used when the session needs to perform a user-side action on its own Claude Code TUI — run a slash command on itself ("/reload-plugins", "/effort low", "/model", "/plugin install ..."), answer its own confirmation dialogs, observe its own screen, or when the user asks to "change your own effort", "reload plugins yourself", "install this plugin yourself", "control your own session", "type into your own TUI", or "restart your session" (for restart, prefer the cc-self:restart skill).npx claudepluginhub dev-jahn/cc-self --plugin cc-self