pxpipe reduces Claude Code token costs by rendering context as images
pxpipe is a local proxy that converts bulky text context into PNGs, reducing token usage for models like Claude Fable 5 and Gemini 4.
The teamchong repository introduces pxpipe, a local proxy designed to cut input token usage for coding agents by rendering bulky context as images. By converting system prompts, tool documentation, and history into compact PNGs, the tool can reduce end-to-end bills by 59–70% on original Claude Fable 5 runs. This approach leverages the vision channel used by Anthropic's computer use, packing approximately 3.1 characters per image-token compared to roughly 1 character per text-token.
Model performance on dense pixel reading
Not all vision encoders handle dense 5×8 bitmap glyphs with equal accuracy. Gemini 4 (gemini-4-argon) is the first model to achieve 15/15 on pure-image dense hex and 100/100 on pure-image arithmetic. Gemini 3.6–3.8 Flash models also show high fidelity, scoring 14/15 on hex.
Original Claude Fable 5 scored 13/15 on hex, with SWE-bench Lite results of 10/10 and SWE-bench Pro at 14/19. However, later releases including claude-opus-5-5, claude-sonnet-5-5, and claude-haiku-5-5 regressed sharply, scoring between 0/15 and 3/15 on dense pixel reading. The claude-fable-5-1 and claude-fable-5-2 versions recover to 11/15–14/15 when using +2px row spacing.
Running the proxy and exporting images
The tool operates as a proxy on 127.0.0.1:47821 and compresses only the request, leaving the model's output as text. It supports various CLIs including Antigravity (agy) and Claude Code. Users can launch the proxy and warp their CLI tools using these commands:
npx pxpipe-proxy
pxpipe warp -- agy
pxpipe warp -- ompFor those who do not wish to run a proxy, pxpipe provides an offline export mode to render files or diffs to PNG pages for manual upload to clients like Cursor:
npx pxpipe-proxy export src/
cat prompt.txt | npx pxpipe-proxy export --stdin
npx pxpipe-proxy export --gitToken density and accuracy trade-offs
The system uses a bounded 96-token factsheet to help models disambiguate similar pixels, such as 0 and 8 in Spleen 5×8. Without this factsheet, Gemini 4 scored 28/30 on planted hex IDs in the TokenSave corpus, but the factsheet recovers these to 30/30. This is critical for byte-exact work, as lossy compression can lead to incorrectly read IDs, hashes, or secrets.
The efficiency of the tool depends on the workload. It provides significant gains on token-dense content like JSON or code, but may lose money on sparse prose where text tokens are more efficient than image tokens.
Sources
Related news
- Claude CodeClaude Code cuts token usage by two-thirds after fixing context delivery with InsForgeA single backend change dropped Claude Code from 10.4M to 3.7M tokens, eliminated 10 errors, and cut cost from $9.21 to $2.81 — proving stronger models amplify context gaps instead of closing them.·same source: github.com
- Claude CodeAnthropic Launches Claude Fable 5 and Mythos 5: Frontier Model With Vision BreakthroughAnthropic releases Fable 5 for general use and Mythos 5 for trusted cyberdefenders. Fable 5 beats Pokémon FireRed with vision alone, compresses months of engineering into days, and accelerates drug de·shared tag: Claude Code
Open SourceMinerU converts complex documents to LLM-ready MarkdownOpen-source tool MinerU transforms PDFs, Office docs, and images into Markdown with LaTeX formulas and HTML tables for agentic workflows.·by shared tag
AnthropicUsing Claude Fable 5 as an Advisor and OrchestratorAnthropic reveals two architectural patterns for combining Fable 5 with Sonnet 5 to optimize costs and performance in agentic workloads.·by shared tag
Comments
Weekly digest
The best of vibe coding, AI agents and open source — once a week, no spam.