Headroom context compression for OpenCode — spawns the proxy, intercepts provider traffic, exposes reversible compression.
Compresses everything your AI agent reads — tool outputs, logs, files, conversation history — before it reaches the LLM. Same answers, a fraction of the tokens. Runs locally; your data stays on your machine.
# 1. Headroom CLI (one-time)
uv tool install "headroom-ai[all]"
# or: pip install "headroom-ai[all]"
# 2. The plugin
npm install @shutovks/headroom-opencode-standaloneOpenCode config (opencode.jsonc):
The plugin starts the local headroom proxy automatically and stops it when OpenCode exits. If no headroom binary is on PATH, it loads as a no-op — your session runs normally, just without compression.
| Variable | Default | Description |
|---|---|---|
HEADROOM_PROXY_PORT |
0 |
0 = free port per instance; set to force a shared proxy port |
HEADROOM_BIN |
~/.local/bin/headroom |
Path to the headroom CLI |
HEADROOM_NO_HTTP2 |
unset | 1 disables http/2 (fixes TLS corruption under heavy concurrent streams) |
HEADROOM_ANTHROPIC_URL |
unset | Anthropic upstream URL (Anthropic handler ignores per-request routing until headroom PR #1502 lands) |
HEADROOM_PROXY_URL |
unset | Reuse an externally-managed proxy instead of spawning one |
{ "plugins": { "@shutovks/headroom-opencode-standalone": {} } }