/agent-thread-tools:thread-handofffrom Agent Thread Tools
Distills a long Claude Code session into durable handoff files (decisions, state, reference docs, screenshots) so a fresh session continues the project without the old transcript.
Ships in Agent Thread Tools. 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.
Move durable project memory out of the transcript and into files that every new session loads automatically, so the next session (any model) starts effective without re-explaining the project or replaying history.
The commands below are written as agent-thread-tools <command> <arguments>. Run
each one through the copy that ships with this skill, so its version matches:
python3 "${CLAUDE_PLUGIN_ROOT}/tools/agent-thread-<command>.py" <arguments>
For example, agent-thread-tools health check F becomes
python3 "${CLAUDE_PLUGIN_ROOT}/tools/agent-thread-health.py" check F. If that file
does not exist, use the installed agent-thread-tools command instead.
This session's transcript is ~/.claude/projects/*/${CLAUDE_SESSION_ID}.jsonl.
Resolve it with ls ~/.claude/projects/*/${CLAUDE_SESSION_ID}.jsonl. If that
fails, use the newest *.jsonl in the project's ~/.claude/projects/<dir>/.
Everything goes in the project's .reference/ folder: a local-only git repository,
hidden from the project repository, never pushed. Step 1 creates it when missing.
.reference/handoffs/YYYY-MM-DD-short-topic.md, from
references/handoff-template.md..reference/ is the visual archive root..reference/docs/, one file each,
listed in .reference/INDEX.md with a one-line description.Set up: run agent-thread-tools reference init from the project root. It creates
.reference/ as a local git repository and hides it from the project repository.
Then inspect: git status --short, git log --oneline -8, relevant diffs.
Health: agent-thread-tools health check <session-file>. Exit 2 is WARN and 3
is DANGER; both are results, not failures.
Draft: agent-thread-tools handoff-summary <session-file> as a redacted aid. Verify
every important fact against files, git, tests, or explicit user instructions.
Visuals: if screenshots exist, agent-thread-tools visual-archive scan <session-file>,
then archive the ones that still matter:
agent-thread-tools visual-archive archive --archive-root .reference --project-name <name> --artifact-set <YYYY-MM-DD-topic> --visual-context "<what they show>" <session-file>.
Record Archived: with the manifest path, or Not archived: with the reason.
Reference docs: save large user-provided text or Markdown that later work depends
on into .reference/docs/ and update INDEX.md.
Write the handoff. Put stable, long-lived facts (architecture, conventions,
commands) into the project CLAUDE.md instead, kept short; put per-slice state in
the handoff.
Carry forward what is still open. The new handoff replaces the previous one (the
Latest handoff: line in CLAUDE.local.md), so anything it leaves out is lost to
the next session. Read the previous handoff and copy every item that this session
did not finish or settle: checks or tests the user still owes, decisions awaiting
the user, proposals awaiting a yes, open risks. Mark each with where it came from
(for example "carried from 2026-10-04"), and record any result the user reported for
it in this session.
Then check it: agent-thread-tools handoff-audit <session-file> <handoff path>. It
lists items from this session that a fresh session would need but the handoff does
not state, and open items from the previous handoff that the new one doesn't carry
(or says it was skipped when no OpenRouter key is set). For each listed item, check
whether it still applies, and add it to the handoff if it does.
Wire it in: keep exactly one line in CLAUDE.local.md (create it if missing):
Latest handoff: @<handoff path> and Reference index: @.reference/INDEX.md.
Replace the previous line; never accumulate old handoffs there.
Commit: agent-thread-tools reference commit -m "Handoff: <topic>". Do not commit
to the project repository unless the user asks.
8a. Wiki: write <handoff path minus .md>.wiki.json as {"items": [...]} with at most 5 items, each
{kind, title, summary, body, sources, tags?}: kind is lesson, risk, fact or howto; title at most 120
bytes (UTF-8); summary at most 200 bytes; body at most 8 KB; sources are {type, id} with type task, handoff,
file or commit. Items are new lessons, risks and reference facts (file ids, routes, quirks). Open work
stays in the handoff text, never an item. Put no secrets in a title: the server scrubs them, and the page
then gets another slug. Then run agent-thread-tools wiki-sync <that file>: it writes
<handoff path minus .md>.wiki-result.json, which step 9 sends. Show the hints it prints (possible
duplicates) in the step 12 report. Skip this step when nothing is new, or when there are no BBS credentials.
BBS: agent-thread-tools bbs-handoff send <handoff path> --session-file <session-file>. It saves the
handoff in the Agent BBS handoff store (kind written), so a replacement agent can continue if this
session stops. It does nothing without BBS credentials. It reads the key from the plugin options or a credential command; never put
the key on the command line.
Mark: agent-thread-tools handoff-marker record --source-session-file <session-file> --handoff-file <handoff path>.
Restart: if test -L "/etc/systemd/system/multi-user.target.wants/supervisor@$(id -un).service"
succeeds, a session supervisor restarts this session. Use this file test, not systemctl:
some projects deny systemctl. Send one NetMail to your own BBS handle with the
subject [HANDOFF_COMPLETE] and the handoff path as the body (bbs_send_netmail).
Do not mark that NetMail read. Report as in step 12, but end with "The supervisor
restarts this session now." instead of the /clear paragraph, and start no more
work. If the test exits 1, there is no supervisor: skip this step. If the command is
refused or fails in another way, skip this step and put "Supervisor check refused:
" in the step 12 report, before the /clear paragraph.
A session launcher pool session (id -un is cc-pool-<N>) has no supervisor, and nobody
types /clear there. Step 10 already told the BBS that it stopped with "context full";
the Sysop gets a takeover card after 30 quiet minutes. Send no NetMail. End the step 12
report with "The Sysop gets a takeover card for this session." instead of the /clear
paragraph, and start no more work.
A handoff written before the supervisor was installed sent no NetMail. When the user
asks to restart from it and the test now succeeds, do only this step and step 12 for
the Latest handoff: file; write no new handoff.
Report briefly: the handoff path and a few lines on what it carries. End the reply with this as its own final paragraph, after everything else, so it is the last thing the user reads:
Next: run /clear to continue in a fresh session that loads this handoff
(or open a new session in this project).
The new session loads the handoff through CLAUDE.local.md automatically.
Do not dump the transcript, raw tool output, or base64 media into any file. Do not claim the new session started; the user or the session supervisor starts it. Treat git, tests, CLAUDE.md, handoffs, and archive manifests as the durable memory, not the transcript.
danger, or warn before a substantial next sliceWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub zenzig/agent-thread-tools --plugin agent-thread-tools2 skills in this plugin