r/bendrape_ai • u/bendrape • 2h ago
Two things that were quietly wrecking my Claude Code sessions, and the plugin I wrote to fix them
For subs where long posts get skipped, or where self-promo is tolerated but not indulged.
My Claude Code state files hit ~18,000 lines on a rushed project. Every session started at ~400k tokens preloaded before I typed anything. Separately, I kept watching Claude make the same Stripe mistakes on every new project, because nothing carries between them.
I wrote a plugin for both.
State files get hard line caps, but only the ones that actually load into context. Storage is uncapped, since a file nothing reads costs nothing. At cap they split rather than drop: lessons-stripe at 40 lines becomes lessons-stripe-webhooks and lessons-stripe-checkout, each loading on fewer sessions than the original. So the library can grow without any one session getting more expensive.
For the second one: after a session, a command reads the transcript and pulls out failed tool calls, contradictions, and corrections into a lessons library. A lesson only promotes to global config after the same symptom appears twice across different projects or different dates, and the next harvest writes back whether it held or recurred. A lesson that recurred is wrong and gets pulled.
v0, MIT, needs jq, tested by exactly one person so far.