Multi-model Agent context handoff packet CLI
Turn OpenAI-compatible messages[] into a paste-ready resume pack for the next model — with secret redaction and before/after token stats.
Local-first · IDE-agnostic · zero npm deps · Node ≥ 18.
git clone https://github.com/ktz03/handoff-pack.git
cd handoff-pack
node bin/handoff-pack.js preview examples/long.session.json --max-tokens 200
node bin/handoff-pack.js pack examples/long.session.json --max-tokens 200 --out examples/RESUME.long.mdOn the bundled long session (--max-tokens 200): 508 → 181 tokens (~64% cut), demo secrets redacted, system/tool/error + recent turns kept.
npm test # or: npm run demo:long| Command | What it does |
|---|---|
preview <file> |
Token before/after, compression %, secrets found |
pack <file> |
Write RESUME.md (or --json packet) |
--max-tokens N |
Budget (default 1600) |
--out path |
Output path |
--json |
Structured packet instead of markdown |
messages.json → redact secrets → priority compress → RESUME.md / JSON packet
Keep order: all system → high-signal tool/error turns → most recent user/assistant until budget fills.
task_state— goal / last assistant / blockers / open questionsnext_actions— continue checklistplans— A / B / C fallback pathscompressed_messages— budget-fitted history
Coding / Agent sessions are context silos. Switching models needs a handoff layer, not another IDE plugin.
MIT