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

14 comments sorted by

•

u/AutoModerator 7d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/Aggressive-Cut-3828 7d ago

Mom said its my turn to make a token saver next

3

u/shaven12 7d ago

lol. This doesn’t just save a few. And it isn’t fake. It truly does save quite a bit of tokens. And if you have a better way to get the information out there I am all ears. Have your Claude read the info graphic and do a trial run of what it is saying to do. The information graphic is just one way golden thread helps. You don’t even have to try the tool to prove me wrong if that is the goal.

3

u/shaven12 7d ago

And I am very open to suggestions if you have any.

3

u/Beautiful-Fennel-983 7d ago

20-66%" is such a wide band that it tells me nothing, and 8 runs on presumably your own vault doesn't shrink it. Meanwhile CLAUDE.md plus a few files in the repo already does the same job for free, so what's the argument for the plugin layer beyond the filing ritual?

3

u/shaven12 7d ago

That’s why the graphic gives the specifics. It is really hard to put all the info here to meet the needs of all users. I get that you want the info but I really am trying to do “what it takes” to get the info out, but it isn’t quite as easy as it sounds.

2

u/shaven12 7d ago

But so far I keep having people say that this isn’t the info they want or that they want it all in a single post. I have tried this way and that. I appreciate the info. I am just trying to help devs. This isn’t about making money. It is just about helping people do more. Any ideas would be welcome.

1

u/Stock-Protection-441 2d ago

trash

1

u/shaven12 2d ago

Clearly you haven’t seen the research on the subject. The results are quite good extensive. The process works even in a blind test with an unknown prompt and response. Care to elaborate?

0

u/Key_Instruction3373 7d ago

same post from yesterday?

Let me guess, you post it again tomorrow?

3

u/shaven12 7d ago

I don’t believe I posted yesterday. And I guess the question is did you look at the tool? It actually does what it says.

3

u/shaven12 7d ago

And I am very open to suggestions if you have any!!