mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
9fddbeb28a
Token-saving HTTP proxy for Claude Code that renders system prompt + tools as 5pt Menlo monospace images. Achieves 65-73% token reduction with 100% reasoning quality preserved on Opus 4.7. Production state at this commit: - src/proxy.py: 972 lines, battle-tested with 46+ real Claude Code sessions observed (~551k tokens saved, ~$8.27 in stats.json as of commit time) - bin/cli.js: Node wrapper that spawns Python proxy on port 47821 - scripts/gen_atlas.py: generates the bundled Menlo 5pt glyph atlas - scripts/install.js: postinstall — verifies Python + Pillow + httpx - src/zig/: earlier Zig 0.16 renderer (kept for reference, not built) - CLAUDE.md, HANDOFF.md: contributor notes - package.json: npm entry point, version 0.1.0 Known issue (deferred for separate fix): src/proxy.py:125 — `tallest = max(lines_per_col, last_col_lines) if c_needed == 1 else lines_per_col` pads every single-column image to full MAX_EDGE=1568 height regardless of content, wasting image-token budget for small inputs. Tight bounding would improve savings further. This is the rollback point. Any subsequent changes (Rust port, Python fixes, etc.) build on this proven baseline.
33 lines
694 B
JSON
33 lines
694 B
JSON
{
|
|
"name": "claude-image-proxy",
|
|
"version": "0.1.0",
|
|
"description": "Token-saving proxy for Claude Code: renders system prompt + tool definitions as images, achieving 65-73% token savings on Opus 4.7 while preserving 100% reasoning quality.",
|
|
"bin": {
|
|
"claude-image-proxy": "bin/cli.js"
|
|
},
|
|
"scripts": {
|
|
"postinstall": "node scripts/install.js",
|
|
"start": "node bin/cli.js"
|
|
},
|
|
"files": [
|
|
"bin/",
|
|
"src/",
|
|
"scripts/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"keywords": [
|
|
"claude",
|
|
"claude-code",
|
|
"anthropic",
|
|
"proxy",
|
|
"token-optimization",
|
|
"prompt-cache",
|
|
"opus-4-7"
|
|
],
|
|
"engines": {
|
|
"node": ">=16"
|
|
},
|
|
"license": "MIT"
|
|
}
|