Local proxy · visual context compression · Claude Code
ultronpx intercepts Claude Code traffic to the Anthropic API and converts dense blocks — large tool results, old history, the system slab — into PNG images. Vision tokens are priced per pixel, not per character: ~3× cheaper on converted blocks, with exact identifiers protected and fail-open guaranteed. Open source, MIT.
You point ANTHROPIC_BASE_URL at 127.0.0.1:47821 and use Claude Code as usual. ultronpx decides, request by request, what is worth rendering as an image — and audits every cent saved.
Vision tokens are priced by the image's pixel dimensions, not by how much text is inside. Dense text runs at ~1.9 chars/token; rendered as a PNG, it reaches ~19 chars/vision-token. ultronpx applies this where it weighs the most: large tool results, old history, the system slab.
Nothing changes in your workflow: Claude Code stays the same, just talking to the local proxy. Any internal error degrades to byte-identical passthrough — ultronpx's worst case is the behavior you already had without it.
A complete rewrite of the concept from pxpipe, by teamchong — with attribution to the original. What the rewrite adds: Verbatim Guard, an adaptive gate, auditable savings and local-first. Includes an importer for pxpipe users.
Compressing context is easy; compressing without corrupting a SHA, leaking a secret or blocking your flow is the real problem. Every piece below exists for that — and all of it ships in v1.0 on npm.
~/.ultronpx/events.jsonl: what was converted, what it cost, what it would have cost.ultronpx stats summarizes it in the terminal.~/.ultronpx/config.toml and shows the activation steps.127.0.0.1:47821.Request comes in → Verbatim Guard splits out the untouchable → the gate decides if it pays off → render (or passthrough) → savings recorded. All on 127.0.0.1.
ultronpx sits between Claude Code and Anthropic — a position that demands explicit guarantees, not promises.
API key is never persisted
The key lives only in the client environment. The proxy forwards the header to api.anthropic.com and never writes it to config, logs, telemetry events or pixels.
Secrets pin the block as text
If the Verbatim Guard detects a secret in a block, the whole block is excluded from rendering — credentials never become an image, not even by accident.
Byte-exact identifiers
SHAs, UUIDs, IPs and stack traces go to a textual sidecar before rendering. Claude cites the exact commit — not an approximate visual reading of it.
Fail-open, always
Any internal error degrades to byte-identical passthrough. The proxy never blocks your flow or corrupts a payload — the worst case is the behavior without ultronpx.
Local-first, zero analytics
Listens on 127.0.0.1:47821; the only network destination is api.anthropic.com — the same as Claude Code without a proxy. Not a single telemetry byte leaves your machine.
Open, auditable code
MIT on npm: you can read exactly what passes through the proxy. Every modified request leaves a trail in ~/.ultronpx/events.jsonl.
Requires Node.js ≥ 22. Install globally via npm (or run with npx without installing), validate the environment with doctor and that's it — Claude Code won't even notice there's a proxy in the path.
Four commands and one environment variable. From there, use Claude Code as usual.
npx ultronpx <cmd> without installing.# Node.js ≥ 22 npm install -g ultronpx
init creates ~/.ultronpx/config.toml; doctor checks port, env, key, connectivity and render fonts.ultronpx init ultronpx doctor
127.0.0.1:47821; Claude Code starts talking to it.ultronpx start
export ANTHROPIC_BASE_URL=http://127.0.0.1:47821Every modified request records real and counterfactual cost — measured via count_tokens, not estimated.
ultronpx stats # accumulated savings per period, # converted blocks, conversion rate
~/.ultronpx/events.jsonl
# every modified request, auditableStill unsure about something? Write to bruno@b2tech.io.
api.anthropic.com and never writes the key to config, logs, telemetry events or pixels. Blocks with detected secrets are pinned as text — credentials never become an image.127.0.0.1:47821 and the only network destination is api.anthropic.com — the same as Claude Code without a proxy. Zero remote analytics: savings telemetry stays in ~/.ultronpx/events.jsonl, on your machine.count_tokens, fail-open always and local-first. There is an importer for anyone coming from pxpipe.npm install -g ultronpx (or use npx ultronpx without installing), run ultronpx init and ultronpx doctor — doctor validates port, environment variables, key, connectivity and render fonts before you point ANTHROPIC_BASE_URL at the proxy. Want to master Claude Code end to end? Check out the Claude Code Architect training (in Portuguese).One npm install, four commands and one environment variable. From the next request on, dense blocks become PNGs when it pays off — with identifiers intact, fail-open guaranteed and every cent audited in events.jsonl.
npm i -g ultronpx · Node ≥ 22 · MIT · local-first