Token compression proxy for coding agents. 52.6% fewer tokens, zero code changes. Works with Claude Code, Aider, Cursor, Cline, Windsurf, 🦞 OpenClaw, and any OpenAI-compatible agent.
npx @sliday/tamp
Auto-start on every session:
claude plugin marketplace add sliday/claude-plugins
claude plugin install tamp@slidayAdds /tamp:status and /tamp:config commands.
TAMP_STAGES=minify,toon,strip-lines,whitespace,dedup,diff,prune tamp -ySet provider to http://localhost:7778 → done. Full guide: docs/openclaw-setup.md
Claude Code ──► Tamp (localhost:7778) ──► Anthropic API
Aider/Cursor ──► │ ──► OpenAI API
Gemini CLI ────► │ ──► Google AI API
Auto-detects API format, compresses tool output, forwards upstream. Error results skipped. JSON minified, arrays encoded columnarly, text/code normalized or semantically compressed.
Compression Stages (all enabled by default):
| Stage | What |
|---|---|
minify |
Strip JSON whitespace |
toon |
Columnar array encoding |
strip-lines |
Remove line-number prefixes |
whitespace |
Collapse blank lines |
llmlingua |
Neural text compression |
dedup |
Replace duplicates with refs |
diff |
Replace similar re-reads with diffs |
prune |
Remove low-value metadata |
Opt-in lossy stages: strip-comments, textpress (LLM semantic compression)
# Option A: One-line installer
curl -fsSL https://tamp.dev/setup.sh | bash
# Option B: Manual
npx @sliday/tamp
export ANTHROPIC_BASE_URL=http://localhost:7778Use your agent as normal — Tamp compresses silently.
Run tamp init to create ~/.config/tamp/config. All variables work via env or config file.
| Variable | Default | Description |
|---|---|---|
TAMP_PORT |
7778 |
Listen port |
TAMP_UPSTREAM |
https://api.anthropic.com |
Default upstream |
TAMP_STAGES |
(all default) | Comma-separated stages |
TAMP_MIN_SIZE |
200 |
Min content size (chars) |
TAMP_LOG |
true |
Enable logging |
TAMP_CACHE_SAFE |
true |
Compress newest only (prompt-cache safe) |
TAMP_LLMLINGUA_URL |
(none) | LLMLingua sidecar URL |
Recommended setups:
# Default (all stages)
npx @sliday/tamp
# No Python (skip LLMLingua)
TAMP_STAGES=minify,toon,strip-lines,whitespace,dedup,diff,prune npx @sliday/tamp -y
# Re-compress history too
TAMP_CACHE_SAFE=false npx @sliday/tamp# npx (no install)
npx @sliday/tamp
# npm global
npm install -g @sliday/tamp
tamp
# systemd service (Linux)
tamp install-service
tamp statusClaude Code sends full conversation history on every API call. Tool results accumulate — files, listings, outputs — all re-sent as input tokens.
With 52.6% average compression: Save $0.19–$0.32 per 200-request session (Sonnet/Opus 4.6). Max subscribers get 47% more requests from fixed budgets. See whitepaper PDF for full benchmarks.
Output savings: Tamp injects token-efficient rules into your CLAUDE.md, reducing output tokens by 66.2%. Inspired by drona23/claude-token-efficient.
Caveman Mode evaluation: Tested extreme compression (40-70% additional savings) but found unsafe for production. Recommended: task-type-aware compression (78% savings on safe tasks like env vars/typos/docs). Full evaluation: bench/caveman-mode-evaluation.md.
npm test
node smoke.jsMIT © Stas Kulesh