Repository navigation
What This Solves
Short-TTL implicit KV-cache endpoints (such as Gemini 4 Neon's ~25s server cache window) silently drop hit rates to ~55–75% during normal coding sessions — not because your prompt prefix is broken, but because serialized multi-edit bursts (17–41s), unbounded read_file / verbose command outputs (86.4% of context growth), and >260K cold-prefill spirals (10s -> 26s) push active turns past the ~25s TTL cliff.
kv-cache-optimizer eliminates avoidable active-loop misses with zero reasoning quality downgrade, zero external dependencies, and zero telemetry.
Included in v1.0.0
- Forensic Auditor (
cache_audit.py): 100% local, read-only transcript analysis across Linux, macOS, and Windows — measures per-model hit rates, 11-bucketdtTTL decay curve, local prefix integrity (dt <= 10s, cleanly excluding Gemini-2049chunk tails), token-weighted root causes, counterfactual lift, and--compare-sincebefore/after verification. - Automatic
PreToolUseGuard (pre_tool_guard.c+pre_tool_guard.py):1.21msp50 native C11 binary with 100%-parity pure stdlibpython3 -Sfallback. Fail-open, auto-caps unbounded large textread_file(1..250), compacts noisy test/lint/build/diff/log outputs, boundsgit log(-n 30), slices giantcat, and never mutates pipes/chains/redirects/sudo/--help. Instant off-switch viaKVCACHE_DISABLED=1. - Failure-Preserving Output Distiller (
compact_run.py): Shrinks noisy passing runs to<=80lines while preserving 100% of errors, tracebacks, exit codes, and raw temp logs when truncated; enforces clean process-group timeouts. - Atomic Batch Patcher (
batch_patch.py): Collapses 3–6+ serializededit_filecalls (19–41s,58–96%miss) into one sub-second atomic all-or-nothing JSON patch. - One-Command Safe Installer (
install.py): Supports--mode plugin|skill|hooks,--build-native,--dry-run, timestampedhooks.jsonbackups, and clean--uninstall.