/thrum:sleep-extendedfrom thrum
Parks the agent with a comprehensive 16-section snapshot for cold-restart recovery of wire contracts, capability matrix, and design rationale. Requires a tmux session.
Ships in thrum. Installing the plugin adds it to Claude Code.
Compose a comprehensive 16-section prose continuation, write it directly to your
restart file, then end session cleanly and kill own tmux session. The agent goes
to sleep until the operator wakes it later. Same termination semantics as
/thrum:sleep; the only difference is snapshot grade.
/thrum:sleep (standard) for routine park-and-resume where future-you
can reconstruct from project state + a compact 11-section snapshot./thrum:sleep-extended (this variant) for designer/architect-grade
work: parking a complex brainstorm with multiple Leon-decided forks, parking a
fanout implementation (≥3 call sites or ≥2 epics), or any sleep where the next
wake may be a fresh restart and must recover wire-contract precision without
re-reading the source files.# Resolve identity + your worktree (needed before reading the partial).
# $REPO must be YOUR worktree — the directory `thrum prime` reads the restart
# snapshot back from. Resolve it from the daemon's authoritative identity, NOT
# `git rev-parse` (which keys off the current shell CWD and would write to the
# wrong .thrum/restart/ if a bash step left your worktree). Fall back to git
# only if whoami can't answer.
REPO=$(thrum whoami --field worktree 2>/dev/null)
[ -n "$REPO" ] || REPO=$(git rev-parse --show-toplevel) || { echo "ERROR: cannot resolve your worktree"; exit 1; }
AGENT=$(thrum whoami --field agent_id) || { echo "ERROR: agent not registered"; exit 1; }
[ -n "$AGENT" ] || { echo "ERROR: empty agent_id"; exit 1; }
mkdir -p "${REPO}/.thrum/restart"
# Tier 1 pre-check: tmux session must exist BEFORE writing snapshot:
SESSION=$(thrum whoami --field tmux_session)
if [ -z "$SESSION" ]; then
echo "ERROR: the sleep-extended command requires a tmux-managed agent session (tmux_session field is empty)."
echo "Use the restart-extended command for non-tmux sessions."
exit 1
fi
If tmux_session is empty: ABORT before writing any snapshot. No status change,
no session end. Exit code 1.
Read the partial at the absolute path:
${REPO}/claude-plugin/commands/_snapshot-protocol.md
Apply its Step 2 (compose your continuation) per the structure guidance.
Use the EXTENDED 16-section structure. The structure block is §1. through
§16. with per-section guidance documented in the partial.
Note on §3 framing: For sleep snapshots, §3 frames as "where work stands at park time" rather than "what shipped" — the agent is parking, not completing. Composition discipline (1–3 sentences, specific, load-bearing-first) is identical to restart-extended.
Per Step 3 of the partial, use the Write tool to save your composed continuation
to ${REPO}/.thrum/restart/${AGENT}.md. On next boot, thrum prime
auto-injects this file — same mechanism as restart wake.
thrum agent set-status idle
# NOTE: idle-status write becomes observable after thrum-9neg lands.
Per thrum-9neg agent-status-wiring verdict, idle is the signal that this agent
has parked. NO new "sleeping" state was added — idle covers both "no active
work" and "parked for operator wake."
If thrum agent set-status returns an error, continue to Step 5 — the snapshot
on disk is the load-bearing artifact.
thrum session end
This emits agent.session.end cleanly so the dead-agent sweeper does NOT treat
the disconnect as a crash.
thrum tmux kill "$SESSION"
Tmux pane terminates → runtime process exits → no further activity until operator wakes the agent.
The operator brings you back via thrum tmux create <session-name>. On runtime
start, thrum prime auto-injects the snapshot — same mechanism as restart.
Resume from §16 immediate-next-actions.
The snapshot file moves to .thrum/agents/<your-agent-id>/sessions/ archive on
wake (same as restart).
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub thrum-team/thrum --plugin thrum15 commands in this plugin
/inboxCheck message inbox/load-contextLoad ContextRestore saved agent work context after compaction or session restart/overviewCombines identity, team, inbox, and sync status/primeFirst turn: emit a one-line ackLoad AI-optimized session context/quickstartRegister agent and start session/replyReply to a messageOther plugins' commands for the same job