Token Warden tests Claude Code memory rules to cut token waste
Token Warden is an plugin for Claude Code. It watches agent sessions and turns useful patterns into possible memory rules. Each rule is then tested against a fixed test set.
A rule is kept only if it saves at least twice as many tokens as it costs to keep in memory. It also must not make the agent fail its tasks. Rules that do not pass those checks are removed automatically.
The goal is to stop weak or harmful context-management rules from piling up and raising costs or hurting results.
Key points
- Token Warden is an plugin for .
- It creates possible memory rules from observed agent sessions.
- It tests each rule on a fixed test set before keeping it.
- A rule must save at least twice the tokens it costs to carry.
- Rules that cause task failures are automatically removed.