Token-warden plugin evicts Claude Code rules that don't earn their context
Token-warden is an open-source Claude Code plugin that benchmarks agent memory rules against a fixed golden suite and automatically evicts any rule that doesn't save at least 2× its own context cost.
Score breakdown
Token-warden replaces unverified, accumulating agent memory with a self-auditing system that keeps only rules proven to reduce token costs, directly cutting the ongoing expense of running Claude Code agents.
- 01Token-warden is an open-source Claude Code plugin authored by vukkt.
- 02It benchmarks agent memory rules against a frozen golden suite to measure their token delta.
- 03A rule must save at least 2× its own context cost to remain active — otherwise it is evicted.
Token-warden, published by vukkt on GitHub, is a Claude Code plugin designed to make coding agents measurably cheaper over time by applying a strict, benchmark-driven filter to agent memory. The core insight is that most "agent memory" accumulates advice that is never verified — token-warden replaces that pattern with a system where every rule must demonstrate a positive token delta on a fixed benchmark before it is allowed to persist in the agent's context.
The self-funding requirement is explicit — a rule must save at least 2× its own context rent to remain active.
The plugin operates as a four-stage feed-forward loop: lessons are extracted from finished sessions, distilled into candidate rules, benchmarked against a frozen golden suite, and then either kept or evicted based on their measured return. The self-funding requirement is explicit — a rule must save at least 2× its own context rent to remain active. Active rules are also re-benchmarked on a round-robin basis and evicted if they stop earning. Because collection runs inside a Stop hook, it never blocks or fails a coding session, adding zero session overhead. The result is a per-agent memory file containing only rules with measured, positive return.
Key facts
- 01Token-warden is an open-source Claude Code plugin authored by vukkt.
- 02It benchmarks agent memory rules against a frozen golden suite to measure their token delta.
- 03A rule must save at least 2× its own context cost to remain active — otherwise it is evicted.
- 04Active rules are re-benchmarked round-robin and evicted when they stop earning.
- 05Token collection runs in a Stop hook, adding zero overhead to active coding sessions.
- 06The optimizer is described as a four-stage, feed-forward loop.
- 07The repository includes agents, benchmarks, commands, hooks, and scripts directories.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 16, 2026 · 23:11 UTC. How this works →