pxpipe: Cut Claude Code Token Usage 60% by Rendering Context as Images

pxpipe is a local proxy that exploits a pricing gap: AI models charge for images by pixel dimensions, not by embedded text density. For bulky context like system prompts, tool docs, and history, this means ~3.1 characters per image token vs ~1 char per text token on real Claude Code traffic. The result is a ~59–70% cost cut (list prices) and a ~72–74% cut on compressed requests, with the primary metric being input-token reduction — e.g., ~25k text tokens rendered as ~2.7k image tokens.
How it Works
pxpipe runs as a local proxy intercepting requests from Claude Code/Gateway. It rewrites the bulky parts (system prompt, tool documentation, older history) into compact PNG images before the request leaves your machine. The proxy also includes an OCR instruction banner co-rendered on top so the model can read the text reliably. Fable 5 achieves 100/100 read accuracy on a clean eval. Opus 4.8 struggles with dense image content (exact values should remain text).
Getting Started
npx pxpipe-proxy
# proxy on 127.0.0.1:47821
ANTHROPIC_BASE_URL=http://localhost:47821 claude
Open http://127.0.0.1:47821/ for a live dashboard showing tokens saved, per-session stats, and every text→image conversion side by side.
Key Results
- Token reduction: Dense content compresses ~10x (25k text → 2.7k image tokens)
- Cost savings: 59–70% lower bill on typical Claude Code traffic, 72–74% on compressed requests
- Accuracy: Fable 5 model reads images at 100/100 on clean eval; Opus 4.8 is lossy for exact values
- Demo comparison: Session totals: plain $42.21 (context 96% full) vs pxpipe $6.06 (context 7.4% full)
Limitations
Spare or small requests won't benefit. Opus 4.8 cannot reliably read exact values from images (e.g., phrase counts). Single-reply format compliance has minor rough edges (one follow-up nudges may be needed).
Who It's For
Developers using Claude Code with large system prompts, extensive tool docs, or long conversation histories — especially in Fable 5 environments.
📖 Read the full source: HN AI Agents
👀 See Also

Spore Agent Arena: Competitive AI Agent Testing Platform Seeks Trial Participants
Spore Agent's Arena feature allows AI agents to compete in 36 different game types including code debugging, math puzzles, and system design challenges. The platform currently has 42 challenges running, 15 agents registered, and offers Cog tokens as rewards.

How I Built a Skill to Deploy OpenClaw Agents to Web Apps - A Behind-the-Scenes Look
Explore an innovative new skill developed for OpenClaw agents that facilitates easy deployment to web apps. Learn about its features, advantages, and how it transforms production processes.

Maestro v1.5.0 adds Claude Code support for multi-agent orchestration
Maestro v1.5.0, an open-source multi-agent orchestration platform, now runs as a native plugin on Claude Code in addition to Gemini CLI. The update includes deeper design planning, a 42-step orchestration backbone, agent capability enforcement, and security hardening.

Hypura: Storage-tier-aware LLM inference scheduler for Apple Silicon
Hypura is a Rust-based inference scheduler that places model tensors across GPU, RAM, and NVMe tiers to run models exceeding physical memory on Apple Silicon Macs. It enables running a 31GB Mixtral 8x7B on a 32GB Mac Mini at 2.2 tok/s and a 40GB Llama 70B at 0.3 tok/s where vanilla llama.cpp crashes.