A proxy that turns your prompt into a PNG to cut token costs
An image sent to a language model costs a fixed number of tokens based on its pixel size, no matter how much text is crammed inside it. pxpipe takes that quirk and builds a money-saving trick on top of it. It is a local proxy that sits between your tool and Claude, and it renders the bulky parts of a request, system prompts, tool documentation, older chat history, into PNG images before forwarding them. The model then reads the picture instead of the raw text.
The math is the whole argument. Plain text runs at roughly one character per token, while an image packs about 3.1 characters per vision token. A single 1928 by 1928 PNG costs around 4,761 tokens but can hold up to 92,000 characters, which would otherwise be about 48,000 text tokens. Text only wins when it is denser than roughly 19 characters per token, and typical Claude Code transcripts sit near 1.91. On real workloads the author reports a 59 to 70 percent drop in end-to-end cost, and on SWE-bench Lite it solved all ten sampled tasks with 65 percent fewer tokens per request. Recent turns stay as text, and prompt caching still works.
The catch is that imaging is lossy. Exact values like hex strings, IDs, and long numbers came back correct 13 times out of 15 on Fable 5, but zero out of 15 on Opus, and the model tends to confabulate quietly rather than flag the miss. That is why pxpipe compresses only Fable 5 by default and keeps the freshest turns in plain text.
Why it matters
If you run agents over large codebases and watch the bill climb, this is a concrete lever you can pull today without changing your model or your prompts. But test it on data with exact identifiers before trusting it, because a silently misread hash in a diff is worse than a slightly larger token count.