Developer builds self-validating Claude Code plugin that auto-discards ineffective memory rules
A developer has released token-warden, an open-source MIT-licensed plugin for Claude Code that only retains agent memory rules if they demonstrably save tokens. The tool monitors Claude Code sessions, extracts candidate efficiency rules from costly interactions, and benchmarks each rule against a frozen test suite to verify it saves at least twice the tokens it costs to store. Rules that fail the threshold are automatically discarded, including one case where an apparent 38,000-token saving was rejected because it stemmed from the agent abandoning its task rather than working efficiently. In a real-world test on a wasteful agent, a rule instructing the model to search for a symbol before reading an entire file reduced session token usage from roughly 67,000 to 56,000, a 16% cut worth about three cents per session. The project is available on GitHub and the developer is inviting public testing and scrutiny of the reported figures.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in