Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank
No. 380Tools index
Pricing
Open Source
Platform
cli · web
Type
TOOL
Latest release
v0.13.1
Added
Jul 4, 2026

About

pxpipe is a local proxy that reduces Claude Code API costs by converting bulky text context (system prompts, tool docs, chat history) into compact PNG images before sending requests. Since image token costs are fixed by pixel dimensions rather than content density, dense code and JSON compresses at ~3x better efficiency, achieving 59–70% lower end-to-end billing on real workloads.

What it does

It sits between a coding agent and the model provider as a local proxy on the loopback interface. Before a request leaves the machine, it takes the stable bulk, the system prompt, tool schemas and older turns, and draws that text as dense pages of pixels. An image is priced by its pixel area, not by how many characters fit inside, so packing text tightly buys a smaller input bill. Recent turns and dynamic content stay as text, and replies stream back untouched. A local dashboard shows every conversion side by side, the measured token delta, and a switch that turns imaging off live.

Why it's ranked here

The unusual part is the accounting, not the trick. Savings are measured per request against a token-count probe of the original body, both sides priced under the same observed cache state, and rows where imaging lost money are kept rather than floored. The docs state plainly that the method is lossy, that exact twelve character hex strings were read 13 of 15 times on one model and 0 of 15 on another, and that a verbatim-risk guard is not built yet. Mechanism plus published failure modes is rare. Treat the headline percentage as workload dependent, not a rate you inherit.

What's good

The security posture is written down rather than implied. The server binds loopback by default, and dashboard routes stay loopback-only even when an operator widens the bind address. The hosted worker refuses to serve at all when a key override is configured without a shared secret, and compares that secret by digest instead of by string. Inbound bodies are capped at 16 MiB before allocation. Capturing failing request bodies is off unless explicitly enabled. Config writes go to a temporary file and then rename, at owner-only permissions. One runtime dependency, and the publish step is gated on typecheck plus tests.

Tradeoffs

It is lossy by construction and the misses are quiet. A vision model has no per-glyph confidence, so a bad read arrives as a confident wrong answer rather than an error. Byte-exact values have to stay in text; the bounded factsheet preserves up to 96 recognized precision-critical tokens, not every identifier. The gain swings with the workload: dense code and tool output win, sparse prose loses money, and a profitability gate is the only thing standing between you and the bad case. Two model families are enabled by default. Everything else, including several strong readers, is opt-in.

How to use it well

For anyone running a long-lived coding agent against a metered API, where the same system prompt and tool docs are resent every turn. It earns a slot when sessions run long, context is dense, and the bill is real. Send byte-exact work, hashes, identifiers, secrets, to a passthrough model or keep it in the recent text tail. There is an offline mode that renders files or a diff to pages for image-upload clients, with no proxy involved. It does not compress model output, does not add caching of its own, and does nothing for answer quality.

Technical notes+

bin/cli.js is a shim that imports the bundled build of src/node.ts, which accepts only --help and --version, reads a JSON config file that env vars override, and wires a node:http server onto the runtime-agnostic createProxy; src/worker.ts re-exports the same proxy for Cloudflare Workers and adds the SHA-256 comparison of the x-pxpipe-secret header, failing closed with 503 when a key override exists without that secret. src/core/index.ts is the whole public surface: applicability, measurement, the Anthropic transform, OpenAI chat and Responses transforms, proxy, and baseline math. src/warp/index.ts runs the agent behind a CONNECT proxy with a per-child certificate authority, diverting only the Anthropic messages path so client-side first-party gates keep passing, and falling back to an interactive shell when the command word is an alias. src/sessions.ts and src/stats.ts stream the JSONL event log line by line and fold per-session and global totals without loading it. docs/CACHING_AND_SAVINGS.md states the cache-alignment invariant, that no new cache breakpoints are added and the caller's existing one is relocated onto the last image block, plus both baseline formulas; docs/SECURITY_MODEL.md carries a threat and control table with a contributor requirement per row; docs/NOT-OCR.md records the pixels-per-glyph resolution sweep.

Observed

License
MIT
Language
TypeScript, ESM only
Install surface
npm package exposing one binary, runnable through npx without installing
Interfaces
Local HTTP proxy, loopback dashboard, offline export and stats subcommands, and typed library entry points
Runtimes
Node http server and Cloudflare Workers share the same core proxy
Runtime dependencies
One, a tokenizer library; everything else is a dev dependency
Default binding
Loopback address and port 47821; dashboard routes stay loopback-only even if the bind is widened
Request ceiling
16 MiB inbound body limit enforced before allocation, operator-overridable
Test surface
Vitest suite plus typecheck and build gated in the prepublish step
Security documentation
docs/SECURITY_MODEL.md gives assets, trust boundaries, a threat and control table, and out-of-scope risks

Read from README.md, package.json, bin/cli.js, src/core/index.ts, src/node.ts, src/worker.ts, src/warp/index.ts, src/sessions.ts, src/stats.ts, docs/SECURITY_MODEL.md, docs/NOT-OCR.md, docs/CACHING_AND_SAVINGS.md.

What it can do

  • Intercept and rewrite API requests to reduce token costs

    Outgoing Claude Code API requests containing text-heavy payloadsModified API requests with text content replaced by PNG images

  • Convert text context into compact PNG images

    Bulky text content such as system prompts, tool documentation, and chat historyCompact PNG image representations of the original text

  • Compress code and JSON for cheaper API transmission

    Dense code snippets and JSON data in API request contextPNG-encoded content achieving approximately 3x compression efficiency

  • Proxy local API traffic between Claude Code and Anthropic servers

    Claude Code API calls routed through the local proxyForwarded requests with rewritten content to the Claude API endpoint

  • Benchmark token cost savings on real workloads

    Sample or real API request workloadsBenchmark results showing 59–70% billing reduction metrics

  • Display API cost and usage statistics via dashboard

    Intercepted and processed API request dataVisual dashboard showing token usage and cost comparisons

  • Provide programmatic proxy control via library API

    Developer code integrating the pxpipe libraryProgrammatic access to proxy functionality for custom automation

Tags

aiclaudetoken-optimizationcost-reductionproxyllmtypescriptanthropic

Tech Stack

Node.jsDockerTypeScript

Comments (0)

No comments yet

Indexed by a proprietary survey. Corrections welcome.