Packs text files into small images that an AI model reads for about half the input tokens. Includes a Claude Code plugin, a right-click tool and an HTML app.
See the code
DensePack packs text into the smallest image that Fable, Opus and Sonnet models can read. The image uses about half the input tokens of the text.
Anthropic's claude plugin eval ran three coding tasks on Opus 5.5. DensePack saved 31.8% to 38.3% of the price on average, and all runs passed their checks.
Turns are calls to the model that send the entire conversation that has been written to cache at cache read price.
The DensePack plugin and the right-click tool render their images with FreeType and run on Windows, Linux and macOS. The tests ran on Windows and Linux.
Anthropic's claude plugin eval ran three tasks on Opus 5.5, 5 times with DensePack and 5 times without it. Each run with DensePack cost less than its paired run without DensePack and passed all checks.
| Task | What the agent does | Mean saving |
|---|---|---|
| Code trace | The agent traces how a Read becomes an image through about 20,000 lines of code | 32.6% |
| Architecture doc | The agent reads 14 hook scripts, about 8,700 lines, and outputs ARCHITECTURE.md | 31.8% |
| Five files read whole | The agent reads five scripts whole, 5,586 lines, and writes a 5-line summary | 38.3% |
Each bench is one short task in a new session. In longer sessions, each later turn reads the whole conversation again from the cache, and the images of the files that the agent read cost about half the tokens of their text.
The tasks run on a frozen copy of the DensePack scripts. The suite is in plugin/evals/. BENCHMARKS.md has the command that runs the suite, the price and the turns of each run, and the tasks where DensePack gives no saving.
| File | Text tokens | Image tokens | Saving | Passes |
|---|---|---|---|---|
| Markdown prose, 115 lines | 1,855 | 886 | 52% | 100 of 100 |
| Python script, 116 lines | 1,859 | 834 | 55% | 73 of 100 |
| HTML email template, 25 lines | 2,360 | 1,150 | 51% | 63 of 100 |
| GDScript game code, 222 lines, tabs | 2,790 | 1,430 | 49% | 65 of 100 |
Most failed runs have a wrong count of spaces or tabs. BENCHMARKS.md lists the errors.
| Part | What it does | Who it is for | Where to start |
|---|---|---|---|
| Plugin | The plugin packs the files that the agent Reads, Bash output, Word files, CLAUDE.md and MEMORY.md, and the briefs and reports of subagents inside Claude Code with no extra step.Two commands install the plugin. | People who use Claude Code | Install the plugin |
| Right-click tool | The right-click tool packs a file from your file manager or your shell on Windows, Linux and macOS. On Windows only, it also packs selected text with a hotkey or with the Ctrl+Right-click menu in each application. The Windows and Linux installers add Pillow, freetype-py and NumPy to your own Python | People who use an AI chat | INSTALL.md and tools/Tool-README.md |
| HTML app | The HTML app runs in your browser. You paste text, and the image updates while you type. You can download or copy the image. | People who want one image without an install | Use the HTML app and index.html |
tools/Tool-README.md lists the changes that the right-click tool makes, how to install it without the hotkeys and how to remove it.
INSTALL.md has the steps for Windows, macOS and Linux.
/plugin marketplace add Fabian-Galvez/DensePack
/plugin install densepack@densepack-marketplace
| System | Python | Pillow, freetype-py and NumPy |
|---|---|---|
| Windows | winget installs Python 3.13 for your account. It needs no admin rights | pip puts them in the data folder of the plugin |
| macOS | The plugin installs nothing and prints the brew command and the uv command for you to run | pip puts them in the data folder of the plugin |
| Linux | The plugin installs nothing and prints the apt, dnf or pacman command for you to run | pip puts them in the data folder of the plugin |
On Windows, the plugin tries the Python install one time. Restart Claude Code after the Python install.
Use these steps to update DensePack.
claude plugin marketplace update densepack-marketplace in a terminal.claude plugin update densepack@densepack-marketplace.To remove DensePack, follow Remove DensePack in INSTALL.md.
| Command | What it does |
|---|---|
/densepack | It starts DensePack and sets each setting to its default |
/dense-off | It stops all DensePack hooks in this session only. New sessions start with DensePack on |
/maxpack | It sends images to Sonnet and is the default |
/max-off | It sends text to Sonnet |
/helppack | It prints all commands |
/dense-remove | It restores the original text of each converted CLAUDE.md, .claude/CLAUDE.md, CLAUDE.local.md and MEMORY.md and removes CLAUDE_CODE_THRIFTY_SONIC when its value is still 0. It also deletes the trust entry of the marketplace folder in ~/.claude.json and the DensePack files that /plugin uninstall does not delete, except the files that Remove DensePack lists as kept. Run it before the uninstall |
/mdpack <folder> | It packs the CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md of that folder into images and puts a pointer in their place, and the agent does not read these files. Run it from a folder next to that folder, and then open a new session in that folder. The new session reads the images and never the text |
| Coming soon | |
/dashpack | It shows the saving of each conversation while the conversation runs. It calculates the text price of each image that the agents read and of each later turn that reads the image again |
DensePack saves the most in long conversations that read many files, for example an audit of a repository.
INSTALL.md has the numbered steps for a repository with a CLAUDE.md, for an audit and for each session.
/dense-remove undoes the changes to your files and deletes the DensePack folders of the projects that the transcripts in ~/.claude/projects name, except .claude/tmp/ and the files that Remove DensePack lists as kept./plugin uninstall deletes the packages.| What it changes | What DensePack does |
|---|---|
CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md in a project, your ~/.claude/CLAUDE.md and the MEMORY.md of the project | DensePack copies each one to <name>.densepack.bak, packs the text into images and puts a short pointer in the file. Files stay text unless their images and pointer cost less than their text |
~/.claude/settings.json | DensePack adds "CLAUDE_CODE_THRIFTY_SONIC": "0" one time when the key is not there. From the next session on, Claude Code auto mode no longer tells the agent to read files with Bash. DensePack shows a note on screen about this change |
.gitignore files in .claude/tmp/ and .claude/densepack-vault/ | DensePack writes one line, *, and Git then does not commit those folders |
.claude/tmp/ and .claude/densepack-vault/ in each project | DensePack creates these folders. .claude/tmp/ holds the settings and the working files. The vault holds the images, their text copies and one folder for each conversation. At session start, DensePack deletes working files and images older than 24 hours. DensePack deletes the oldest conversation folders when those folders pass the default limit of 200 MB |
~/.claude/densepack-state | DensePack creates this folder. The folder holds the path of the Python that DensePack found, the key that seals the image records, the list of converted instruction files and the images of your ~/.claude/CLAUDE.md and MEMORY.md |
| Pillow, freetype-py and NumPy | DensePack installs them into the data folder of the plugin and does not change your own Python |
HOW-IT-WORKS.md has the full table and the rules to read, edit and share a converted file. PLUGIN-FOLDERS-FILES.md lists each folder and working file.
DensePack has four parts.
| Part | What happens |
|---|---|
| The swap | The agent calls Read, and the Read runs on the real file. Then read_image.py packs the file into an image and puts the image in the result in place of the text, and the model receives the image.Bash output of 400 characters or more goes through the same steps. Bash results return one image. When the output needs more than one image, the result holds the first image and a note that names the others. DensePack puts lines that a model can misread beside the image as exact text, for example random IDs that mix capital and small letters and hold a capital I or a small l. DensePack keeps the exact text of each packed output in .claude/densepack-vault/images/ |
| The packing | DensePack packs files, Bash output, briefs for subagents and reports from subagents, but only when the plugin calculates that the images cost less than the text. DensePack packs briefs only when they have 1,000 characters or more. Agents still write their briefs and reports as text, and DensePack replaces that text with images that the receiving agent opens with one Read. HOW-IT-WORKS.md explains each step |
| The image | One function, pack_code(), packs the text into each image. In the image, a green number starts each line, a red number gives a count of spaces and a \t box gives a count of tabs. In files with tab indents, the band color shows the tab count |
| Exact lines | When an Edit fails after the agent copied its text from an image, a Read of 20 lines or fewer gives the exact lines as text, and the agent sends the Edit again |
/maxpack is on, which is the default./max-off.cat, of the text file of a packed report or brief.HOW-IT-WORKS.md explains the four parts, the seven slash commands, the hooks and each script.
.doc and .docx files into images before the agent reads them, because the Read tool of Claude Code cannot open Word files.DensePack also writes the text of each Word file beside its images.
file=..claude/densepack-vault/images/. DensePack names the text copy after the working copy in .claude/tmp, for example .claude-tmp-densepack_word_8d36c710126a.docx.txt beside .claude-tmp-densepack_word_8d36c710126a.docx.txt-image-1-of-3-DensePack.png..claude/densepack-vault/to-pack/ get text copies with their own names, for example report.docx.txt beside report.docx.txt-image-1-of-3-DensePack.png in to-pack/packed/..docx files are ZIP files of XML, and .doc files are OLE2 containers. DensePack reads the two formats with the Python standard library and does not need Word.
.docx, unzip it, edit word/document.xml and zip it again.HOW-IT-WORKS.md has the format table, the three ways that DensePack packs a Word file automatically and the three steps that keep the scan fast.
| Text size | Old renderer | New renderer |
|---|---|---|
| 11 KB | 3.2 s, 528 MB, 16 processes | 0.9 s, 55 MB, 1 process |
| 21 KB | 5.4 s, 630 MB, 15 processes | 1.8 s, 76 MB, 1 process |
| 228 KB | 29.6 s, 3.3 GB, 16 processes | 8.2 s, 243 MB, 1 process |
.doc and .docx files in four cases. See Word files.
.claude/densepack-vault/to-pack/.claude -p sessions with no tool call, one with DensePack off and one with DensePack on./max-off for work that must copy text exactly. BENCHMARKS.md has the results.
The DensePack plugin renders each character with FreeType and the Inter font family. These two projects gave DensePack a good font from the first day. Thank you both.
Fonts for AI models to read are a later project.
| File | Contents |
|---|---|
| README.md | What DensePack is, what it saves and how to install the plugin |
| HOW-IT-WORKS.md | The swap, the packing, the image, the Edit check, Word files, the commands, the hooks and the scripts |
| INSTALL.md | The install steps for Windows, macOS and Linux, the right-click tool, the HTML app and the removal steps |
| BENCHMARKS.md | The benches, the prices and how Anthropic bills |
| PLUGIN-FOLDERS-FILES.md | The folders and working files that the plugin writes and the purpose of each one |
| tools/Tool-README.md | The right-click tool, its install, its use and the files it puts on your computer |
| PRIVACY-POLICY.md | The privacy policy. DensePack sends no data to an external service and uses the network only to install what it needs |
| THIRD-PARTY-NOTICES.md | The font and the libraries that this project uses, with their licenses |
| LICENSE | The MIT license |
8 followers · starred Sep 2026
Python
89.4%
HTML
6.6%
PowerShell
2.0%
Shell
1.7%
Packs text files into small images that an AI model reads for about half the input tokens. Includes a Claude Code plugin, a right-click tool and an HTML app.
See the code
DensePack packs text into the smallest image that Fable, Opus and Sonnet models can read. The image uses about half the input tokens of the text.
Anthropic's claude plugin eval ran three coding tasks on Opus 5.5. DensePack saved 31.8% to 38.3% of the price on average, and all runs passed their checks.
Turns are calls to the model that send the entire conversation that has been written to cache at cache read price.
The DensePack plugin and the right-click tool render their images with FreeType and run on Windows, Linux and macOS. The tests ran on Windows and Linux.
Anthropic's claude plugin eval ran three tasks on Opus 5.5, 5 times with DensePack and 5 times without it. Each run with DensePack cost less than its paired run without DensePack and passed all checks.
| Task | What the agent does | Mean saving |
|---|---|---|
| Code trace | The agent traces how a Read becomes an image through about 20,000 lines of code | 32.6% |
| Architecture doc | The agent reads 14 hook scripts, about 8,700 lines, and outputs ARCHITECTURE.md | 31.8% |
| Five files read whole | The agent reads five scripts whole, 5,586 lines, and writes a 5-line summary | 38.3% |
Each bench is one short task in a new session. In longer sessions, each later turn reads the whole conversation again from the cache, and the images of the files that the agent read cost about half the tokens of their text.
The tasks run on a frozen copy of the DensePack scripts. The suite is in plugin/evals/. BENCHMARKS.md has the command that runs the suite, the price and the turns of each run, and the tasks where DensePack gives no saving.
| File | Text tokens | Image tokens | Saving | Passes |
|---|---|---|---|---|
| Markdown prose, 115 lines | 1,855 | 886 | 52% | 100 of 100 |
| Python script, 116 lines | 1,859 | 834 | 55% | 73 of 100 |
| HTML email template, 25 lines | 2,360 | 1,150 | 51% | 63 of 100 |
| GDScript game code, 222 lines, tabs | 2,790 | 1,430 | 49% | 65 of 100 |
Most failed runs have a wrong count of spaces or tabs. BENCHMARKS.md lists the errors.
| Part | What it does | Who it is for | Where to start |
|---|---|---|---|
| Plugin | The plugin packs the files that the agent Reads, Bash output, Word files, CLAUDE.md and MEMORY.md, and the briefs and reports of subagents inside Claude Code with no extra step.Two commands install the plugin. | People who use Claude Code | Install the plugin |
| Right-click tool | The right-click tool packs a file from your file manager or your shell on Windows, Linux and macOS. On Windows only, it also packs selected text with a hotkey or with the Ctrl+Right-click menu in each application. The Windows and Linux installers add Pillow, freetype-py and NumPy to your own Python | People who use an AI chat | INSTALL.md and tools/Tool-README.md |
| HTML app | The HTML app runs in your browser. You paste text, and the image updates while you type. You can download or copy the image. | People who want one image without an install | Use the HTML app and index.html |
tools/Tool-README.md lists the changes that the right-click tool makes, how to install it without the hotkeys and how to remove it.
INSTALL.md has the steps for Windows, macOS and Linux.
/plugin marketplace add Fabian-Galvez/DensePack
/plugin install densepack@densepack-marketplace
| System | Python | Pillow, freetype-py and NumPy |
|---|---|---|
| Windows | winget installs Python 3.13 for your account. It needs no admin rights | pip puts them in the data folder of the plugin |
| macOS | The plugin installs nothing and prints the brew command and the uv command for you to run | pip puts them in the data folder of the plugin |
| Linux | The plugin installs nothing and prints the apt, dnf or pacman command for you to run | pip puts them in the data folder of the plugin |
On Windows, the plugin tries the Python install one time. Restart Claude Code after the Python install.
Use these steps to update DensePack.
claude plugin marketplace update densepack-marketplace in a terminal.claude plugin update densepack@densepack-marketplace.To remove DensePack, follow Remove DensePack in INSTALL.md.
| Command | What it does |
|---|---|
/densepack | It starts DensePack and sets each setting to its default |
/dense-off | It stops all DensePack hooks in this session only. New sessions start with DensePack on |
/maxpack | It sends images to Sonnet and is the default |
/max-off | It sends text to Sonnet |
/helppack | It prints all commands |
/dense-remove | It restores the original text of each converted CLAUDE.md, .claude/CLAUDE.md, CLAUDE.local.md and MEMORY.md and removes CLAUDE_CODE_THRIFTY_SONIC when its value is still 0. It also deletes the trust entry of the marketplace folder in ~/.claude.json and the DensePack files that /plugin uninstall does not delete, except the files that Remove DensePack lists as kept. Run it before the uninstall |
/mdpack <folder> | It packs the CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md of that folder into images and puts a pointer in their place, and the agent does not read these files. Run it from a folder next to that folder, and then open a new session in that folder. The new session reads the images and never the text |
| Coming soon | |
/dashpack | It shows the saving of each conversation while the conversation runs. It calculates the text price of each image that the agents read and of each later turn that reads the image again |
DensePack saves the most in long conversations that read many files, for example an audit of a repository.
INSTALL.md has the numbered steps for a repository with a CLAUDE.md, for an audit and for each session.
/dense-remove undoes the changes to your files and deletes the DensePack folders of the projects that the transcripts in ~/.claude/projects name, except .claude/tmp/ and the files that Remove DensePack lists as kept./plugin uninstall deletes the packages.| What it changes | What DensePack does |
|---|---|
CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md in a project, your ~/.claude/CLAUDE.md and the MEMORY.md of the project | DensePack copies each one to <name>.densepack.bak, packs the text into images and puts a short pointer in the file. Files stay text unless their images and pointer cost less than their text |
~/.claude/settings.json | DensePack adds "CLAUDE_CODE_THRIFTY_SONIC": "0" one time when the key is not there. From the next session on, Claude Code auto mode no longer tells the agent to read files with Bash. DensePack shows a note on screen about this change |
.gitignore files in .claude/tmp/ and .claude/densepack-vault/ | DensePack writes one line, *, and Git then does not commit those folders |
.claude/tmp/ and .claude/densepack-vault/ in each project | DensePack creates these folders. .claude/tmp/ holds the settings and the working files. The vault holds the images, their text copies and one folder for each conversation. At session start, DensePack deletes working files and images older than 24 hours. DensePack deletes the oldest conversation folders when those folders pass the default limit of 200 MB |
~/.claude/densepack-state | DensePack creates this folder. The folder holds the path of the Python that DensePack found, the key that seals the image records, the list of converted instruction files and the images of your ~/.claude/CLAUDE.md and MEMORY.md |
| Pillow, freetype-py and NumPy | DensePack installs them into the data folder of the plugin and does not change your own Python |
HOW-IT-WORKS.md has the full table and the rules to read, edit and share a converted file. PLUGIN-FOLDERS-FILES.md lists each folder and working file.
DensePack has four parts.
| Part | What happens |
|---|---|
| The swap | The agent calls Read, and the Read runs on the real file. Then read_image.py packs the file into an image and puts the image in the result in place of the text, and the model receives the image.Bash output of 400 characters or more goes through the same steps. Bash results return one image. When the output needs more than one image, the result holds the first image and a note that names the others. DensePack puts lines that a model can misread beside the image as exact text, for example random IDs that mix capital and small letters and hold a capital I or a small l. DensePack keeps the exact text of each packed output in .claude/densepack-vault/images/ |
| The packing | DensePack packs files, Bash output, briefs for subagents and reports from subagents, but only when the plugin calculates that the images cost less than the text. DensePack packs briefs only when they have 1,000 characters or more. Agents still write their briefs and reports as text, and DensePack replaces that text with images that the receiving agent opens with one Read. HOW-IT-WORKS.md explains each step |
| The image | One function, pack_code(), packs the text into each image. In the image, a green number starts each line, a red number gives a count of spaces and a \t box gives a count of tabs. In files with tab indents, the band color shows the tab count |
| Exact lines | When an Edit fails after the agent copied its text from an image, a Read of 20 lines or fewer gives the exact lines as text, and the agent sends the Edit again |
/maxpack is on, which is the default./max-off.cat, of the text file of a packed report or brief.HOW-IT-WORKS.md explains the four parts, the seven slash commands, the hooks and each script.
.doc and .docx files into images before the agent reads them, because the Read tool of Claude Code cannot open Word files.DensePack also writes the text of each Word file beside its images.
file=..claude/densepack-vault/images/. DensePack names the text copy after the working copy in .claude/tmp, for example .claude-tmp-densepack_word_8d36c710126a.docx.txt beside .claude-tmp-densepack_word_8d36c710126a.docx.txt-image-1-of-3-DensePack.png..claude/densepack-vault/to-pack/ get text copies with their own names, for example report.docx.txt beside report.docx.txt-image-1-of-3-DensePack.png in to-pack/packed/..docx files are ZIP files of XML, and .doc files are OLE2 containers. DensePack reads the two formats with the Python standard library and does not need Word.
.docx, unzip it, edit word/document.xml and zip it again.HOW-IT-WORKS.md has the format table, the three ways that DensePack packs a Word file automatically and the three steps that keep the scan fast.
| Text size | Old renderer | New renderer |
|---|---|---|
| 11 KB | 3.2 s, 528 MB, 16 processes | 0.9 s, 55 MB, 1 process |
| 21 KB | 5.4 s, 630 MB, 15 processes | 1.8 s, 76 MB, 1 process |
| 228 KB | 29.6 s, 3.3 GB, 16 processes | 8.2 s, 243 MB, 1 process |
.doc and .docx files in four cases. See Word files.
.claude/densepack-vault/to-pack/.claude -p sessions with no tool call, one with DensePack off and one with DensePack on./max-off for work that must copy text exactly. BENCHMARKS.md has the results.
The DensePack plugin renders each character with FreeType and the Inter font family. These two projects gave DensePack a good font from the first day. Thank you both.
Fonts for AI models to read are a later project.
| File | Contents |
|---|---|
| README.md | What DensePack is, what it saves and how to install the plugin |
| HOW-IT-WORKS.md | The swap, the packing, the image, the Edit check, Word files, the commands, the hooks and the scripts |
| INSTALL.md | The install steps for Windows, macOS and Linux, the right-click tool, the HTML app and the removal steps |
| BENCHMARKS.md | The benches, the prices and how Anthropic bills |
| PLUGIN-FOLDERS-FILES.md | The folders and working files that the plugin writes and the purpose of each one |
| tools/Tool-README.md | The right-click tool, its install, its use and the files it puts on your computer |
| PRIVACY-POLICY.md | The privacy policy. DensePack sends no data to an external service and uses the network only to install what it needs |
| THIRD-PARTY-NOTICES.md | The font and the libraries that this project uses, with their licenses |
| LICENSE | The MIT license |
8 followers · starred Sep 2026
Python
89.4%
HTML
6.6%
PowerShell
2.0%
Shell
1.7%