AI Coding Agents
Tamp Review: A Local Token Compression Proxy for Claude Code
Tamp is a localhost proxy (127.0.0.1:7778) that sits between a coding agent and its model API, compressing tool results in flight across ten default stages. The README claims 52.6% fewer input tokens and 60-70% total token savings with opt-in output compression. Its separate single-request fixtures report 45.3% for balanced mode.
The captured evidence provides no independent validation of those headlines. GitHub reports no license on the repository metadata while the README footer says MIT, so confirm terms before adopting it at work.
At a glance
| Question | Answer |
|---|---|
| What is it? | A localhost proxy that compresses tool results in model API requests. |
| What cost does it target? | Input from tool results carried in conversation history. A separate opt-in mode targets output prose. |
| Where does it act? | Between the agent and provider, rewriting tool-result blocks in the request body. |
| How do you try it? | Run the @sliday/tamp package through npx and point the client at the proxy. |
| How do you undo it? | Remove the proxy base-URL override, stop the proxy, and uninstall its service if you enabled one. |
| What license is stated? | The README footer says MIT. GitHub metadata lists no license. |
| What is its maturity signal? | 100 stars and 3 open issues as of November 30, 2026. |
| When is it a good fit? | Pay-per-token traffic from a client with a supported base-URL override. Skip it for GitHub Copilot or Cursor’s bundled models. |
What Tamp is and which cost layer it targets
Tamp operates at the wire level: the whole API request body, not individual commands. When your agent sends its conversation history upstream, Tamp intercepts the request on localhost, compresses the tool-result blocks inside it, and forwards the result to the configured provider. Because it works on the request rather than the shell, it can compress anything that lands in a tool_result or function_call_output block regardless of which tool produced it.
The project is JavaScript, runs via npx @sliday/tamp with zero install, and supports Claude Code, Codex CLI, opencode, Aider, Cursor, Cline, Windsurf, OpenClaw, and any OpenAI-compatible agent. It cannot intercept GitHub Copilot (no base-URL setting exists), and Cursor’s bundled models route through Cursor’s own servers regardless of the override, so BYOK models only. As of November 30, 2026, the repo has 100 stars, 8 forks, and 3 open issues; the latest release is v0.9.1 (November 26, 2026). The project is roughly eight months old and on a 0.x versioning line.
One caveat on licensing: the GitHub API reports no license for sliday/tamp, while the README ends with “MIT © Stas Kulesh”. Treat the terms as unsettled until a LICENSE file lands, especially for employer deployments.
How it works
The architecture is a single-hop relay:
Claude Code ──► Tamp (localhost:7778) ──► Anthropic API
Aider/Cursor ──► │ ──► OpenAI API
Gemini CLI ────► │ ──► Google AI API
It auto-detects the API format (Anthropic, OpenAI Chat, OpenAI Responses, Gemini, Kimi), compresses tool output in each request, skips error results, and forwards upstream. Ten stages are on by default in the balanced preset (level 5 of 9): cmd-strip (ANSI escapes, spinners, and passing-run noise for npm, pip, cargo, docker, pytest, and friends), minify (JSON whitespace), toon (columnar array encoding), strip-lines (line-number prefixes), whitespace (blank lines), llmlingua (neural prose compression), dedup (duplicates to references), diff and read-diff (similar re-reads become diffs, session-scoped across providers), and prune (low-value npm and lockfile metadata).
Ten more stages are opt-in: strip-comments, textpress (LLM semantic compression via Ollama or OpenRouter), foundation-models (Apple on-device compression, macOS 15+ Apple Silicon), graph (session-scoped dedup across requests, claimed up to -99% per repeat block), br-cache (disk-backed Brotli store for results over 8 KB), disclosure (3-tier summary for results over 32 KB), bm25-trim (query-aware line ranking over 64 KB), px-render (renders dense tool results as PNG blocks via pxpipe), stale-inputs, and stale-images.
The llmlingua stage deserves scrutiny because the README scrutinizes it itself. It needs a Python sidecar on port 8788 (auto-started when uv is installed), and because LLMLingua-2 can drop tokens, Tamp runs a verbatim-critical guard that skips any block containing paths, URLs, JSON separators, hex ids, or semver. The README reports that guard fires on 92% of text blocks in its fixtures, and concludes the honest contribution of llmlingua to a coding agent is very little. The README provides a TAMP_STAGES list that disables llmlingua. Check whether the remaining formatters preserve the details your tasks need.
A separate Caveman-style output mode (TAMP_OUTPUT_MODE, default off) classifies each request as safe or dangerous and injects terseness rules into the last user message, claiming 65-75% output savings on safe tasks while leaving security, debug, and refactor work at full output.
Install and first run
The README’s quick start:
# Option A: One-line installer (read the script before running it)
curl -fsSL https://tamp.dev/setup.sh | bash
# Option B: Manual
npx @sliday/tamp
export ANTHROPIC_BASE_URL=http://localhost:7778 # Claude Code
export OPENAI_API_BASE=http://localhost:7778/v1 # Aider, Cline
For Claude Code there is also a plugin that adds /tamp:status and /tamp:config; it auto-starts Tamp but does not route traffic, so you still set ANTHROPIC_BASE_URL once. Codex CLI reads ~/.codex/config.toml instead of env vars; the README gives a model_providers.tamp block, plus a separate openai_base_url line for ChatGPT Plus/Pro OAuth logins, verified against codex-cli 0.146.0 (with a documented quirk: Codex opens a WebSocket first, Tamp answers 501, and Codex falls back to HTTPS).
Read the dependency warning before wiring this permanently: once ANTHROPIC_BASE_URL points at localhost:7778, the agent talks to nothing when Tamp is down. The README recommends tamp install-service (launchd on macOS, a systemd user unit on Linux) so the proxy is up at every login, and keeping ~/.claude/settings.json.backup until you trust the setup.
To remove it: delete the ANTHROPIC_BASE_URL key (or the base_url entries in other agents’ configs), run tamp uninstall-service if you installed the service, and tamp stop for the running proxy.
What it saves: claims versus evidence
Everything quantitative is a project claim. The README asserts 52.6% average input compression, $0.19-$0.32 saved per 200-request session (framed against Sonnet/Opus 4.6), and 47% more requests for Max subscribers under fixed budgets. Per-level expectations in its level table run from ~15% at L1 (minify only) to ~72% at L9.
To its credit, the README is unusually candid about where the headline does and does not hold. On its own bench/ single-request fixtures, v0.5 baseline lands at 45.1%, L5 balanced at 45.3%, and L9 max at 45.4%; the fixtures are too small to exercise re-reads, the >32 KB disclosure threshold, noisy CLI streams, or cross-request dedup. The author argues the v0.8 gains live in session-scoped work (read-diff, graph, disclosure, cmd-strip) that the micro-benchmark cannot see. That is plausible and also unverified: no independent eval covers Tamp, and tokbench’s pilot (N=1 per arm, different tools) showed that per-request compression and lower billed totals are separate questions worth measuring yourself.
Prompt-cache and extra-turn risk
Tamp’s default design is explicitly cache-aware: TAMP_CACHE_SAFE=true compresses only the newest content to preserve the prefix the provider can cache, and TAMP_REPLAY=true re-sends older tool results byte-identically to how Tamp first sent them, so savings persist without rewriting history. The health endpoint exposes a live cacheHitRate; the README example shows 91.4%.
Two opt-in stages break that promise deliberately: stale-inputs and stale-images prune payloads from older turns, which invalidates the prompt cache. The README keeps them opt-in for exactly that reason and suggests TAMP_STALE_BATCH_SIZE=8 to evict in quantized epochs rather than every turn. Watch cacheHitRate in tamp status if you enable them.
On privacy, most stages are local-only. The one stage that sends content off-box is textpress (level 7+), which posts to OpenRouter when OPENROUTER_API_KEY is set. Secret redaction (TAMP_REDACT) is on by default and masks provider-shaped keys, JWTs, PEM blocks, and UPPER_SNAKE assignments before any stage runs, favoring precision over recall; treat your upstream’s data policy as the final boundary.
What the GitHub issues show
Three open issues and a short closed list on a young repo. Closed issue #2, “Doesnt work with claude max subscription from the box”, flags the subscription/OAuth path as a rough edge the README now documents workarounds for. Closed feature request #5 is interesting for what it claims: tool schema compression producing “94% of token savings in production”, a reminder that tool definitions can dwarf tool outputs as a cost line. Closed #6 asked for removing confidential data from context; the shipped TAMP_REDACT masking answers it.
A cost example
The README reports $0.19 to $0.32 saved per 200-request session. Model a separate scenario using the committed Sonnet rates of $2 per million fresh input tokens and $0.10 per million cache reads. See the AI provider pricing index for current rates.
- Assume 6 million eligible tool-result tokens across 200 requests, a 52.6% reduction on that slice, and unchanged cache behavior.
- If all removed tokens would have billed as fresh input, estimated savings are 6 × 0.526 × $2 = $6.31.
- If 90% of removed tokens would have billed as cache reads, estimated savings are 6 × 0.526 × (0.10 × $2 + 0.90 × $0.10) = $0.915, or about $0.92.
The estimate scales with the tool output eligible for compression and the share that would have billed at cache rates. Use tamp status to inspect the reported cache hit rate, then check the provider’s usage data before estimating savings for a full session.
Who should use it, who should skip it
Use it if:
- You pay per token for Claude Code, Codex, or an OpenAI-compatible agent and want compression that does not depend on the agent cooperating with hooks or guidance.
- You want to start without neural compression at L4 (
conservative) and test more aggressive stages only after checking what L4 preserves. - You are comfortable running a localhost service your agent depends on (or only pointing at it for measured trials).
Skip it if:
- You use GitHub Copilot or Cursor’s bundled models; Tamp cannot reach that traffic.
- Your agent is on a subscription login where the README documents friction (Claude Max per issue #2) and you do not want to maintain workarounds.
- You need settled licensing: the repo metadata shows no license even though the README footer says MIT.
- You cannot tolerate a single point of failure: when Tamp is down and the base URL still points at it, every session fails.
How to trial it safely
- Run Tamp manually (no
install-service) and point one agent at it via env var, keeping the settings backup the README suggests. - Baseline a week of sessions without Tamp; the method in how to measure coding agent token savings applies directly.
- Start at L4 (
conservative, without neural compression). RecordcacheHitRatefromtamp status, then repeat the same tasks at L5. - Compare provider-billed input and cache usage against Tamp’s reported savings. In the independent tokbench pilot (N=1 per arm), local meters and provider bills diverged on tools it tested.
- Leave
textpress,stale-inputs, andstale-imagesoff for the trial; they change the privacy and caching profile.
Alternatives and next reads
sqz compresses at the command/formatter layer with dedup references instead of proxying the whole request. Headroom is the other wire-level proxy in this series. Tamp’s llmlingua stage wraps Microsoft’s research compressor, covered in the LLMLingua prompt compression guide. Current model rates are at /tools/ai-provider-pricing/.
Sources
- sliday/tamp repository (GitHub, accessed 2026-11-30)
- Tamp issue #2: does not work with Claude Max subscription out of the box (GitHub, accessed 2026-11-30)
- Tamp issue #5: tool schema compression feature request (GitHub, accessed 2026-11-30)
- Tamp issue #6: remove confidential data from sending context (GitHub, accessed 2026-11-30)
- tokbench: independent eval of token-saving middleware (GitHub, accessed 2026-11-30)
How this note was produced
Drafted with AI assistance from committed ByteCosts pricing snapshots and deterministic cost formulas. Figures are grounded in the linked sources (last updated 2026-11-30). Read our editorial & automation policy, inspect the methodology, or report a discrepancy.
Tamp Review: A Local Token Compression Proxy for Claude Code. ByteCosts. Updated 2026-11-30. https://bytecosts.com/blog/tamp-proxy-review/