Add handoffs: resumable working state for named agents #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "handoffs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds handoffs: resumable working-state snapshots for a named agent, so a session that crashes, is cleared with
/clear, or is restarted can carry on.created_at/updated_at. One agent can own several; the most recently updated is the one to resume.save_handoff(create, or update byid),get_handoff(byid, or byagent_namewith that agent's other handoffs listed),list_handoffs,delete_handoff.peachmem handoff-contextis a SessionStart hook. It looks up the latest handoff for the session's name and adds a pointer to the session context. It only reads.hooks/handoff-start.sh(registered forstartup|resume|clear|compact) andskills/handoff/SKILL.md, which covers when to save and how to keep a handoff lean.Decisions
search_notesandlist_notes.session_title(set byclaude --name), falling back to the transcript's lastagent-nameentry for resumes. A fresh session's transcript doesn't exist yet at SessionStart, so the fallback only helps resumes.DONE:, anddelete_handoffremoves abandoned ones.Schema
Migration
0005_handoffs.sqladds thehandoffstable. It's additive, so existing data is untouched. Running this binary against the real database migrates it to schema v5. A binary older than 0.5.0 then refuses writes until restarted, which is the existing schema-guard behaviour.Tests
cargo test --features db-testsagainst the dev database:cargo clippy --all-targets --features db-testsis clean.tests/schema_guard.rschanged in one place: the in-flight migration test hard-coded version 5, which is now a real migration. It now usesknown_version() + 1.Not verified
claude --name <name>after a handoff has been saved under that name./clearpreserves the session name. If it doesn't, a cleared session has no name for the hook to use.Related
The deskwork incident team's
spawn-team.shnow passes--name "$name"toclaude, so a restarteddw-*agent has its name at startup. That change lives in the deskwork repo.🤖 Generated with Claude Code