Documentation Index
Fetch the complete documentation index at: https://mintlify.com/headroomlabs-ai/headroom/llms.txt
Use this file to discover all available pages before exploring further.
headroom wrap <tool> is the fastest way to connect any supported AI coding agent to Headroom. It starts the proxy as a background process, configures the agent to route through it, installs the MCP retrieve tool and context tools (rtk or lean-ctx), then launches the agent — all in a single command.
headroom unwrap <tool> reverses the configuration — restoring original settings and optionally stopping the local proxy.
Supported tools
| Tool | Launch type | Durable unwrap |
|---|---|---|
claude | Launches binary | ✓ |
codex | Launches binary | ✓ |
cursor | Prints config instructions | — |
aider | Launches binary | — |
copilot | Launches binary | ✓ |
cline | Prints config instructions | — |
continue | Prints config instructions | — |
goose | Launches binary | — |
openhands | Sets env variables | — |
opencode | Launches binary | ✓ |
openclaw | Plugin install | ✓ |
vibe | Launches binary | — |
Common flags
These flags are accepted by most or allwrap subcommands.
Proxy port to start on (or connect to if
--no-proxy is set).Skip rtk / lean-ctx context-tool setup. Compression and MCP still work; the agent just won’t have the token-optimized shell command wrapper.
Enable persistent cross-session memory in the proxy. Memories are automatically saved and retrieved across sessions.
Index the current project and enable the code-graph MCP server (tokensave). The agent can query call chains, definitions, and impact analysis without reading whole files.
Request the 1M context window for Claude Code (appends the
[1m] model suffix). Only applies to entitled subscription accounts.Control Claude Code’s on-demand tool loading (deferral). Accepts
true, false, auto, or auto:N (0–100). Defaults to true (keep deferral on) to prevent MCP/system tool schemas from inflating the context window.Run setup steps (proxy start, MCP registration, tool install) without launching the agent binary. Useful for pre-warming in CI or container entrypoints.
Skip starting a new proxy process — connect to one already running on
--port.Enable live traffic learning in the proxy (forwards
--learn to headroom proxy).Claude-specific flags
Skip registration of the tokensave code-graph MCP compressor.
Force-register the Serena MCP compressor even though tokensave is now the primary. Use when tokensave is unavailable on your platform.
Never register the Serena backup compressor.
Copilot-specific flags
Use GitHub Copilot’s subscription (hosted) API rather than a BYOK provider. Triggers the OAuth device-code flow if no saved token exists.
Copilot BYOK provider mode.
auto selects anthropic for the default backend and openai for translated backends.OpenAI-compatible Copilot wire API. Defaults to
completions when --provider-type resolves to openai.Force a specific BYOK backend:
anthropic, anyllm, or litellm-<provider>.To pass a model to the underlying agent (Claude Code or Copilot CLI), append it after
--: headroom wrap claude -- --model claude-opus-4-5 or headroom wrap copilot -- --model gpt-4o.headroom unwrap
headroom unwrap <tool> removes Headroom’s configuration from the agent and optionally stops the proxy.
claude, copilot, codex, opencode, openclaw) restore the agent to its exact pre-wrap state using a snapshot taken at wrap time.
Unwrap flags (claude)
Port of the proxy to stop.
Keep the proxy running after unwrapping.
Leave Headroom MCP registrations in place.
Leave rtk Claude hooks in place.
HEADROOM_CONTEXT_TOOL
Set this environment variable to choose between the two context tools:| Value | Description |
|---|---|
rtk (default) | Rust Token Killer — prefix shell commands to filter/shrink their output (60–99 % savings) |
lean-ctx | Lean-ctx — alternative context optimizer |
How wrap works
- Starts
headroom proxyas a background process on the requested port (unless--no-proxy) - Waits for the proxy to become healthy (timeout: 45 s by default, 90 s when ML extras are detected)
- Installs the rtk (or lean-ctx) context tool and registers hooks
- Registers the
headroomMCP server with the agent for CCR retrieval - Optionally registers the tokensave code-graph MCP
- Sets environment variables (
ANTHROPIC_BASE_URL, etc.) to route traffic through the proxy - Launches the agent binary (for launch-type tools) or prints setup instructions
The proxy logs are written to
~/.headroom/logs/proxy-stdio.log and ~/.headroom/logs/proxy.log. If wrap fails to start, check those files for startup errors.