Reduce Claude Code Token Usage: 5 Free GitHub Repos I Tested

By Beau Johnson··11 min read

Quick answer

CodeBurn shows where your Claude Code tokens go, and Serena, RTK, Headroom and pxpipe each make Claude read less. I'd install the CodeBurn command line tool first, then Serena on any real codebase, and treat the other three as situational.

Most of the tokens Claude Code burns aren't the code it writes. They're what it reads, and it sends the whole conversation again every turn. In this video I count down five free GitHub repos that make Claude Code read less, and I ran every one in a sandbox on test files I built. If you keep running into your limits or you pay by the token, this one is for you.

What I cover in this video

  • 0:00 Why reading, not writing, eats most of your tokens
  • 0:47 Number 5, CodeBurn: a receipt for where your tokens go
  • 3:05 Number 4, Serena: read one function instead of a whole file
  • 5:22 Number 3, RTK: a hook that filters your terminal output
  • 6:09 What JetBrains and Quesma found when they tested RTK
  • 7:39 Number 2, Headroom: a local proxy that compresses what Claude reads
  • 9:55 Number 1, pxpipe: turning text into pictures
  • 12:14 The pxpipe catch and which ones I'd actually install

CodeBurn: see where your tokens go first

CodeBurn (11,778 stars, MIT license) doesn't save a single token on its own. It shows you where they go. Every time you use Claude Code, Codex or Cursor, a session file gets written to your computer with every token and model call in it. CodeBurn reads those files with no proxy and no login, prices every token by model (including the cache reads most people forget about), and splits the total by project, model, git branch and kind of task. Your bill gives you one number. This gives you the receipt.

Then you run this and it hunts for waste:

codeburn optimize

It looks for things like a file the agent rereads on every turn, an MCP server you installed months ago and never call, or a CLAUDE.md that grew so long it rides along in every request. It grades you, shows the fix, and can apply it and undo it. On two small Codex test sessions in my sandbox, the total was about 8 cents and the cache hit rate was about 90%, so almost all of those tokens were the agent reading things it had already seen. I got an A, 93 out of 100, with one fix: shrink how much bash output the agent gets back.

The catch is telemetry. The command line tool sends nothing, but the desktop and menu bar app has it on by default and sends the names of the models, tools and MCP servers you use. The dollar amounts are estimates at list price, not an invoice. If you're on a Max plan like me, look at its quota view instead.

Serena: read one function instead of a whole file

When Claude Code goes looking for one function, it reads files, chunks of them, and greps around. Everything it reads lands in the context and gets sent again on every turn after. It's like flipping through a whole cookbook to find one recipe. Serena (31,320 stars) hands Claude the index.

Serena starts a language server, the same engine your code editor uses for go to definition, and it supports over 40 languages. The flow looks like this:

  1. Claude asks for an overview, which is the names of every function and class in the file.
  2. It pulls the one function it needs, body included.
  3. It asks who calls that function.
  4. It can edit right at that function instead of rewriting the whole file.

I tested it on an 8,650 line Python file. Reading the whole file would be roughly 89,000 tokens. Serena found, read and traced the one function in about 1,000, or a few thousand if you count its own instructions. I counted with a stand-in tokenizer, not Claude's own, so the exact numbers will be a little different, but the gap is the point.

To set it up, you install the Serena agent with uv and then run its setup for Claude Code. The setup is heavier because it downloads a language server the first time. It can edit files and run shell commands, so it isn't read-only. The license is GPL-3.0, which is free to use at work and only matters if you hand Serena itself to other people inside something you ship. I also couldn't find a single independent token test for it.

RTK and Headroom: filter and compress what Claude reads

RTK has 86,319 stars, the most of anything in this video. It doesn't touch Claude at all. It makes your terminal output smaller. You run:

rtk init -g

That adds a hook to Claude Code, a little script that fires before every shell command. When Claude decides to run git status, the hook swaps it for rtk git status, runs the real command and filters what comes back. Nothing is hidden. The cut output tells Claude where the full version lives, and if a filter breaks you get the normal output.

On a test project with 65 tests and two failures I planted, normal pytest output was 6,485 bytes. With RTK it was 389, and both failures were still there with the exact values. RTK's own counter said about 40% saved across the session.

Then I looked at the independent tests. JetBrains tested version 0.43 on 80 pairs of tasks with Claude Sonnet 5. At low effort, the RTK runs cost a median 7.6% more per task. At high effort there was basically no difference. Quesma spent over $1,500 on tokens testing 0.45 and concluded RTK doesn't make AI coding cheaper. Even RTK's own follow-up test called it cost neutral. In Quesma's test, terminal output was only about 11% of the input tokens, and reading files and searching aren't hooked out of the box. When something gets cut, Claude can need one more turn to go find it. In Quesma's words:

one extra agent turn can cost more than the compression saved

To be fair, RTK is on version 1.2 now and I couldn't find anyone who has retested it. Its own README says a 90% cut in command output is not a 90% cut in cost. It's free to use in production. You just can't offer it to other people as a paid or hosted service.

Headroom (79,433 stars, Apache-2.0) goes wider. It sits between Claude Code and the API and compresses everything Claude reads, right on your machine. You start it with:

headroom wrap claude

A router looks at each piece of a request, figures out if it's JSON, code or plain text, and sends each type to its own compressor. It keeps the originals on your machine so Claude can ask for the full thing back, and it warns you about anything that would break your prompt cache. On my 400 line JSON log, Headroom's own count was about 39% smaller, and the one fatal error line with its exact request ID was still there. It wrote the field names once as a header and then 400 rows, like turning a log into a spreadsheet.

Their benchmarks say 21 to 57% fewer input tokens depending on the task. For repeated JSON and log lines the README says 90% plus, and I got 39, so take the big number with a grain of salt. Three things to know before you turn it on: an anonymous telemetry beacon is on by default (one environment variable turns it off), all your API traffic runs through the proxy locally, and plain text barely compresses.

pxpipe: turn text into pictures

pxpipe (7,606 stars, MIT) has the smallest star count and the strangest idea. It takes the bulky text in Claude's context, prints it as a picture, and Claude reads the picture. Claude prices images by size. It splits an image into 28x28 pixel squares and every square is a token, so one full pxpipe page comes to about 1,456 tokens no matter how much text is crammed onto it.

Before each request leaves your machine, pxpipe finds the bulky parts like big tool results, older history, the system prompt and the tool docs. Your messages and recent turns stay as normal text. It reflows the rest into a tiny pixel font on PNG pages, then adds a small text sheet with exact paths, IDs and numbers, because pixels can garble those. In my sandbox, the same 54,000 character log became three pages in about half a second, about 3,600 tokens as pictures, which is roughly a quarter of the text cost by pxpipe's own estimate.

The famous 59 to 70% bill cut was measured on the original Fable 5. On Opus 5.5 the README drops it to gist only, where it got 3 out of 15 exact codes right in their test. For Sonnet and Haiku 5.5 they say don't image at all. By default it still turns Opus 5.5 traffic into pictures, so you'd have to change a setting. And when it's wrong, it's wrong silently. In my run, the fact sheet kept a duration number but not the request ID of the one error that mattered. It's also a proxy that sees your prompts and your API key on your own machine, so treat it like an experiment.

Key takeaways

  • Start with CodeBurn, command line version only. Find the leak before you fix anything.
  • Add Serena on any real codebase. It was the biggest drop in my tests by far.
  • Use Headroom if you pay by the token through the API and your agent chews through logs and JSON. Turn the telemetry off.
  • RTK is quick to try and never hides your output, but check CodeBurn before and after. Don't take the 90% on faith.
  • Keep pxpipe for gist work. It's the most creative hack I've seen this year and the one I'd trust least with exact numbers.

FAQ

Does RTK actually lower your Claude Code bill?

In my sandbox RTK cut pytest output from 6,485 bytes to 389 and kept both failures. But JetBrains (rtk 0.43) and Quesma (rtk 0.45) found no reliable saving on the bill, and RTK's own follow-up called it cost neutral. RTK is on 1.2 now and I couldn't find a retest, so measure with CodeBurn before and after.

How do I see where my Claude Code tokens are going?

CodeBurn reads the session logs already on your machine and splits your tokens by project, model, git branch and task, with no proxy and no login. The command line tool sends nothing, while the desktop and menu bar app has telemetry on by default.

Does pxpipe work with Claude Opus 5.5?

Only for gist work. The 59 to 70% bill cut was measured on the original Fable 5, and on Opus 5.5 the pxpipe README says gist only, with 3 out of 15 exact codes right in their test. By default it still turns Opus 5.5 traffic into pictures, so you'd have to change a setting.

Is Serena free to use at work?

Yes. Serena is GPL-3.0 and free to use at work. The GPL only matters if you hand Serena itself to other people inside something you ship.

Chapters

  1. 0:005 repos that make Claude Code read less
  2. 0:37Number 5: CodeBurn
  3. 2:34Night Crew
  4. 2:47Number 4: Serena
  5. 5:05Number 3: RTK
  6. 7:50Number 2: Headroom
  7. 10:03Number 1: pxpipe
  8. 12:35Which ones I'd actually install

Transcript

Read the full transcript

0:00This free GitHub repo turns a log file into pictures that Claude reads for a quarter of the tokens by its own estimate. Another one cut those sane log lines by almost 40%. And a token saver with over 86,000 stars. Two independent tests found no reliable saving. But most of Claude Code's tokens aren't what it writes, they're what it reads. And it rereads them every turn. So, in this video, I'm counting down five free repos that make Claude read less. From seeing where your tokens go to those pictures, I tested everyone in a sandbox. Let's jump right into it. So, number five is code burn with over 11,000 stars and an MIT license. And this one doesn't save a single token on its own. It shows you

0:47where they go. Every time you use Claude Code, codeex, or cursor, it already writes a session file to your computer. And that file holds every token and every model call. So step one, code burn reads those files. No proxy, no login. Step two, it prices every token by model, including the cache reads most people forget about. And then step three, it splits the total by project, by model, by git branch, and even by the kind of task. Your bill gives you one number. This gives you the receipt. Step four, you run code burn optimize, and it hunts for waste. A file the agent rereads on every turn. An MCP server you installed months ago and never call. A claw.md that grew so long it rides along in every single request. So it grades

1:34you, shows you the fix, and it can apply it and undo it. So I ran it in the sandbox on two small test sessions from codeex and it reads Claude Codes logs the same way, about 8 cents total and the cash hit rate was about 90%. So almost all of those tokens were the agent reading stuff it had already seen. Cache reads are a lot cheaper, but they pile up. It gave me an a 93 out of 100 with one fix. Shrink how much bash output the agent gets back. So the command line tool sends nothing, but the desktop and menu bar app has telemetry on by default and it sends the names of the models, tools, and MCP servers you use. And the dollar amounts are estimates at list price, not an invoice. If you're on a max plan like me, you pay a flat price. So you'd look at its quota

2:20view instead. So once you see how much of it is reading, the next four repos are all about making Claude read less. Starting with one that traced one function out of an 89,000 token file for about a,000. Easy Flip got 460,000 views in 11 days. Night Crew made one new short every day and posted it to four platforms. The best one hit 155,000. Want that for your business? Nightcrew.studio. So, number four is Serena with over 31,000 stars. It's the oldest one here from March 2025, and it got rebuilt just last month. When Claude Code goes looking for one function, it reads files, chunks of them, and GPs around. So, everything it reads lands in the

3:05context, and that gets sent again on every turn after. It's like flipping through a whole cookbook to find one recipe. Serena hands Claude the index. So what's actually going on under the hood? Serena starts a language server, the same engine your code editor uses for go to definition, and it supports over 40 languages. Step one, Claude asks for an overview, just the names of every function and class in the file. Step two, it pulls the one function it needs, body included. Step three, it asks who calls that function. And step four, it can edit right at that function instead of rewriting the whole file. So Serena even spells this out in the instructions it gives Claude. Read is forbidden for discovery. Use the overview then find

3:51the symbol. So I tested it on an 8,650line Python file. Reading that whole file would be roughly 89,000 tokens. Serena found it, read it, and traced the one function in about a thousand or a few thousand if you count its own instructions. Now, I counted those with a stand-in tokenizer, not Claude's own. So, the exact numbers will be a little different, but the gap is the point. It's huge. To set it up, you install Serena agent with UV, then run Serena setup claude code. It's not all upside. The setup is heavier because it downloads a language server the first time. It can edit files and run shell commands, so it's not readon. And the license version 2 is GPL3. It's free to

4:36use at work, too. The GPL only matters if you hand Serena itself to other people inside something you ship. And I couldn't find a single independent token test for it. The reviews [snorts] on its page are AI models praising it. Come on now. So, Serena makes Claude read less code, but a lot of what Claude reads is whatever your terminal spits back. And the next repo, the most starred one in this video, goes after exactly that with the most awkward test results. So, [snorts] number three is RTK with over 86,000 stars, the most of anything in this video. I actually flashed it on a card for a few seconds in my 100x Claude code video last month. This is the full story. So, RTK doesn't touch Claude at

5:22all. It makes your terminal quieter. Step one, you run RTK init-g and it adds a hook to Claude code, a little script that fires before every shell command. Step two, Claude decides to run get status and before that runs, the hook swaps it for RTK get status. Claude never even knows. Step three, RTK runs the real command and filters what comes back. Tests show only the failures with their assertion. And step four, nothing is hidden. The cut output tells Claude where the full version lives. And if a filter breaks, you just get the normal output. I ran it on a little test project with 65 tests and two failures. I planted normal pi test output was 6,485 bytes with RTK 389 and both failures

6:09were still there with the exact values. Its own counter said about 40% saved across the whole session. So that sounds amazing, right? This is the part that bugged me. Jet Brains tested an older version 0.43 on 80 pairs of tasks with Claude Sonnet 5. At low effort, the RTK runs cost a median 7.6% 6% more per task. At high effort, basically no difference. Then Questma spent over $1,500 on tokens, testing 0.45, and they concluded RTK doesn't make AI coding cheaper. The savings didn't hold up across tasks. Even RTK's own follow-up test called it costneutral. So, how does a tool that cuts command output that much not cut the bill? Two reasons. In

6:54Questma's test, terminal output was only about 11% of the input tokens. and reading files and searching aren't hooked out of the box. And when something gets cut, Claude can need one more turn to go find it. In Quesma's words, one extra agent turn can cost more than the compression saved. To be fair to RTK, it's on version 1.2 now, and I couldn't find anyone who has retested it. And their own readme says it plainly, a 90% cut in command output is not a 90% cut in cost. Respect for that. The license is Apache 2, plus a business source license on the engine in the main build. Free to use in production, even at work. You just can't offer it to other people as a paid or hosted service. So, my take, it's quick to try and it never hides your output.

7:39But measure with code burn before and after. Don't take the 90% on faith. Now, what if instead of filtering one command at a time, you compressed everything Claude reads? So, number two is headroom. with over 79,000 stars in about 10 months. It's built by Tis Chopra, whose GitHub lists Netflix, but this isn't a Netflix product. It's published by a company called Headroom Labs. So, Headroom sits between Claude code and the API, and it compresses everything Claude reads before it gets sent right on your machine. You run Headroom Wrap Claude, which starts a local proxy and launches Claude code pointed at it. Then every time Claude sends a request, a router looks at each piece and figures out what it is, like

8:24JSON, code, or plain text, and each type goes to its own compressor. JSON goes to one called SmartCrusher. Code gets shrunk by its structure, and plain text goes to a small model. It keeps the originals on your machine, so if Claude needs the full thing, it can ask for it back. And it warns you about anything that would break your prompt cache, so you keep that discount. So, I ran it on the same 400 log lines from the start of this video, all JSON. By Headroom's own count, it cut them by about 39%. And the one fatal error line with its exact request ID was still there. So, you can see how it did it. Instead of writing the same field names 400 times, it wrote them once as a header and then 400 rows. It basically turned a log into a

9:10spreadsheet. Their benchmarks say 21 to 57% fewer input tokens depending on the task and ours landed in that range. But for repeated JSON and log lines, which is exactly what my file was, the readme says 90% plus. I got 39. So take the big number with a grain of salt. Before I turned it on, I'd want to know three things. There's an anonymous telemetry beacon on by default. They say it never sends your prompts or code, but it's on and one environment variable turns it off. Second, it's a proxy, so all your API traffic runs through it locally, and plain text barely compresses. The readme even says the free version saves less than it could, and there's a paid version for Teams that saves more. So, Headroom turned that log into a

9:55spreadsheet. The number one repo turned the same log into a picture, and it's the strangest idea in this whole video. So number one is PXpipe with over 7,600 stars. Smallest star count here. Craziest idea. So it takes the bulky text in Claude's context, prints it as a picture, and Claude reads the picture. So why would that be cheaper? PXpipe says dense code or JSON costs close to one token per character as text, but pictures are priced by their size. Claude splits an image into 28x 28 pixel squares and every square is a token. So, one of PXpipe's full pages comes to about 1456 tokens, no matter how much text is crammed onto it. And PXpipe

10:42crams a lot. Step one, you launch Claw Code through it with PXpipe warp. Step two, before each request leaves your machine, it finds the bulky parts like big tool results, older history, the system prompt, and the tool docs. Your messages and the recent turns stay as normal text. Step three, it refflows that text into a tiny pixel font over 300 characters a line on PNG pages. Step four, it adds a small text sheet next to the pictures with exact paths, IDs, and numbers because pixels can garble those. And step five, it measures every request against what the original would have cost. So in my sandbox, that same 54,000 character log became three pages in about half a second. By PXpipe's own

11:28estimate, that's about 14 1.5,000 tokens as text and about 3600 as pictures. And the readme says most of the commits in this repo were written by Claude agents running behind PXpipe, reading their own history as pictures. But the famous 59 to 70% bill cut was measured on the original Fable 5. On Opus 5.5, the readme drops it to a lower tier, gist only. It got three out of 15 exact codes right in their test. For Sonnet and Haiku 5.5, they say don't image at all. And by default, it still turns Opus 5.5 traffic into pictures. So you'd have to change a setting. When it's wrong, it's wrong silently. In my run, the fact sheet kept a duration number, but not the request ID of the one error that

12:14mattered. That ID only lived in the pixels, which is exactly what the readme warns a model can misread. So, it's also a proxy that sees your prompts and your API key on your own machine. It's MIT and free, but treat it like an experiment. So, it's the most creative hack I've seen this year and the one I'd trust least with exact numbers. So, which ones would I actually install? Code burn first today, just the command line version. Find a leak before you fix anything. Then Serena on any real codebase. The biggest drop in my tests by far. Headroom if you pay by the token through the API and your agent chews through logs and JSON and turn the telemetry off. RTK, sure, it's quick to try, but check code burn before and

13:00after. and pxpipe only for gist work because on claude its top tier is the original fable 5 not opus 5.5. I'll put every repo down below. So what's eating most of your tokens files logs or claude rereading its own chat? Drop it in the comments. I'll read them. And if this saved you a few tokens, hit like so it finds someone else who keeps running into their limits. Have a blessed day.

Ready to start building with AI?

Join the Shipping Skool community free. Paid members get live bootcamp calls every week and weekly-updated courses.

Join Shipping Skool

Keep reading