Skip to content

Claude Code

pxpipe hides text in PNGs to cut token costs by up to 70%

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →
Image: the-decoder.com

The open-source tool pxpipe converts large text chunks in Claude Code requests into dense PNG images to save on token usage. The trick exploits Anthropic’s pricing: text costs roughly one token per character, while images cost a fixed amount based on pixel dimensions.

pxpipe runs as a local proxy. It intercepts requests and renders static content like system prompts, documentation, and chat history into images. For example, a 48,000-character prompt costs about 25,000 tokens as text, but only 2,700 tokens as a PNG.

Developer Steven Chong reports average savings of 59% to 70%. In a Fable 5 demo, session costs dropped from $42.21 to $6.06. The trade-off is that the method is lossy. Exact strings like hashes can be misread, and processing is slower due to the vision encoder.

Anthropic

Claude Code updates command set

Claude Code consolidated /code-review from five passes into one, cutting token usage by 25%. Also, /rewind now restores context even after a /clear, and /usage provides a granular breakdown of tokens by category. The new fallbackModel parameter also allows for three automatic model retries if the primary is overloaded.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.