agent-handoff
Skill29 starsChanged 4 months agoMITView on GitHub
Cross-platform skill for Codex, Claude Code, and DeepSeek Harness (DSH) that creates, updates, compacts, rotates, repairs, and reviews durable repository handoffs. Use when bootstrapping cross-session memory; creating or maintaining AGENT_HANDOFF.md and .agent-handoff files; adding AGENTS.md or .claude/CLAUDE.md rules; enforcing continuation recovery or closeout; managing oversized snapshots and logs; installing optional Claude advisory hooks; or reviewing handoff quality.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- L3DigitalNet/Claude-Code-Pluginstheir own version, first seen Aug 31, 2026
- hams-ollo/zen-agent-skillstheir own version, first seen Aug 31, 2026
- sht5/skillstheir own version, first seen Aug 14, 2026
- NITISH-R-G/agent-memory-protocoltheir own version, first seen Aug 1, 2026
- sonu07-star/agent-handoff-skilltheir own version, first seen Jul 15, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- suyashb734/cliagents★ 19same name
- L3DigitalNet/Claude-Code-Plugins★ 8same name
- hams-ollo/zen-agent-skills★ 2same name
- Lutren/agent-handoff-protocol★ 2same name
- Wh0FF24/whoff-agents★ 2same name
- aprameyak/coding-skills★ 1same name
- NITISH-R-G/agent-memory-protocol★ 1same name
- ccpowerpack/claude-code-skills★ 0same name
- sht5/skills★ 0same name
- sonu07-star/agent-handoff-skill★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this cross-platform skill in Codex, Claude Code, or DeepSeek Harness (DSH) to establish repository-local continuity memory so a future …
- Very specific: line 35
Do not force-migrate an existing AGENT_HANDOFF.md.
- Very specific: line 41
If bootstrapping a new mechanism, prefer running scripts/bootstrap_handoff.py from this skill to create safe scaffolding and idempotent …
- Very specific: line 42
If repairing or reviewing an existing mechanism, read references/quality.md, inspect the current files, then edit the repository files …
- Very specific: line 43
Always keep the handoff content evidence-based.
- Very specific: line 60
Use these markers for Codex/DSH AGENTS.md and Claude Code .claude/CLAUDE.md project-level handoff rules:
- Distinctive: line 68
If both markers already exist, replace only the content between them.
- Very specific: line 70
Do not overwrite an existing AGENT_HANDOFF.md with a template.
- Distinctive: line 74
Use the script for deterministic setup:
- Very specific: line 93
After running the script, inspect the generated files and replace placeholder or UNKNOWN content with repository-based facts where possible.
- Distinctive: line 97
Use the deterministic maintenance script for multi-document capacity control:
- Distinctive: line 108
Never rewrite an unparseable snapshot.
- Distinctive: line 153
When this skill changes repository files, report:
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Handoff
Overview
Use this cross-platform skill in Codex, Claude Code, or DeepSeek Harness (DSH) to establish repository-local continuity memory so a future agent can recover objective, status, decisions, validation, risks, and next actions without relying on previous chat history.
The handoff mechanism is repository-local by default. Do not edit user-level Codex, Claude Code, or DSH instructions, profiles, or settings unless the user explicitly asks for it.
Platform Installation
- Codex personal skill: install this folder at
~/.codex/skills/agent-handoff. - Claude Code personal skill: install this folder at
~/.claude/skills/agent-handoff. - Claude Code project skill: install this folder at
<repo>/.claude/skills/agent-handoff. - DSH personal skill: install this folder at
~/.dsh/skills/agent-handoff. - DSH shared-agent skill: install this folder at
~/.agents/skills/agent-handoff. - DSH project skill: install this folder at
<repo>/.dsh/skills/agent-handoffor<repo>/.agents/skills/agent-handoff.
DSH does not discover ~/.codex/skills, ~/.claude/skills, or <repo>/.claude/skills; install or link the bundle into one of its roots above. The same SKILL.md, references/, and scripts/ are shared across platforms. agents/openai.yaml is Codex UI metadata and is ignored by Claude Code and DSH.
Runtime Prerequisites
- Reading and applying the Markdown instructions requires no extra runtime beyond the host agent.
- Running
scripts/bootstrap_handoff.pyorscripts/maintain_handoff.pyrequires Python 3.10 or newer. - DSH itself requires Node.js but does not guarantee Python. When Python is unavailable, create or repair files manually from
references/templates.mdand perform capacity review fromreferences/quality.md.
Layout Choice
multilayout is the default for real projects. It createsAGENT_HANDOFF.mdas a short index and.agent-handoff/*.mdfor state files.singlelayout is the legacy compact mode for small projects. It keeps all recovery state inAGENT_HANDOFF.md.- Do not force-migrate an existing
AGENT_HANDOFF.md. If it exists, preserve it and repair or migrate manually from repository facts.
Workflow
- Inspect the repository before writing files.
- Identify existing agent guidance files:
AGENTS.md,CLAUDE.md,.claude/CLAUDE.md,.claude/rules/,.claude/settings.json, README files, docs, source roots, test configuration, and obvious subprojects. - If bootstrapping a new mechanism, prefer running
scripts/bootstrap_handoff.pyfrom this skill to create safe scaffolding and idempotent project handoff rule blocks. - If repairing or reviewing an existing mechanism, read
references/quality.md, inspect the current files, then edit the repository files directly with factual updates. - Always keep the handoff content evidence-based. Use
UNKNOWNfor facts that cannot be verified from the repository or user request. - For multi layout, run
scripts/maintain_handoff.py --repo <repo-root> --compact-if-neededafter meaningful handoff updates and before closeout. - Re-read files you created or changed before reporting completion.
Default Files
AGENT_HANDOFF.md: Required durable handoff state at the repository root..agent-handoff/: Multi-document layout directory for snapshot, workspace, decisions, work log, validation, backlog, risks, and archive.AGENTS.md: Recommended shared Codex and DSH project instructions file. Merge a marked handoff protocol block; do not overwrite unrelated project guidance..claude/CLAUDE.md: Recommended project-level Claude Code rules generated for repositories that use Claude Code. Merge a marked handoff protocol block; do not overwrite unrelated rules.AGENT_SESSION_PROMPTS.md: Optional reusable prompts for new window startup, continuation, closeout, and quality review..gitignore: Optionally add local handoff files when the project does not want to commit them..claude/settings.json: Claude Code only. Optionally merge safe read-only permission allow rules or advisory handoff hooks if the user explicitly asks..claude/hooks/handoff-watch.mjs: Claude Code only. Optional event-aware advisory hook script installed only when the user asks for hook reminders.
Idempotency Rules
Use these markers for Codex/DSH AGENTS.md and Claude Code .claude/CLAUDE.md project-level handoff rules:
<!-- AGENT_HANDOFF_PROTOCOL:START -->
...
<!-- AGENT_HANDOFF_PROTOCOL:END -->If both markers already exist, replace only the content between them. If the target file exists without markers, append the marked block after the existing content. Never duplicate the protocol block.
Do not overwrite an existing AGENT_HANDOFF.md with a template. Existing handoff state must be repaired by reading repository facts and editing stale or missing sections.
Bootstrap Script
Use the script for deterministic setup:
python <skill-dir>/scripts/bootstrap_handoff.py --repo <repo-root> --platform both --layout multi --session-prompts --gitignoreUseful flags:
--repo <path>: Target repository root. Defaults to the current working directory.--platform codex|claude|dsh|both: Project rule target.codexanddshupdate the sharedAGENTS.md;claudeupdates.claude/CLAUDE.md;bothupdates both files and therefore covers all three hosts.--layout single|multi: Handoff structure.multiis default;singlepreserves the legacy single-file layout.--session-prompts: CreateAGENT_SESSION_PROMPTS.mdif missing.--gitignore: Add local handoff files to.gitignoreif missing.--allow-readonly: Claude Code only. Merge safe read-only query permissions into.claude/settings.json.--install-hooks: Claude Code only. Install event-aware advisory handoff hook script and merge missing hook entries into.claude/settings.json. Hooks always exit0, never block, never write handoff files, and only emit softhookSpecificOutput.additionalContextorsystemMessagereminders when needed.--skip-codex-rules: Do not create or update the shared Codex / DSHAGENTS.mdrules. The legacy flag name is retained for compatibility.--skip-claude-rules: Do not create or update.claude/CLAUDE.md.--dry-run: Show planned changes without writing files.
After running the script, inspect the generated files and replace placeholder or UNKNOWN content with repository-based facts where possible.
Maintenance Script
Use the deterministic maintenance script for multi-document capacity control:
python <skill-dir>/scripts/maintain_handoff.py --repo <repo-root> --check
python <skill-dir>/scripts/maintain_handoff.py --repo <repo-root> --compact-if-needed
python <skill-dir>/scripts/maintain_handoff.py --repo <repo-root> --rotate--checkis read-only and reports soft warnings or unresolved hard-limit findings.--compact-if-neededarchives and normalizes an oversized parseable snapshot, then rotates oversized work-log, validation, and completed backlog records.--rotateskips snapshot compaction and rotates only eligible history records.- Never rewrite an unparseable snapshot. Never delete risks mechanically. Preserve complete work-log sections and validation rows.
- The Claude hook does not run this script. It only reports capacity warnings and always remains read-only and non-blocking.
Capacity policy:
- Snapshot soft limit:
16 KiBor240lines. - Snapshot hard limit:
32 KiBor400lines. - Work log:
64 KiBor30dated sections. - Validation history:
64 KiBor200table rows. - Backlog and risks:
32 KiBeach. - Generated archive chunks: at most
128 KiBeach. - Legacy single layout:
32 KiBsoft limit and64 KiBhard limit; migrate to multi layout rather than adding complex in-file rotation.
Multi-Document Recovery Contract
In multi layout, a new agent must recover in this order:
AGENT_HANDOFF.md.agent-handoff/snapshot.md.agent-handoff/risks.md.agent-handoff/backlog.md.agent-handoff/validation.mdwhen validation state matters.agent-handoff/decisions.mdwhen changing durable behavior or architecture.agent-handoff/workspace.mdwhen orientation or commands are needed.agent-handoff/work-log.mdwhen recent implementation details are needed.agent-handoff/archive.mdonly for old context
snapshot.md is replace-in-place current state, not append-only history. Keep it short and action-oriented; use the dedicated files for decisions, validation, backlog, risks, and history. Archive the original before deterministic normalization, and leave the file unchanged when safe parsing is impossible.
References
Load only the references needed for the task:
references/templates.md: Read when creating or manually repairingAGENT_HANDOFF.mdorAGENT_SESSION_PROMPTS.md.references/codex-rules.md: Read when creating or updating the shared Codex / DSHAGENTS.mdblock.references/claude-rules.md: Read when creating or updating Claude Code.claude/CLAUDE.md.references/dsh-rules.md: Read when installing for DSH or checking DSH discovery and runtime boundaries.references/hooks.md: Read only when the user asks for hook-based enforcement.references/quality.md: Read when reviewing, compressing, repairing, or validating a handoff mechanism.templates/claude-settings-hooks.json: Claude Code hook settings snippet for manual review or installation.templates/handoff-watch.mjs: Claude Code event-aware advisory hook script template.scripts/maintain_handoff.py: Cross-platform read-only checks plus explicit snapshot compaction and history rotation.
Closeout
When this skill changes repository files, report:
- Files created or updated.
- Current handoff status.
- How the next agent should start.
- Any remaining
UNKNOWNentries, risks, or user confirmations needed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

