Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Session handoff and resume for M0. Write a compact_checkpoint before a session ends or context is compacted, and resume from the latest one at the start of a session in any tool. Turns a cold start into a continuation. Triggers on: 'm0 handoff', 'hand off', 'session handoff', 'save session state', 'resume where we left off', 'pick up where we left off', 'before I compact', 'end of session', 'continue in Cursor', 'continue in Claude Code'.
.claude/skills/coco-research-m0-handoff/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 76% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 62% | 0% |
Two halves of one flow, both against the M0 operational thread:
compact_checkpoint that a session with no other contextcould act on.
This is what M0 exists for. Everything else in the bundle supports it.
bashM0="${M0_BASE_URL:-http://127.0.0.1:8787}" M0S="$HOME/.claude/skills/m0/scripts" PROJECT="${M0_PROJECT:-$(basename "$PWD")}" # Hand off curl -s -X POST "$M0/api/brain/checkpoint" -H 'Content-Type: application/json' -d "$(python3 - <<'PY' import json, os, subprocess def git(*a): try: return subprocess.check_output(("git",)+a, text=True, stderr=subprocess.DEVNULL).strip() except Exception: return None print(json.dumps({ "project": os.environ.get("M0_PROJECT") or os.path.basename(os.getcwd()), "kind": "compact_checkpoint", "source_tool": "claude-code", "branch": git("rev-parse", "--abbrev-ref", "HEAD"), "head_sha": git("rev-parse", "--short", "HEAD"), "text": "<what state the work is in>", "next_step": "<the single next action>", "last_verified": "<command and its actual result>", "meta_json": {"open_questions": ["<anything unresolved>"]}, })) PY )" # Resume curl -s "$M0/api/brain/thread?project=$PROJECT&kind=compact_checkpoint&limit=1" | python3 -m json.tool
Serverless equivalents, same store:
bashpython3 "$M0S/m0_server.py" write --project "$PROJECT" --kind compact_checkpoint \ --text "…" --next-step "…" --last-verified "…" \ --branch "$(git rev-parse --abbrev-ref HEAD 2>/dev/null)" \ --head-sha "$(git rev-parse --short HEAD 2>/dev/null)" python3 "$M0S/m0_server.py" read --project "$PROJECT" --kind compact_checkpoint --limit 1
Write one before the context window is compacted, before a session ends, and before switching tools. Do not wait to be asked.
$M0_PROJECT, else the repository or directory name.The same value the earlier entries used; check with /m0-recall if unsure.
| Field | What belongs there | |-------|--------------------| | text | Where the work stands. What is done, what is half-done, what is broken. Prose, no jargon from this conversation. | | next_step | The single next action, concrete enough to start on. One action, not a plan. | | last_verified | The command that was run and what it actually printed. Empty if nothing was verified. | | meta_json | Anything structured worth keeping: {"open_questions": [...], "files": [...], "pr": 42}. |
branch and head_sha. Without them a reader cannot tell whetherthe checkpoint describes the tree in front of them.
source_tool to the tool you are running in, so the next reader knowswhere the work happened.
deferred: true means the store was busy and the entryis spooled to a sidecar file: real, readable, and landing on the next drain, but say so rather than reporting a clean write.
json{ "kind": "compact_checkpoint", "text": "Auth middleware refactor is done and green. The admin router still uses the old wrapper, so admin requests bypass the new nonce check.", "next_step": "Replace the old wrapper in routers/admin.py with require_session, then re-run tests/admin.", "last_verified": "pytest tests/auth tests/api -q: 214 passed, 0 failed", "branch": "feat/auth", "head_sha": "9f2c1ab", "meta_json": {"open_questions": ["Should legacy tokens keep working past the cutover?"]} }
The failure mode to avoid is a checkpoint that only makes sense to the session that wrote it: "continued the refactor, tests mostly fine, next step as discussed". Assume the reader has nothing but this row.
kind=compact_checkpoint,limit=1). If there is none, fall back to the full thread via /m0-recall.
earlier moment:
bash git rev-parse --abbrev-ref HEAD; git rev-parse --short HEAD; git status --short
Same branch and sha means the description probably still holds. Different, or a dirty tree, means the world moved — read the newer entries too, and re-run whatever last_verified claims if you are about to build on it.
was last verified, what the recorded next step is. Then say what you will do.
fits the tree, say so and propose the alternative rather than following it mechanically.
/m0-remember, so the thread does notgo quiet again until the following handoff.
The thread is one local store, keyed by project, with source_tool on every row. So "finish this in the other editor" is just: hand off here, resume there.
M0_PROJECT in each tool'senvironment is the reliable way; a mismatch produces two threads that each look empty.
source_tool honestly in both, so a reader can tell which tool made aclaim.
A session-end hook makes a handoff unconditional rather than remembered — see /m0 hooks for the recipe. It writes a session_end entry with the branch and sha even if the agent forgot to write a checkpoint, and because a shutdown hook runs at a bad moment, this is precisely the case the deferred-write path was built for: a locked store spools the entry instead of dropping it.
A hook cannot know what the work state was, only that the session ended. It is a floor, not a substitute for an explicit compact_checkpoint.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | fail→pass | 13,660 | 4,364 | -68% | 1 | 1 | 0% | 1,921 | 2,502 | +30% | 0 | 0 | — |
case-16 | fail→pass | 16,588 | 13,971 | -16% | 1 | 1 | 0% | 2,061 | 3,422 | +66% | 0 | 0 | — |
case-10 | pass→pass | 12,704 | 6,311 | -50% | 1 | 1 | 0% | 1,340 | 2,468 | +84% | 0 | 0 | — |
case-01 | fail→fail | 12,315 | 16,545 | +34% | 1 | 1 | 0% | 1,196 | 2,050 | +71% | 0 | 0 | — |
case-02 | fail→fail | 10,062 | 19,454 | +93% | 1 | 1 | 0% | 360 | 2,046 | +468% | 0 | 0 | — |
case-03 | fail→fail | 22,086 | 12,451 | -44% | 1 | 1 | 0% | 1,399 | 1,981 | +42% | 0 | 0 | — |
case-04 | fail→fail | 14,666 | 13,007 | -11% | 1 | 1 | 0% | 2,172 | 2,105 | -3% | 0 | 0 | — |
case-05 | fail→pass | 13,157 | 9,610 | -27% | 1 | 1 | 0% | 1,321 | 2,379 | +80% | 0 | 0 | — |
case-06 | pass→pass | 21,235 | 6,411 | -70% | 1 | 1 | 0% | 2,078 | 2,811 | +35% | 0 | 0 | — |
case-07 | fail→pass | 9,850 | 11,572 | +17% | 1 | 1 | 0% | 1,468 | 2,588 | +76% | 0 | 0 | — |
case-08 | fail→fail | 35,846 | 14,661 | -59% | 1 | 1 | 0% | 1,776 | 3,099 | +74% | 0 | 0 | — |
case-09 | fail→fail | 13,854 | 11,923 | -14% | 1 | 1 | 0% | 1,527 | 2,861 | +87% | 0 | 0 | — |
case-11 | fail→pass | 14,340 | 10,753 | -25% | 1 | 1 | 0% | 1,522 | 2,471 | +62% | 0 | 0 | — |
case-12 | fail→pass | 10,586 | 6,846 | -35% | 1 | 1 | 0% | 1,844 | 3,001 | +63% | 0 | 0 | — |
case-13 | fail→pass | 11,350 | 8,936 | -21% | 1 | 1 | 0% | 1,763 | 3,376 | +91% | 0 | 0 | — |
case-14 | fail→pass | 15,314 | 2,679 | -83% | 1 | 1 | 0% | 1,742 | 2,149 | +23% | 0 | 0 | — |
case-17 | fail→pass | 6,760 | 3,411 | -50% | 1 | 1 | 0% | 1,248 | 2,327 | +86% | 0 | 0 | — |
case-18 | pass→pass | 15,601 | 4,744 | -70% | 1 | 1 | 0% | 1,755 | 2,517 | +43% | 0 | 0 | — |
case-19 | fail→pass | 9,919 | 4,496 | -55% | 1 | 1 | 0% | 1,838 | 2,437 | +33% | 0 | 0 | — |
case-20 | fail→pass | 19,006 | 8,489 | -55% | 1 | 1 | 0% | 2,168 | 3,030 | +40% | 0 | 0 | — |
case-21 | fail→fail | 12,888 | 2,369 | -82% | 1 | 1 | 0% | 1,209 | 2,163 | +79% | 0 | 0 | — |
case-22 | fail→pass | 11,532 | 10,164 | -12% | 1 | 1 | 0% | 1,798 | 3,417 | +90% | 0 | 0 | — |
case-23 | pass→pass | 6,767 | 10,366 | +53% | 1 | 1 | 0% | 1,210 | 2,707 | +124% | 0 | 0 | — |
case-24 | pass→pass | 13,679 | 10,124 | -26% | 1 | 1 | 0% | 1,352 | 2,500 | +85% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 20 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.