Dev.to
6/27/2026

I built a Claude Code plugin that only keeps an "agent memory" rule if it can prove it saves tokens
Short summary
Developer open-sourced token-warden, a Claude Code plugin that validates agent memory rules through token benchmarking. Rules must save 2x their overhead or auto-evict. Real case: a grep-first rule cut wasteful agent sessions 16% (67k to 56k tokens, ~3¢/run on Sonnet), but vanished in optimized workflows—measurement over vibes.
- •Open-source tool that benchmarks Claude Code agent memory rules for real token efficiency
- •Rules auto-evict unless they save at least 2x the tokens they cost to maintain
- •Measured example: grep-first rule saved 16% on wasteful agents, disappeared on optimized ones
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



