Prefixwise diagnoses prompt-cache misses, validated on 269k real agent requests
No-Individual159 · reddit · 2026-12-01
The author open-sources Prefixwise (MIT), a tool that explains why a prompt cache missed—which prompt part changed, what it cost, and whether it was avoidable—by hashing each request part and diffing against the previous turn.
Validation:
- Against Harvard's public FreeInference trace (269,348 real agent requests): fully agreed on "conversation only grew" (252,549/252,549), "something earlier changed" (9,840/9,844), and "model/provider switched" (3,981/3,981).
- Self-made changes: replayed real Claude Code sessions plus generated ones on vLLM/SGLang, injected 1,772 deliberate changes—caught all 1,772, named 1,746 exactly, 0 wrong attributions, 0 false alarms across 3,622 unchanged turns.
It suggests fixes with predicted savings (99.9% realized on Claude tool sorting, 97.5% on vLLM). Usable as a Python proxy (prefixwise.wrap(client)), a LiteLLM callback, or on Claude Code/Codex logs; stores only hashes and counts.
More from coding & agent
- Dev Claims Gemini 4 Neon Now Handles 95% of His Coding Workload — daniel_mac8 · 2026-12-01
- Merge Adds 10 New Agent Connectors Including Postman, Neon, Vanta — shensi · 2026-12-01
- Codex Community Hosts Meetups in a Dozen Cities Worldwide This Week — paw_lean · 2026-12-01
- Grok agent kept working overnight and built a working prototype on its own — R4nsack · 2026-12-01
- Microsoft ships Foundry Workflows and Agent Framework for enterprise agents — adnan_hashmi · 2026-12-01
- Team open-sources Serein, billed as the world's cheapest AI teammate, to dodge Grok rate limits — damnGruz · 2026-12-01