claude-p: opt-in persistent sessions (MIKE_CLAUDE_P_PERSIST=1) - 2.4x faster agent loops

↗ view on GitHub · Eli Ziff · 2026-07-30 · e640b740

One long-lived claude -p --input-format stream-json process per
conversation: first turn carries the full payload, later iterations
send only tool_results (the session holds context; probed live on CLI
2.1.220). Any failure falls back to a fresh session with full replay,
so recovery is stateless and the incumbent per-call path is untouched
by default. Live A/B (sonnet, 2-tool-call loop): 14.5s -> 6.0s with
prompt-cache reads engaged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AgUm5EcRKbT3duVFMbrQD
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 9bdcc352
Stats 1 file changed , +286 , -76
Part of claude-p transport: alternative LLM backend via the Claude CLI

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-e640b740.md from inside the repo you want the change in.

⬇ Download capture-commit-e640b740.md