/anti-hall:handoverfrom Anti-Hall
Write a lossless session handover. Use for "handover", "save session state", before /compact or /clear, or at session end.
Ships in Anti-Hall. 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.
Use when the user says "prepare a handover", "handover", "write a handoff", "save session state", "hand this off", before /compact or /clear, at session end, or before ending work on a long task — writes a comprehensive, organized, minimal-but-lossless session handover so a fresh session can resume without re-deriving or guessing anything.
Triggered automatically, too. auto-handover (UserPromptSubmit) watches the
main agent's estimated context usage and, at 93% by default (autoHandover section of
~/.anti-hall/settings.json, or ANTIHALL_AUTO_HANDOVER_PCT; /anti-hall:settings skill
to change it), injects a directive to run THIS skill's contract yourself, right now,
without asking the user first — same self-write mandate as below. A long autonomous turn
that never passes a user prompt gets the same directive once at a Stop
(auto-handover-pause-nag, shared latch, never while stop_hook_active). If you're reading this
skill because that directive fired, follow it exactly as written; nothing else changes.
Recommended threshold. Set the handover to fire 5% of the window before that model's auto-compact: autoHandover.pct = 93 for 200k models (Claude auto-compact at 98%), and for 1M models autoHandover.maxTokens = 500000 with CLAUDE_CODE_AUTO_COMPACT_WINDOW=550000. These are the shipped defaults (93% and 500000 tokens); see the settings skill, "Recommended setup".
Prepares a session handover: perishable job state (goal, current position, next
executable step, decisions, dead ends, verification status) written to disk so a
fresh session — with no memory of this one — can resume correctly and completely.
Built from anti-hall's https://github.com/talas9/anti-hall/blob/main/docs/KB-session-handover.md (repo-clone-only; not
bundled with /plugin install, like all docs/ — when citing it in handover
files, name it as the anti-hall repo's doc: the target project won't have that
path).
Handover ≠ memory. Durable rules, conventions, and architecture facts belong in
CLAUDE.md/AGENTS.md and project memory — they persist because they're always
true. A handover is job state for THIS session — it's true today and stale next
week. Never write durable knowledge into a handover file (it'll rot there,
unread); never write perishable job state into CLAUDE.md (it'll bloat the
always-loaded context). If you learn something durable while writing a handover,
route it to CLAUDE.md/project memory separately — don't smuggle it into
decisions.md.
The handover is written by the agent holding the session context —
never delegate the writing to a subagent: a subagent never lived this
session, so its reconstruction loses decision/trial fidelity (a field
failure: a session delegated handover-writing to a subagent even after
loading this skill). This is the documented exception to the
delegation-first/orchestrate-only doctrine — edit-guard.js lets the
coordinator Write/Edit handover files directly under
.anti-hall/handovers/** (and redirects NEW handover-named .md writes
elsewhere back to that path), so self-write never needs a subagent detour.
Use the Write/Edit tool for every file below, never a Bash heredoc
(cat > f <<EOF) — a heredoc body is scanned as shell by git-guard.js, and
prose that merely mentions a git command near backticks can trip a block
Write/Edit never hit in the first place.
Handovers are never committed; the only format is the layout below — no flat
files, no CONTINUE-HERE.md, no copy under docs/. git-guard blocks a commit that
includes one and doctor warns about strays.
.anti-hall/handovers/
INDEX.md # global index — one row per handover, appended, never rewritten
<YYYY-MM-DD>/<session-id>/
HANDOVER.md # seq 1, the main file (<=200 lines, front-loaded)
HANDOVER-2.md, HANDOVER-3.md, ... # later handovers in the SAME session; each names its predecessor
state.md # repo/git/env state
decisions.md # every decision, in sequence, with rejected alternatives
trials.md # everything attempted, chronological, incl. abandoned approaches
knowledge.md # KB/docs/research consulted, learned facts, gotchas, source-of-truth pointers
This mirrors .anti-hall/progress/ and .anti-hall/history/ — same navigation
model: read INDEX.md first, open only what it says is relevant.
session_id
field) if you know it.auth-refactor-session) — stable
meaning: reuse the SAME slug across handovers written in the same session, don't
regenerate it each call.YYYY-MM-DD.Count existing HANDOVER*.md files in <date>/<session-id>/. Seq = count + 1.
HANDOVER.md.HANDOVER-N.md, and its "Predecessor" slot names the immediately
prior file (HANDOVER.md for seq 2, HANDOVER-2.md for seq 3, etc).
If re-invoked for a seq that already exists in this same session (rare — e.g. the
agent explicitly asks to refresh the just-written handover), UPDATE that file in
place rather than incrementing again.Carry-forward rule (seq N>1). A later handover is often written from an
already-compacted context, and every re-summary loses more (anti-hall repo
https://github.com/talas9/anti-hall/blob/main/docs/KB-handover-research.md, P3/P4: never compact a compaction). So:
(carried from <predecessor file>) — never re-summarize or re-word them.superseded: <row> — <evidence>).≤200 lines. Front-loaded: the first ~15 lines are Situation (2-3 lines) plus a single concrete NEXT ACTION — one thing the next session can execute immediately, no interpretation required. Skill/context re-injection truncates by keeping the file's START (https://github.com/talas9/anti-hall/blob/main/docs/KB-session-handover.md, principle O4) — everything load-bearing goes early; sources and full chronology go last, where losing them costs least.
Fixed section order, every time (SBAR-derived, https://github.com/talas9/anti-hall/blob/main/docs/KB-session-handover.md's consolidated schema):
auto-threshold / user-request / restart-pending /
task-boundary, plus the current context % if known. Source the % from the
statusline (if shown), or from ~/.anti-hall/auto-handover/<tag>.json
(auto-handover-state's per-session latch — firedPct is the
% it crossed the threshold at; <tag> is the session id, sanitized, or
sha1(transcript_path).slice(0,16), same scheme as "Session id" below).
Use auto-threshold ONLY when that file's fired is true for this
session, or the auto-handover directive text said so — not just because
context "feels high". user-request = the user asked for a handover, or to
/compact/clear. restart-pending = a restart/new-session was mentioned but
the threshold hasn't fired. task-boundary = proactive, natural stopping
point, nothing above forced it. This line drives the Terminal declaration
below — get it right.https://github.com/talas9/anti-hall/blob/main/docs/KB-handover-research.md, P2).
Write none issued rather than omitting the section. Keep every rule that
is still active in every later seq.file:line, the command run, and its
actual output/result. Never "tests pass" without the command and a real output
summary.decisions.md for the
reasoning.trials.md.file · what's inside · "read this when ..." — so the next session loads selectively instead of
reading everything.HANDOVER*.md in this session, or none.git status, pwd, re-read CLAUDE.md, and a smoke/test
command specific to this repo. Directly counters two documented post-compact
failures: behavioral rules silently dropped (F1 — hence the CLAUDE.md
re-read) and stale repo/directory state (F2) — https://github.com/talas9/anti-hall/blob/main/docs/KB-session-handover.md.
After running it, append a resume-verified: <ISO timestamp> -- <one-line git-status/pwd/smoke summary> line to this file — this is what
proves the checklist actually ran, not just that it was written down.
tasklist-guard.js backs this up mechanically (v0.75.0): when
handover-resume.js injected a resume pointer this session and this
session then makes file-changing actions with no resume-verified: line
ever landing in the referenced file, one capped Stop-hook nudge fires.
Then the receiver read-back: before any new work, tell the user in your
own words (not a paste) the goal, the single next action and every active
session rule, and invite corrections — the incoming side restating the
handover is the step structured clinical handoffs credit with fewer errors
(I-PASS "synthesis by receiver", anti-hall repo
https://github.com/talas9/anti-hall/blob/main/docs/KB-handover-research.md, P8/P9).Everywhere: concrete over vague ("2-space indentation", not "format properly"). Pointers over payloads — reference files/commits/artifacts by path, never inline large content. Dedup ruthlessly; no narrative padding; no transcript replay (the single worst format per the KB's own tool survey).
# Handover — <session-id> · seq <N> · <YYYY-MM-DD>
## Situation
<2-3 lines>
Trigger: <auto-threshold|user-request|restart-pending|task-boundary> · context: <pct%|unknown>
## Next action
<one imperative, executable step>
## Goal + definition of done
<1-2 lines>
## Session rules (verbatim)
- "<exact user wording>" — <turn/date given>; still active: yes
## Done + Verified
- <claim> — evidence: `path:line`, command `<cmd>` → `<real output summary>`
## NOT verified / gaps
- <explicit list, or "none — everything claimed above was verified this session">
## Open items
1. <prioritized>
## Decisions summary
- <one line> → decisions.md
## Do-not-repeat summary
- <one line> → trials.md
## Detail files
| file | contents | read this when |
|---|---|---|
| state.md | ... | ... |
| decisions.md | ... | ... |
| trials.md | ... | ... |
| knowledge.md | ... | ... |
## Predecessor
<path to prior HANDOVER*.md, or "none">
## Resume-verification checklist
- [ ] `git status` — expect: <what>
- [ ] `pwd` — expect: <path>
- [ ] re-read `CLAUDE.md` — rules may have been dropped by compaction
- [ ] `<smoke/test command>` — expect: <result>
- [ ] read-back to the user: goal, next action, active session rules — in your own words, before any new work
resume-verified: <ISO timestamp> -- <one-line git-status/pwd/smoke summary>
state.md — repo/git/env state:
# State — <session-id> seq <N>
Branch: <name> | Clean/dirty: <status> | Last commit: <sha short + subject>
Unpushed: <yes/no, what>
Uncommitted files: <list>
Running processes: <list, or "none">
## Task list snapshot
| id | subject | status | priority | blocked-by |
|---|---|---|---|---|
| ... | ... | pending/in_progress/completed | P0/P1/P2/... | ... |
## Commands run this session (with actual results)
- `<command>` → `<real output, trimmed>`
decisions.md — append-only, every decision in sequence:
## <YYYY-MM-DD HH:MM or seq marker> — <decision title>
What: <the decision>
Why: <reasoning>
Rejected alternatives: <alternative> — <why rejected>
trials.md — append-only, chronological, includes abandoned attempts:
## <what was attempted>
Outcome: <succeeded/failed/abandoned>
Why abandoned (if applicable): <reason>
Do not repeat: <what NOT to try again, and why>
knowledge.md — KB/docs/research consulted:
## <doc/URL path>
What was taken from it: <summary>
Learned facts / gotchas: <list>
Source-of-truth pointer: <yes/no — is this the authoritative source for X>
One row per handover, appended (never rewritten), newest last — same convention
as .anti-hall/progress/INDEX.md:
- YYYY-MM-DD · <session-id> · seq N · <one-line outcome> · [subsystems] · [main](<date>/<session-id>/HANDOVER.md)
HANDOVER*.md count in this session's dir) + 1.HANDOVER.md (or HANDOVER-N.md), state.md,
decisions.md, trials.md, knowledge.md (seq N>1: apply the carry-forward
rule above first). Detail files are append-only
across a session's multiple handovers (seq 2 appends to seq 1's state.md
etc., doesn't overwrite); HANDOVER*.md itself is a fresh file per seq.INDEX.md row (create INDEX.md if it doesn't exist yet).HANDOVER*.md, state.md, decisions.md, trials.md,
knowledge.md), and the exact INDEX.md row appended — plus a one-line
summary of what was captured. Don't summarize the paths away; list them.A companion SessionStart hook, handover-resume.js, closes the loop so a
written handover is actually picked up next time: on clear, compact, or a
fresh startup/resume, it scans .anti-hall/handovers/ for the newest
HANDOVER*.md (preferring one from the SAME session over a merely newer one
from a different session) and, if it's 7 days old or newer, injects a pointer
to its path plus the numbered Guided Resume Path from "Next-session usage"
above — never the file's content. That injection explicitly states the
handover SUPERSEDES the auto-compact summary and any legacy
CONTINUE-HERE-style file for continuation state. This means writing a
handover is not just documentation — it is what the next context actually
resumes from.
PreCompact safety net. precompact-snapshot (PreCompact, manual +
auto) writes PRECOMPACT-<n>.md into this session's handover dir right before
every compaction: pwd, git branch/HEAD/dirty files, the task-list snapshot
parsed from the transcript, the last 10 user messages verbatim, and a pointer to
the newest HANDOVER*.md. It is mechanical (a hook cannot make the model
write), never a substitute for this skill, and never blocks compaction. The
resume hook names it — as NEWER than the handover when work happened after the
handover, or as the only pointer when no handover exists for the session.
Planned, not shipped yet: the PreCompact snapshot will also write a "since the last handover" delta (all user messages since the handover, commits and files, task changes, agent final reports), built mechanically with no model call. Today it writes only what is described here.
Compact Instructions (optional, recommended). Claude Code lets a
"Compact Instructions" section in CLAUDE.md steer every compaction summary,
automatic ones included (https://code.claude.com/docs/en/how-claude-code-works).
Paste this into the project's CLAUDE.md so even an unplanned auto-compact
points at the handover:
## Compact Instructions
Continuation state lives in the newest .anti-hall/handovers/<date>/<session>/HANDOVER*.md
(and any newer PRECOMPACT-<n>.md beside it). In the summary, name that path, keep every
pending/in-progress task, quote the user's session rules verbatim, and keep the
"NOT verified" items. Do not restate work as verified unless the handover says so.
The auto-handover directive also hands the user the exact
/compact focus: continuation state is in <handover path>; ... line to paste.
Write proactively — at task boundaries or when compaction risk is rising, not
only when explicitly asked and not at the context ceiling (/compact itself can
fail once the ceiling is hit — https://github.com/talas9/anti-hall/blob/main/docs/KB-session-handover.md, F4). If you notice a
natural task boundary during a long session, it's reasonable to say so and offer
to write a handover rather than waiting to be asked.
Quiesce gate. Before declaring safe to compact/clear, reach a safe point:
finish/park the current micro-task, enumerate every running background item
(task list, background agents, workflows, monitors), and for each: await it,
stop it, or record it in HANDOVER.md's Open items as STILL RUNNING with its
id and re-attach instructions. While unmet, say WAIT, not done: ⏳ **NOT SAFE to compact yet** — waiting on: <named items>. I'll tell you the moment it's safe.
The quiesce gate is necessary, NOT sufficient. "No background agents
running" never by itself makes it safe to compact. Declare SAFE (the 🟢 line,
"safe to compact", or /compact … offered as advice) ONLY when:
Trigger: auto-threshold), ORautoHandover.pct by the REAL
reading (statusline / the hook's figure), not a guess.Never declare it within guards.compactAdviceRecentTurns (default 10) turns of
a compact — context was just reset. Check the actual context % before saying
it. compact-advice-guard.js (Stop) blocks a violating reply once and names
the real %; retract with one line — RETRACT SAFE TO COMPACT — <why> — and
continue or stop.
Terminal declaration is trigger-aware. Once the quiesce gate is met, the
final message depends on the Trigger: line you recorded above:
auto-threshold, OR the user explicitly asked to /compact or /clear AND
context is genuinely high (at/near the auto-handover threshold):
🟢 **HANDOVER COMPLETE — GOOD POINT TO /compact NOW** (swap in /clear
instead of /compact when the task itself is done) + <saved paths list> +
<numbered instructions: /compact or /clear; the resume hook guides the fresh session automatically>.restart-pending, task-boundary, or a user request
to compact) while context is still below the auto-handover threshold: 📝 **Handover saved** (proactive, context <pct>%): no need to compact now; continue working, or /compact / restart when you choose. + <saved paths list>.The declared line is the LAST act of the turn either way; work after it makes
the handover STALE — refresh it (same seq, or seq+1) and re-declare before
claiming safe/saved again. compact-declaration-guard.js (PreToolUse,
guards.compactDeclarationGuard, default ON since 0.117.0) can mechanically
enforce this: after a SAFE TO COMPACT declaration it blocks
agent spawns, file edits and state-changing shell for the rest of the turn —
regardless of the switch, write
RETRACT SAFE TO COMPACT — <why> first if more work is genuinely needed,
then refresh the handover before declaring again. tasklist-guard.js backs this up mechanically:
file-changing work after the newest HANDOVER*.md's mtime gets a capped
"handover is STALE" advisory on its Stop output (staleness detection is by
mtime + section content, not by matching either declaration string, so it
works the same for both).
.anti-hall/handovers/INDEX.md → find the newest relevant row.HANDOVER.md (or the highest HANDOVER-N.md in that
session's directory, if later seqs exist — check its Predecessor chain if
unsure which is newest).resume-verified: line to it — tasklist-guard.js
nags (once, capped) if file-changing work happens this session without one.
Then give the user your read-back (goal, next action, active session rules,
in your own words) before starting any new work.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub talas9/anti-hall --plugin anti-hall29 skills in this plugin
/activateFirst-time anti-hall setup: model routing and activation sentinel. Use for "activate anti-hall", "set up anti-hall"./deadly-loopReviewer+Auditor+Critic debate and fix waves until no new P0/P1. Use before merging risky changes: security, schema/prod data, shell, CI YAML, LLM prompts, cross-file/PR./deadly-loop-multi2x/3x/4x parallel deadly-loop review with diversified lenses. Use for "double/triple/quadruple deadly loop" or a deeper multi-agent review.Other plugins' skills for the same job