Every coding agent session leaves behind a trail of failed tool calls — wrong file paths, broken commands, stubborn retries.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 learn reads those transcripts, finds what the model did to fix each failure, and writes specific corrections to your project’s memory files so the same mistakes don’t happen next session.
Quick Start
headroom learn runs entirely offline after the initial scan — it needs an LLM only for the analysis step. Set --model gpt-4o or --model gemini/gemini-flash-latest to use a non-default model.Success Correlation — The Core Innovation
Most failure loggers just count errors.headroom learn maps each failure to the fix that worked:
| Step | Example |
|---|---|
| Failed | Read axion-formats/src/main/java/.../FirstClassEntity.java |
| Then succeeded | Read axion-scala-common/src/main/scala/.../FirstClassEntity.scala |
| Learning written | `FirstClassEntity` is at `axion-scala-common/`, not `axion-formats/` |
Categories of Learnings
Environment Facts
Which runtime commands work vs. fail in this project’s environment.
File Path Corrections
Exact locations for files the model keeps guessing wrong.
Search Scope
Which directories to search (narrow paths fail, broader ones work).
Command Patterns
How commands should — and should not — be run.
Example output written to CLAUDE.local.md
Output Targets
By default, learnings go toCLAUDE.local.md in your project root — Claude Code’s personal memory file, which should be gitignored so machine-specific facts don’t pollute the team repo.
| Target | When to use |
|---|---|
CLAUDE.local.md | Default. Personal, gitignored. Machine-specific paths and tool-discovery byproducts. |
CLAUDE.md | Team-shared. Pass --target CLAUDE.md to opt in. |
AGENTS.md | Codex / OpenAI Agents SDK projects. |
GEMINI.md | Gemini CLI projects. |
| Any custom path | Pass --target <path> (relative to project root, or absolute). |
Supported Agents
Built-in plugins ship for the three most common coding agents:claude
Claude Code — reads
~/.claude/projects/*.jsonl transcripts.codex
Codex CLI — shares memory with Claude.
gemini
Gemini CLI — writes to
GEMINI.md.--agent <name> to target a specific agent, or leave it as auto (the default) to scan all detected agents.
Verbosity Learning
headroom learn --verbosity mines behavioral signals from your past sessions — interrupts, fast-skips, echo ratio — to automatically pick the right terseness level for the output shaper:
--apply is used, Headroom hot-enables the output shaper on the running proxy via POST /admin/runtime-env — no restart required.
CLI Reference
Real-World Results
Tested on 67,583 tool calls across 23 projects:| Metric | Value |
|---|---|
| Failure rate | 7.5% (5,066 failures) |
| Corrections extracted | 164 per project (avg) |
| Path corrections | 22 (axion project) |
| Search scope corrections | 24 (axion project) |
| Command patterns learned | 5 (axion project) |
Architecture
headroom learn uses an adapter pattern so new agent systems can be added without touching the analysis logic:
- Scanners read tool-specific log formats and produce normalized
ToolCallsequences. - Analyzers work on
ToolCalldata — the same analysis logic for any agent. - Writers output to tool-specific context injection mechanisms (e.g.,
CLAUDE.md,AGENTS.md).