✳ClaudeModsClaude Code mod directory
☰
● 0 online · Views 0 times
+ Submit a project
← Back to projects
Reddit posts · Usage & costs / Tools & integrations / Workflows & CI

DensePack: Pack Text into Images to Save Claude Code Token Costs at Half Price

DensePack packs text from Read, Bash output, Word files, and sub-agent reports into color-coded images with legends, allowing agents to consume the original text content at about half the token cost by reading images. Benchmarks show it saves more than all popular plugins in total sessions, and the latest version has passed Anthropic plugin.

FFabiangzt@Fabiangzt
DensePack: Pack Text into Images to Save Claude Code Token Costs at Half Priceimage1
Translated

About this mod

DensePack is a Claude Code plugin that packs text files (such as files read by the Read command, Bash output, doc/docx documents, and sub-agent reports) into color-coded images, allowing agents to read equivalent content at about 50% of the original text's token cost. The image includes a two-line legend and can reconstruct code files byte-for-byte from the image. The project provides reproducible benchmarks proving savings and accuracy, and includes text copies as fallback verification. The author used a 20x Max subscription for a month for testing and tuning, has run over ten thousand benchmarks, recently released version 1.3.3, and version 1.4 will support intercepting hooks of other plugins at an earlier stage and converting other plugins/skills into DensePack images.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

git clone https://github.com/Fabian-Galvez/DensePack && cd DensePack # 后续请参照仓库README进行安装配置
Original text / README

FIRST: 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 submitted by /u/Fabiangzt [link] [comments]

View original source ↗

Similar projects