Open-source project
teamchong/pxpipe avatar
teamchong/pxpipe

pxpipe: cuts Claude Code tokens by sending screenshots of your own context

cut Fable 5 token usage by rendering text context as images. The reader is the same vision channel that Anthropic's computer use already relies on for screenshots.

7,772 stars665 forksTypeScriptMIT

At a glance

What is it?
pxpipe is a local proxy that rewrites the bulky parts of a Claude Code request into compact PNG pages before the request leaves your machine, on the reasoning that an image's token cost follows its pixel dimensions rather than its text. It also ships a section titled the honest part, which quantifies where the trick fails: exact hex strings came back 0/15 to 6/15 on later Claude releases, against 13/15 on the original Fable 5.
Who is it for?
Adopt it for token-dense work, where the density math is on your side and a human reviews the output, and set `PXPIPE_MODELS` deliberately rather than taking the defaults. Do not enable it for a session where exact identifiers matter, because the failures are silent, and do not trust its savings figures without reading the caching note, since the win depends on how much your client re-sends as uncached text.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • teamchong/pxpipe7,772 ★ · +983
Star history
Repository2026-07-282026-11-14
teamchong/pxpipe6.8k7.8k

983 Stars in the last 109 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

It is lossy, and the project measures exactly how

The page has a section called the honest part, and it leads with the failure mode rather than the win. On exact 12-character hex strings in dense imaged content, the numbers were 13/15 on the original Fable 5 and 0/15 to 6/15 on later Claude releases such as claude-opus-5-5, while Gemini 4 (gemini-4-argon) scored 15/15. That distinction matters more than the numbers: an error would stop a run, a confabulation produces a wrong identifier that looks right. The guidance follows from it. Byte-exact values, which the page names as IDs, hashes and secrets, must stay text, and recent turns do stay text. So the honest summary is that this tool trades fidelity for cost in a way you have to route around, and the routing is the reader's job.

Only closed tool-call rounds get imaged, so a live session keeps more text

What gets compressed is narrower than the marketing sentence suggests, and the documentation is precise about it. Responses stream normally, since pxpipe compresses the request only and never the model's output. Within a request, recent turns stay text while the system prompt, tool documentation and older bulk history are imaged. History compression recognises completed function call and function output pairs, including the parallel calls-then-outputs rounds that some agents produce, and only old closed rounds are imaged atomically, while every open call passes through. The consequence for behaviour is that a session in the middle of a long tool chain keeps more of its recent context as text, so the savings grow as a session ages rather than being uniform from the first prompt.

A profitability gate images only where the density math wins

The economics are stated in characters per token, and they are not favourable everywhere. The tool wins on token-dense content at roughly one character per text token, and it loses money on sparse prose at roughly 3.5 characters per token, because prose wastes pixels. Rather than imaging everything, pxpipe applies a profitability gate that images only where the arithmetic works, and that gate is calibrated on 391 production rows. The wider claim is the headline figure, a 59 to 70 percent lower end to end bill on the original June 2026 claude-fable-5 runs. So the durable number is not the percentage but the token cut, measured per request against a free token counting counterfactual recorded in `~/.pxpipe/events.jsonl`. Two more dependencies are named: savings track the uncached bulk your client still re-sends as text, which is why the same tool lands around 60 to 70 percent on Claude Code's messages endpoint, and the details are in the caching and savings document rather than on this page.

PXPIPE_MODELS is an allowlist, and off means byte-identical

Model support is a configuration decision with a conservative default. The README's tier table marks Gemini 4 (gemini-4-argon, gemini-4*) as on by default, and the dashboard shows live model chips. Opus 5, Sol, GPT 5.5 and Grok are opt-in only. One detail that saves a debugging session: sibling variants do not inherit, so an identifier like a GPT 5.6 variant does not pick up Sol's allowlist or render profile. Setting the variable to off disables imaging entirely and everything else passes through byte-identical. The render profile also differs per model, with the Opus variant using a 5 by 8 layout with two pixels of extra row height, about 25 percent more image tokens than Fable's layout and still around 50 percent live savings, with weak exact hex recall at 3 out of 15.

Two entry points, and one of them exists to keep the client's gates working

The thirty second start is two commands:

bash
npx pxpipe-proxy                                  # proxy on 127.0.0.1:47821
pxpipe warp -- omp                                # omp / OpenCode / Claude Code (pxpipe warp -- claude)

The second entry point is the warp wrapper:

bash
pxpipe warp -- claude          # also: cursor-agent, codex, or a shell alias

It does the same job without `ANTHROPIC_BASE_URL`, and the stated reason is that slash remote-control, claude.ai connectors and first-party gates keep working. Built-in default routes cover the Anthropic messages endpoint and Google's Antigravity and Gemini endpoints, and an agent reaching its provider over some other base URL needs an explicit rule, where a rule that names a port matches only that port:

bash
pxpipe warp --route '127.0.0.1:9090/v1/*=http://127.0.0.1:47821' -- codex

The dashboard at the proxy address shows tokens saved, every text to image conversion side by side, a kill switch and live model chips.

Export renders pages without a proxy or an account

The third mode needs neither a running proxy nor a connection to Claude Code, which makes it the safe way to try the idea:

bash
npx pxpipe-proxy export src/
cat prompt.txt | npx pxpipe-proxy export --stdin
npx pxpipe-proxy export --git

You can render text, a directory or a diff to PNG pages, and each run writes a fresh `pxpipe-export-XXXXXX/` folder, with the exact path printed when the command finishes. The folder holds page PNG files, a factsheet, a manifest and a prompt file, and the intended use is to upload the pages into an image upload client such as Cursor when you want dense visual context without a proxy. If the package is installed globally you would use `pxpipe export` rather than the npx form. The consequence is that pxpipe is usable in two quite different ways, as a transparent request proxy or as a manual page generator.

The container drops all capabilities, runs as a user and healthchecks its own port

The deployment files are conservative in a way that is worth copying. The compose file sets restart unless-stopped, init, a read only root filesystem, drops all capabilities and sets no-new-privileges, and it publishes one port bound to loopback with the proxy port defaulting through an environment variable. A single named volume holds the data directory that the container uses for its config and its event log. The image is a two stage build on a node alpine base pinned by digest, with the runtime stage copying only the built entry point, the project licence and the licence files of the vendored assets, running as a non-root user, exposing one port, and carrying a health check that opens a TCP connection to its own port every five seconds. The manifest is careful in the same spirit, shipping a security model document inside the package, running type checking, tests and a build before publishing, and carrying an audit script limited to production dependencies at the high level. A wrangler config and a deploy script point at a Cloudflare Workers deployment for running it on Cloudflare Workers instead of Node.

Editorial conclusion

Adopt it for token-dense work, where the density math is on your side and a human reviews the output, and set `PXPIPE_MODELS` deliberately rather than taking the defaults. Do not enable it for a session where exact identifiers matter, because the failures are silent, and do not trust its savings figures without reading the caching note, since the win depends on how much your client re-sends as uncached text. Before you rely on it, run it on work you can check line for line.

Frequently asked questions

What is pxpipe used for?

pxpipe is a local proxy that rewrites the bulky parts of each Claude Code request into compact PNG pages before the request leaves your machine. An image's token cost is fixed by its pixel dimensions, so dense content such as code, JSON and tool output packs about 3.1 characters per image token against roughly 1 character per text token, and the reader is the same vision channel that Anthropic's computer use relies on for screenshots.

Is pxpipe lossy?

Yes, and the project quantifies it. Exact 12-character hex strings in dense imaged content came back 13/15 on the original Fable 5 and 0/15 to 6/15 on later Claude releases, and the misses are silent confabulations rather than errors. Byte-exact values such as IDs, hashes and secrets must stay text, recent turns do, and a dedicated verbatim-risk guard is not built yet. The escape hatch is to route byte-exact work to subagents on non-allowlisted models.

How do I run pxpipe?

Start the proxy with npx pxpipe-proxy, which listens on 127.0.0.1:47821, then run `pxpipe warp -- claude`, which needs no base-URL override and also works with agy, omp, opencode, cursor-agent or codex. The dashboard at http://127.0.0.1:47821/ shows tokens saved, every conversion side by side, a kill switch and live model chips.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/teamchong-pxpipe.svg)](https://hysenlabs.com/projects/teamchong-pxpipe)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/teamchong-pxpipe.svg)](https://hysenlabs.com/projects/teamchong-pxpipe)

Was this useful?