// Blog / team workflow
Agent handoff between coding sessions without losing repo context
A useful handoff is not a chat recap. It is a repo-local pointer to what changed, what is trusted, and what must be rechecked.
// direct answer
Short answer
Handoff works when the repository stores a starting point for the next session: Routing Bundle, handoff summary, confidence report, unresolved follow-up work, changed files, and current source. Treat the session summary as a reference until current code confirms it.
Move work from one coding-agent session to another without losing repo context or trust warnings.
// the problem
Chat summaries lose important context between sessions
A session ends with useful context in the agent's answer, but none of it is durable or easy to verify.
The next session starts cold, misses a warning, or repeats the same investigation.
The team thinks it handed off work, but it only handed off prose.
// repository handoff
Leave the next session a file-backed starting point
A handoff should point to files, trust state, changed areas, and repair items.
The handoff summary is useful only when it routes the next agent to source, tests, and evidence.
After meaningful work, rebuild routing and search so the next session sees the current map.
// concrete example
A safe session restart
The first agent updates docs and finds stale module context, but does not finish repair.
Fallback if handoff_summary.json does not exist yet: use routing_bundle.json + pr_summary.md + repair_queue.json, then re-read current source before continuing.
Mini handoff template: Changed: __. Verified: __. Needs re-check: __. Next source files: __. Tests: __.
Before ending, it refreshes the Routing Bundle and leaves a handoff summary that points to the outdated module and unresolved follow-up item.
The next agent reads those files and rechecks source before continuing instead of trusting the prior conversation.
// files you can inspect
Files for the next coding-agent session
Some repository-specific files appear only after setup or a health check. Run the documented setup workflow to create routing, confidence, freshness, search, metrics, and PR summary outputs.
.knowledge/maintenance/handoff_summary.json
The next agent needs a compact continuation point with routes, risks, and pending work.
- Session continuation
- Finding recent context
- Skipping source recheck
- Treating chat recap as truth
.knowledge/maintenance/events/
Events preserve maintenance actions across sessions.
Events live under .knowledge/maintenance/events/YYYY-MM-DD.ndjson.
- Understanding recent maintenance
- Auditing changes to knowledge state
- Replacing git history
.knowledge/maintenance/repair_queue.json
Unfinished uncertainty should be visible to the next agent.
- Picking up incomplete work
- Prioritizing rechecks
- Blocking unrelated edits
.knowledge/maintenance/routing_bundle.json
The next session should start from the current route, not a stale conversation.
- First read
- Finding module boundaries
- Behavior proof
// commands to try
Commands and expected checks
node .knowledge/tools/flow.js release --no-color - what it does
- The handoff refresh rebuilds routing, trust, freshness, search, PR summary, and Inspector outputs.
- where to look
- .knowledge/maintenance/pr_summary.md and .knowledge/maintenance/routing_bundle.json
node .knowledge/tools/build-routing-bundle.js - what it does
- The compact routing file is current for the next session.
- where to look
- .knowledge/maintenance/routing_bundle.json
node .knowledge/tools/build-search-index.js - what it does
- Local search reflects current repository context.
- where to look
- .knowledge/search/index.json
node .knowledge/tools/doctor.js - what it does
- The next agent sees whether it should use caution.
- where to look
- .knowledge/maintenance/quality_report.json
From one session to the next
// practical reference
Handoff files
| File | Carries | Next agent should |
|---|---|---|
| Handoff summary | Recent context and warnings. | Use it to choose what to inspect. |
| Routing bundle | Current first-read map. | Open target source and tests. |
| Items to re-check | Unresolved or outdated context. | Verify, assign, or document. |
| Events | Maintenance actions. | Audit what changed since last session. |
// quick FAQ
FAQ
Is a chat summary still useful?
Yes, but it should point to repo-local context and current source files. It should not become the source of truth.
What should be refreshed before handoff?
At minimum, routing, search, and doctor status after meaningful knowledge or source changes.
// next step
Use this page before ending a coding-agent session
Refresh the repo-local route, make unresolved repair work visible, and make the next agent re-read source for risky behavior.