/mstack:m-handofffrom mstack
Saves or restores working state in .mstack/handoff.md before compact, model switch, or session end. Captures decisions, progress, and recent steps so the next session resumes without reconstructing context.
Ships in mstack. 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; scripts run unread.
A handoff is a durable, overwritable checkpoint of decisions and where you are, not a chat transcript. Write it at every leaving-point so the next session reads one short file instead of reconstructing context from scratch — and so your decisions don't die with the context window.
Use at: before /compact, before switching model or harness, at session end, and before a long-running job starts unattended.
Do NOT use it for the m-goal closeout (m-goal owns that and writes it inside .mstack/goals/<slug>.md; the handoff only links to it), for lessons that should live in durable memory (→ m-learn), for fresh planning (→ m-think / m-plan), or for shipping (→ m-ship). The handoff is the current-state record, not a knowledge base.
git status --short, and changed files — no code edits here; read only..mstack/handoff.md (overwrite; move the prior one to .mstack/handoff-archive/). Lay it out in three layers (template: references/handoff-template.md):
## Closeout if one exists (the handoff never writes the closeout itself).(done) / (verified) / (assumed); notes (gotchas, blockers, things tried that failed).(assumed), never a completion token. Provenance is what makes a resume safe instead of a fresh start..mstack/handoff.md exists, read it first and resume from the top unchecked step — re-verify anything marked (assumed) before running it; git may have moved past the save. An ## Auto snapshot section (written by the plugin's pre-compact hook, see Harness notes) is mechanical state only: trust its branch/status data, but it carries no decisions. .mstack/handoff-excerpt.md, when present, holds the original request and the latest turns verbatim (a budgeted selection, not a summary): where it and a compaction summary disagree, the excerpt wins.git log / git status and the harness's transcript dir rather than pretending nothing happened.A written .mstack/handoff.md (markdown, three layers), plus on restore a tight brief: up to ~5 status lines (one per thread, tagged [in flight] / [open PR #N] / [verified, uncommitted] / [planned]), at most ~5 recurring problems, and the single most useful next step.
(assumed) or verify it first; a false checkpoint is worse than none.head) → treat every "remaining" item as (assumed) and verify before acting; do not silently continue.$CLAUDE_CONFIG_DIR/projects/<encoded-cwd>/<uuid>.jsonl — a source when no handoff exists.hooks/hooks.json at the plugin root): PreCompact runs hooks/precompact.mjs, which writes one ## Auto snapshot section (branch, git status --short, the goal whose state.json says active, timestamp) into .mstack/handoff.md, plus .mstack/handoff-excerpt.md from the transcript (first user request kept whole, then the newest turns and command outcomes within 16 KB, omissions counted with the transcript path), replacing the previous auto-snapshot section instead of appending another — hand-written content above it is kept. A repo with no commits yet is labelled (no commits yet). SessionStart with matcher compact runs hooks/session-compact.mjs, which prints a one-line reminder to read the handoff if it exists. Both exit 0 on any error, finish well under a second, and never touch the network. The decisions layers stay the job of this skill.send_message to a still-live child to request its own handoff before it exits; subagent_fork inherits this session, so a fork can resume directly.codex exec gets the handoff path in its prompt, since it has no shared session memory.What SKILL.md sets; muted values are Claude Code's defaults
Before compaction, switching models, or ending a session; or when asked to resume / "where was I" / "pick up where I left off".
17 skills in this plugin
/m-cuaDrive a real desktop app, Android device or browser to prove L3/L4 acceptance. Use for 点一下/操作界面/真机验收/computer use./m-debugRoot-cause a bug or failing test: reproduce, competing hypotheses, regression test. Use for debug一下/为什么报错/这个测试挂了./m-deslop删掉 AI 味和冗余——多余注释、死代码、无谓抽象、套话堆砌,先保护行为再减。Use when the user says "deslop / 去AI味 / 删冗余 / 这段太啰嗦 / 精简一下", or a diff feels bloated./m-dispatchFan independent subtasks out to Claude subagents, DSH headless, Codex or Orca; isolate, merge, verify. Use for 分派/并行/开N个agents.npx claudepluginhub mola-maker/mstack --plugin mstackOther plugins' skills for the same job