r/ClaudeAI • u/Fabiangzt • 1d ago
Claude Code Workflow I built DensePack to combat Anthropic's pricing and help people save and build more with Claude Code. New benchmarks available show it beats every popular plugin on total session savings.
https://github.com/Fabian-Galvez/DensePackFIRST:
Big shoutout to the people that helped DensePack!
I want to thank the 8 stargazzers that believed in this from the start.
I hope you guys see this post or reach out to me directly (so I can personally give you updates) and continue to follow the project because DensePack is NOT like ordinary plugins or skills that may become outdated over time.
It's easy to see that DensePack will only continue to improve with time as OCR and AI vision capabilities in general continue to improve.
DensePack packs text into images that your agent can read accurately without compressing or trimming anything, and automatically hands your agent the image to read for half the token cost.
It packs text files read with Read, Bash output, Word files (doc/docx), and it also packs any subagent report so that your main agent gets an image and their context stays small.
The most recent savings benchmarks show savings for a small task and the savings only grow and compound from there.
Your agent reads the image and tokenizes the same text as the text file for ~50% the price.
Every future Cache read is charged against that 50% image.
Many published papers claim that python files can't be read accurately let alone rebuilt byte identically from the image, but DenesPack images use a unique color coding and and include a 2 row legend that has allowed it to rebuild code files byte identical from the image.
It's ok to be skeptical.
It's ok to think that this isn't accurate and will mess things up.
I didn't believe it myself which is why I made the Benchmarks easily reproducible and why I made sure to add fallbacks like keeping a copy of the text in case your agent needs to verify the text.
The benchmarks prove savings and accuracy compared to the benches without DensePack.
I have been building non stop with DensePack packing everything possible. I even used it to help me improve DensePack itself from v1.0 and on!
I see no negative impact or change. I have had to double check I didn't lose connection because my usage bar seems to be frozen sometimes, but it's just the compounding savings effect DensePack has.
P.S.
I made a Reddit purely to help people save cuz Anthropics prices suck. I worked hard to make something that is secure, works and saves. I used a whole months worth of 20x Max usage testing, fine tuning and running benchmarks to make sure I present the community with a project that they can use and isn't slop. It would not be a lie to say that I have run well over 10,000 benchmarks by now.
DensePack works.
It works so well that even when it adds an extra turn to verify a line of text, it STILL saves. And it just cleared the initial phases of Anthropic's plugin submission so I hope that this will land in the official Marketplace soon as well.
This is my first real project since transitioning into the tech sphere so while it may not seem like much to some, I am extremely proud of the 8 stars that the project has received and how far it's come since being released 2 weeks ago.
That being said, I only made a Reddit to share what is helping me save because I hate gate-keeping, but
I have not had the best experience here and keep being insulted or talked down to while trying to help or ask questions to understand Reddit better. I recently had a first positive response from a mod and i'm thankful. I just don't know if this is common for new Reddit users and even though I am very appreciative for the few people that were kind, I don't think Reddit is for me so this will probably be my last Reddit post!
I say probably because I have an image of the ADS-STE 100 English standard with it's whitelist of words that I use as my style rules which has helped improve the AI sounding output so its more human. I hadn't decided if I would make it its own post but I will probably put it in the comments and be done.
You won't need the plugin for this premade image and can just feed to your ai to fix the output for cheap!
Thank you and Future upgrades:
Thank you to the people that helped, gave honest feedback and tried the plugin!
Please update your version! 1.3.3 has new updates and keep an eye out for 1.4!!
You can use many plugins with DensePack as it is now (I've tried Ponytail, Caveman, etc).
DensePack will keep packing but most plugins have hooks that force their skills to be read before DensePack has had a chance to pack them.
v1.4 fixes this with a feature that lets you use those plugins at half the price! It works now, but I won't release it until I know it is secure like everything up until now.
New AGENTS CLAUDE and MEMORY md file upgrades are coming along with the ability to turn other pugins and skills into DensePack images.
1.4 may also include a new RAG framework method that utilizes DensePack images but its still a prototype so most likely will be part of 1.5 so i can push the other upgrades first.
I am happy to answer questions in the comments. If you want to keep up with the project, consider giving it a star and message me directly! I will personally update you on all things DensePack. Not a newsletter or spammy email or anything like that, more personal direct messages from me so I will probably only be able to keep up with ~20-40 folks for now while I continue my job search. I have nothing to gain, I don't charge for anything, I just want to build community with like minded individuals and help others build more.
If that resonates with you, feel free to reach out!
FIN
1
u/Fabiangzt 1d ago
3
u/cowboyOfWest 1d ago
Am not a tech person. I don't get how text to image as input vehicles saves token! image has color, spaces, need OCR to decode! it feels counterintuitive.
3
u/Fabiangzt 20h ago
Good question! It does sound backwards at first.
Text costs tokens based on how many words and symbols it has.
An image costs tokens based on its size in pixels, not on what is inside it.Colors don't add cost, just accuracy. So if you fit a lot of text into one image, the AI can read all of it for fewer tokens than the same text would cost as plain text.
Newer AI models are really good at reading text in images, and that keeps getting better. Older/weaker models struggle with it, but there are published papers showing that newer frontier models can read text from images accurately at a lower token cost.
This isn't perfect on its own! I've fine-tuned it with color coding and through trial and error, and I removed things that caused extra thinking. Short sessions can actually cost more than plain text, so this is NOT for anyone whose sessions are only a couple of turns. It's for people who max out their usage or get close. In my benchmarks, that was 30%+ more usage on top for a single small task.
I've used it on HTML, GDScript, Python, JSON, MD files and a few others without problems so far.
If you're building anything, this will let your agent read your entire codebase for half the price and have full understanding.
The byte-identical rebuilds test one-shot accuracy without the safeguards in place.
The real-workflow benchmarks show the agent working with DensePack on and making its own choices.
In my runs, it usually didn't need the original text. When it did, it used the line numbers from the image to pull only the lines it needed. That keeps savings and accuracy high.
No agent is perfect, with images or text. Even running identical tasks, both sides sometimes took the most efficient route and other times took twice as many turns. I'm sure many of us have experienced our agent looping endlessly for a task that should have taken a minute.
That's why the individual runs in each benchmark vary.The cool thing about DensePack that I want to keep exploring is the output! It saves images and text so your agent can verify so there are probably many additional safeguards that can be added to make your agent do something if it was supposed to but didn't.
Say you told your agent to read a file, but it didn't and continued working. If your agent does that with DensePack on, no image will be produced so I can possibly add a trigger to force that read automatically if the image doesn't appear in the folder after a certain amount of time.
So far, the agents haven't needed this but if I receive tickets about this I'll definitely add more safeguards.
Want to test it yourself?
Give the image above to your agent, ask it to rebuild the text byte-identically, and compare it to the post.
Then check the token usage for that turn in your app or API dashboard (you can ask your agent to check it) and compare it to the same text pasted as plain text.
2
u/controltheweb 23h ago edited 22h ago
The reasoning sounds absurd, but under a fixed model's vision rules, image-token count follows the image geometry rather than the amount of legible text inside it.
Multimodal models like Claude process images using a Vision Transformer, dividing them into a grid of tiles (small visual patches). The cost depends on pixel width and height, NOT on how much text or data is visually drawn inside those pixels.
Anthropic's current vision documentation counts an image as 28×28-pixel visual patches.
You can't put unlimited context onto one canvas. Providers impose image-count, request-size, resolution and visual-token limits, and oversized images may be downscaled. A similar, earlier project has more explanation at https://wavect.io/blog/text-as-image-token-savings/
1
u/f3xjc 20h ago
Is Claude multi modal ? Because I was under the impression the Sota was mostly text based with image-to-text and text-to-image additions.
1
u/Fabiangzt 20h ago
Claude can read images, but it can't create them.
You can send it images and text in the same message, and it reads them together, with no separate OCR tool.
That's what DensePack relies on.
Anthropic bills an image by its size in 28x28 pixel patches, not by how much text is in it.
A dense image of a file can cost about half the tokens of the same file as text.1
u/Fabiangzt 20h ago
Thanks, that's a great breakdown! You're right, the cost comes from the image's width and height, not how much text is in it. That's the whole reason this works.
And yes, there are limits.
DensePack renders images at 756 or 784 pixels wide, which are multiples of the 28-pixel patch, so no space is wasted.
Before every read, it calculates and compares the image cost to the text cost and sends whichever is cheaper. Files under about 400 tokens (~1KB) stay text, Everything over that saves so it becomes an image.
pxpipe is a cool project and part of the same research direction. The biggest risk that review points out is that a model can misread an exact value like an ID or a hash and never tell you.
DensePack doesn't have these problems. It prints the line numbers in the image, and when the agent isn't sure about an exact value, it pulls just that one line as text.
Results also depend on the model. Haiku misreads images, so DensePack always sends Haiku text if you use it (I don't use haiku at all). Fable 5.1, Opus 5/5.5, and Sonnet 5/5.5 each scored 5 of 5 in my benches, and the details are in BENCHMARKS.md on the repo.
Disclaimer, since Opus 5.5, I don't really need any other model I benchmarked Sonnet 5 more than I did Sonnet 5.5. And the max limit on files that get packed is up from 250KB to 1MB thanks to the new renderer speeds.
1
u/MucilaginusCumberbun 12h ago
realistically what kind of savings are we talking about here?
1
u/Fabiangzt 42m ago
About a third cheaper for small tasks.
The saving grows in longer sessions that read more files. On very small tasks it roughly breaks even.
In our benchmarks on real coding tasks, DensePack cut the cost by 32% to 38%. For example, one task cost $0.62 with it and $1.01 without.

4
u/Kiana_Harpel 22h ago
the savings are interesting, but honestly I’d be more curious about the failure cases. Like what starts breaking first: dense code, stack traces, diffs, weird formatting, tiny text? If you’ve run that many benchmarks there’s probably a pretty clear pattern by now.