Local, provider-neutral handoffs and cache-aware session rotation for coding agents (Claude Code, Codex, Pi)
See the codeWhen you come back to a large, idle coding-agent session whose prompt cache has likely expired, Cachetoast holds your first prompt before the agent re-reads the whole context at full price, and gives you a handoff to continue in a fresh session instead. Works with Claude Code, Codex, and Pi.
Zero dependencies. No LLM calls, API keys, telemetry, or network access. Node.js 22+, macOS/Linux.
Built by R. Hunter Harris at Hunter Software Consulting, fractional product and technology leadership for B2B SaaS.
From the repo you want to protect:
npx github:rhunterharris/cachetoast init
It installs for the agents you have (--provider codex to choose, --dry-run to preview). The runtime is copied into .cachetoast/runtime, so hooks never call npm or the network. Run update instead of init to refresh an existing install; it keeps your providers, policy, state, and handoffs.
Then restart your agent.
codex in the repo, and approve the hooks in /hooks. The Codex app skips unapproved hooks and can't approve them (openai/codex#47283).If a session is at least 100k tokens (--min-context-tokens) and has been idle past its cache deadline, your next prompt is held once:
Cachetoast held this prompt!
This ~180k-token session has been idle 55 min with a 1h cache TTL, so its prompt cache has likely expired and continuing would re-read it all as uncached input.
Send it again to continue here OR start a new session (not resume or fork) and run:
/cachetoast-handoff claude-0123456789abcdef01234567
(The handoff includes your prompt.)
Send the prompt again to continue anyway. Or start a fresh session in the same repo and run the command from the notice: /cachetoast-handoff KEY in Claude Code, $cachetoast-handoff KEY in Codex. In Pi, /handoff opens the fresh session for you. The handoff is a local extract (requests, latest reply, compaction summary, Git status), not a model summary, and the new session is titled CT - <subject>.
Small sessions are left alone, since a fresh session wouldn't be cheaper. Cachetoast also:
--target-tokens, 100k–250k), keeping any lower limit already set.cache warm 24m · 180k, then cache cold).The hold starts at the TTL minus up to 5 minutes (1h → 55 min, 30m → 25 min, 5m → 4 min).
PI_CACHE_RETENTION=long), otherwise 30m.To override, run init --pi-cache-ttl 1h (or --codex-cache-ttl, --claude-cache-ttl; 5m, 30m, 1h, 24h). That saves to ~/.config/cachetoast/config.json; .cachetoast/local.json takes the same format per repo. A TTL reported by a Claude session always wins.
node .cachetoast/runtime/bin/cachetoast.mjs status # sessions, sizes, TTLs, policy
node .cachetoast/runtime/bin/cachetoast.mjs handoff --key KEY # print a saved handoff (or --provider claude for the latest)
node .cachetoast/runtime/bin/cachetoast.mjs uninstall # restore original files
Commit .cachetoast/runtime, .cachetoast/config.json, and the agent settings, hooks, and handoff command or skill. local.json, state/, handoffs/, and manifest.json are gitignored; handoffs contain conversation excerpts.
init and update are idempotent and leave unrelated settings alone. uninstall restores the original files and removes local state. Each stops if you've edited the managed files by hand.
npm test && npm run demo
MIT © 2026 R. Hunter Harris, Hunter Software Consulting. Inspired in part by Antiburn; no Antiburn code is included.
Local, provider-neutral handoffs and cache-aware session rotation for coding agents (Claude Code, Codex, Pi)
See the codeWhen you come back to a large, idle coding-agent session whose prompt cache has likely expired, Cachetoast holds your first prompt before the agent re-reads the whole context at full price, and gives you a handoff to continue in a fresh session instead. Works with Claude Code, Codex, and Pi.
Zero dependencies. No LLM calls, API keys, telemetry, or network access. Node.js 22+, macOS/Linux.
Built by R. Hunter Harris at Hunter Software Consulting, fractional product and technology leadership for B2B SaaS.
From the repo you want to protect:
npx github:rhunterharris/cachetoast init
It installs for the agents you have (--provider codex to choose, --dry-run to preview). The runtime is copied into .cachetoast/runtime, so hooks never call npm or the network. Run update instead of init to refresh an existing install; it keeps your providers, policy, state, and handoffs.
Then restart your agent.
codex in the repo, and approve the hooks in /hooks. The Codex app skips unapproved hooks and can't approve them (openai/codex#47283).If a session is at least 100k tokens (--min-context-tokens) and has been idle past its cache deadline, your next prompt is held once:
Cachetoast held this prompt!
This ~180k-token session has been idle 55 min with a 1h cache TTL, so its prompt cache has likely expired and continuing would re-read it all as uncached input.
Send it again to continue here OR start a new session (not resume or fork) and run:
/cachetoast-handoff claude-0123456789abcdef01234567
(The handoff includes your prompt.)
Send the prompt again to continue anyway. Or start a fresh session in the same repo and run the command from the notice: /cachetoast-handoff KEY in Claude Code, $cachetoast-handoff KEY in Codex. In Pi, /handoff opens the fresh session for you. The handoff is a local extract (requests, latest reply, compaction summary, Git status), not a model summary, and the new session is titled CT - <subject>.
Small sessions are left alone, since a fresh session wouldn't be cheaper. Cachetoast also:
--target-tokens, 100k–250k), keeping any lower limit already set.cache warm 24m · 180k, then cache cold).The hold starts at the TTL minus up to 5 minutes (1h → 55 min, 30m → 25 min, 5m → 4 min).
PI_CACHE_RETENTION=long), otherwise 30m.To override, run init --pi-cache-ttl 1h (or --codex-cache-ttl, --claude-cache-ttl; 5m, 30m, 1h, 24h). That saves to ~/.config/cachetoast/config.json; .cachetoast/local.json takes the same format per repo. A TTL reported by a Claude session always wins.
node .cachetoast/runtime/bin/cachetoast.mjs status # sessions, sizes, TTLs, policy
node .cachetoast/runtime/bin/cachetoast.mjs handoff --key KEY # print a saved handoff (or --provider claude for the latest)
node .cachetoast/runtime/bin/cachetoast.mjs uninstall # restore original files
Commit .cachetoast/runtime, .cachetoast/config.json, and the agent settings, hooks, and handoff command or skill. local.json, state/, handoffs/, and manifest.json are gitignored; handoffs contain conversation excerpts.
init and update are idempotent and leave unrelated settings alone. uninstall restores the original files and removes local state. Each stops if you've edited the managed files by hand.
npm test && npm run demo
MIT © 2026 R. Hunter Harris, Hunter Software Consulting. Inspired in part by Antiburn; no Antiburn code is included.