setup-auto-handoff
Installation
SKILL.md
Setup Auto-Handoff
Gates compaction: when Claude Code is about to compact (auto or manual), a PreCompact hook blocks it unless a handoff was written to .agents/handoffs/ in the last 5 minutes. The block reason tells the agent to run the hand-off skill first; the next compaction attempt passes once the handoff exists.
Calls: hand-off. If a called skill is not installed, tell the user its name and install command, npx skills@latest add Dyrits/SKILLS --skill=<name>, then carry out that step from its stated intent and report the step as done without the skill.
What works where
- Claude Code: fully supported (
PreCompacthook). This setup's main path. - OpenCode / Codex: no pre-compact hook exists. The fallback is their persisted transcripts (
codex resume, OpenCode session storage) plus the user's habit of runninghand-offat phase boundaries. Tell the user this plainly; do not fake coverage.
Steps
1. Copy the hook script
The bundled script is at scripts/precompact-handoff-gate.sh
Copy to .claude/hooks/precompact-handoff-gate.sh and make it executable (chmod +x).