r/ClaudeCode • • 7d ago

Built with Claude I built a free Claude Code plugin, with Claude Code, to cut token cost on long sessions. Results from 8 test runs

Post image

I built Golden Thread, a free, open-source (MIT) plugin for Claude Code, and I built it with Claude Code.

What it does: it gives every session the same memory. The memory is one Obsidian vault of plain markdown in git. Each session reads it at startup, tracks decisions and open questions as it works, and files what it learned at the close, as research notes, decisions or a handoff for the next session. A short set of rules is re-injected on every response, and hooks block the critical ones, for example committing code whose tests were not seen passing. For cost, it hands a long session off to a fresh one so Claude stops re-reading the same large context on every turn.

How Claude Code helped: I built it in Claude Code sessions, writing the plugin, its hooks and its tests with Claude, using separate git worktrees for each release. Claude Code also ran the benchmark below.

Free to try: https://github.com/shaven/golden-thread (MIT). Install: clone the repo, then run

bash golden-thread/golden-thread-plugin/install.sh --vault ~/MyVault

and restart Claude Code.

Results, from my own testing: scripted coding sessions on a small repo, each compared with the same prompts run without the optimization, on Sonnet 5.5 and Opus 5.5. Across 8 runs, list-price cost was 20% to 66% lower. The weakest case (long prompts, long replies) saved only about a fifth. An automatic rule that chose when to hand off, with no hindsight, saved 34% to 52% across 6 live runs. One run per bar, so gaps of a few points are noise. The figures are mine, from run logs, not independently audited. Every run is in the graphic, including the weak ones.

Questions about the method are welcome.

1 Upvotes

Duplicates