tamp

Set up Tamp token compression proxy for OpenClaw to reduce Anthropic API input token costs. Use when the user asks to save tokens, reduce API costs, set up tamp, or optimize OpenClaw spending. Also use when asked about token compression or cost reduction for Claude models.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tamp" with this command: npx skills add sliday/tamp

Tamp for OpenClaw

Save 3-50% on input tokens by routing API requests through Tamp — a local HTTP proxy that compresses tool_result blocks before they reach Anthropic.

Prerequisites

  • Node.js 18+
  • Anthropic API key — Tamp proxies requests to Anthropic. Your ANTHROPIC_API_KEY must be set in your OpenClaw config. Tamp itself does not store or read this key — it forwards the x-api-key header from incoming requests unchanged.

1. Install & Run

# Install a pinned version (recommended)
npm i -g @sliday/tamp@0.3.8

# Or run without installing
npx @sliday/tamp@0.3.8 -y

Start with default stages:

TAMP_STAGES=minify,toon,strip-lines,whitespace,dedup,diff,prune tamp -y

Verify:

curl http://localhost:7778/health
# {"status":"ok","version":"0.3.8","stages":["minify","toon",...]}

Tamp is open source (MIT). Audit the source, build from git, or run from a local clone: git clone https://github.com/sliday/tamp && cd tamp && npm install && node bin/tamp.js -y

2. Run as systemd service

Create ~/.config/systemd/user/tamp.service:

[Unit]
Description=Tamp token compression proxy
After=network.target

[Service]
# Adjust path: node -e "console.log(require('child_process').execFileSync('which', ['tamp']).toString().trim())"
ExecStart=/usr/local/bin/tamp
Restart=always
RestartSec=5
Environment=TAMP_PORT=7778
Environment=TAMP_STAGES=minify,toon,strip-lines,whitespace,dedup,diff,prune
Environment=TAMP_LOG=true

[Install]
WantedBy=default.target
systemctl --user daemon-reload
systemctl --user enable --now tamp.service
journalctl --user -u tamp -f  # live compression logs

3. Configure OpenClaw

Add a provider in your OpenClaw config:

{
  models: {
    providers: {
      "anthropic-tamp": {
        baseUrl: "http://localhost:7778",
        apiKey: "${ANTHROPIC_API_KEY}",  // Forwarded to upstream, not stored by Tamp
        api: "anthropic-messages",
        models: [
          { id: "claude-opus-4-6", name: "Claude Opus 4.6 (compressed)" },
          { id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6 (compressed)" }
        ]
      }
    }
  }
}

Set as primary model:

{
  agents: {
    defaults: {
      model: { primary: "anthropic-tamp/claude-opus-4-6" }
    }
  }
}

Restart the gateway. All requests now flow through Tamp.

How it works

OpenClaw → POST /v1/messages → Tamp (localhost:7778) → compresses JSON body → Anthropic API
                                                     ← streams response back unchanged

Tamp intercepts the request body, finds tool_result blocks in messages[], and compresses their content. Headers (including x-api-key) are forwarded unchanged. The response streams back untouched.

7 Compression Stages

StageWhat it doesLossy?
minifyStrip JSON whitespaceNo
toonColumnar encoding for arrays (file listings, deps, routes)No
strip-linesRemove line-number prefixes from Read tool outputNo
whitespaceCollapse blank lines, trim trailing spacesNo
dedupDeduplicate identical tool_results across turnsNo
diffDelta-encode similar re-reads as unified diffsNo
pruneStrip lockfile hashes, registry URLs, npm metadataMetadata only*

* Prune removes fields like integrity, resolved, shasum, _id, _from, _nodeVersion from JSON — npm registry metadata not needed by the LLM. To keep full provenance, remove prune from TAMP_STAGES.

What to expect

ScenarioSavings
Chat sessions (short turns)3-5%
Coding sessions (file reads, JSON)30-50%
Lockfilesup to 81%
Subagent tasks20-40%

Security Notes

  • API key handling: Tamp forwards the x-api-key / Authorization header from the incoming request to upstream. It does not store, log, or read API keys.
  • Local only: Tamp binds to localhost by default. It does not accept external connections unless you change the bind address.
  • No telemetry: Tamp does not phone home, collect analytics, or make any outbound connections except to the configured upstream API.
  • Fallback: Add Anthropic direct as a fallback model in OpenClaw. If Tamp is down, requests bypass it automatically.

Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gigo Lobster Resume

🦞 GIGO · gigo-lobster-resume: 续跑入口:v2 stable 当前会清理旧 checkpoint 并从头重跑;保留此 slug 作为旧 checkpoint 兼容入口。 Triggers: 继续试吃 / 恢复评测 / resume tasting / continue lobster...

Registry SourceRecently Updated
General

YiHui CONTEXT MODE

context-mode is an MCP server that saves 98% of your context window by sandboxing tool outputs. It routes large file reads, shell outputs, and web fetches th...

Registry SourceRecently Updated
General

xinyi-drink

Use when users ask about 新一好喝/新一咖啡 drinks, stores, menu, activities, Skill用户大礼包, today drink recommendations, afternoon tea, feeling sleepy, or personalized...

Registry SourceRecently Updated
General

vedic-destiny

吠陀命盘分析中文入口。用于完整命盘研判、命主盘 Rashi chart 与九分盘 Navamsha chart 联读、既往事件回看、出生时间稳定度判断、事业主题、婚姻主题、时空盘专题,以及基于 Jagannatha Hora PDF、星盘截图或文本命盘数据的系统拆盘。当用户提到完整星盘、事业方向、婚姻问题、关系窗...

Registry SourceRecently Updated