headroom/plugins/openclaw
2026-03-28 23:55:39 -07:00
..
src OpenClaw plugin fixes, telemetry fix, cost tracker improvement, tokenBudget support 2026-03-28 23:46:03 -07:00
test OpenClaw plugin fixes, telemetry fix, cost tracker improvement, tokenBudget support 2026-03-28 23:46:03 -07:00
.gitignore feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
openclaw.plugin.json feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
package-lock.json feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
package.json Rename plugin to headroom-openclaw (npm scope not available) 2026-03-28 23:55:39 -07:00
README.md feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
tsconfig.json feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
tsup.config.ts feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00
vitest.config.ts feat: add OpenClaw ContextEngine plugin (@headroom-ai/openclaw) 2026-03-28 13:43:40 -07:00

@headroom-ai/openclaw

Context compression plugin for OpenClaw. Compresses tool outputs, code, logs, and structured data — 70-90% token savings with zero LLM calls.

Install

pip install "headroom-ai[proxy]"
openclaw plugins install @headroom-ai/openclaw

Configure

{
  "plugins": {
    "slots": {
      "contextEngine": "headroom"
    }
  }
}

That's it. The plugin auto-starts the Headroom proxy if it's not already running.

How It Works

Every time OpenClaw assembles context for the model, the plugin compresses tool outputs and large messages:

  • JSON arrays (tool outputs, search results) — statistical selection keeps anomalies, errors, boundaries
  • Code — AST-aware compression via tree-sitter
  • Logs — pattern deduplication, keeps errors and boundaries
  • Text — ML-based token compression

Compression is lossless via CCR (Compress-Cache-Retrieve): originals are stored and the agent gets a headroom_retrieve tool to access full details when needed.

Configuration Options

Option Default Description
proxyUrl auto-detected URL of the Headroom proxy
autoStart true Start proxy automatically if not running
pythonPath auto-detected Path to Python binary
proxyPort 8787 Port for auto-started proxy

Comparison with lossless-claw

lossless-claw headroom
Compaction method LLM summarization (DAG) Content-aware compression (zero LLM)
Cost of compaction Tokens (LLM calls) Zero
Best for Long conversations Tool-heavy agents with large outputs
Retrieval lcm_grep, lcm_expand headroom_retrieve (instant)

License

Apache-2.0