# 0003 — Claude Code status line ✅ ## What to build Add a custom status line to the Claude Code provider that shows session context at a glance. The status line is a bash script that reads JSON from stdin on every Claude Code render event and prints a formatted, colored line. Segments (left to right — identity → config → health): - **Directory** — basename of working dir (bold blue) - **Git branch** — green on feature branches, red on `main`/`master` - **Model** — colored by cost tier: Haiku green, Sonnet amber, Opus red - **Context %** — model-aware thresholds: Opus 55/75%, Sonnet 65/85%, Haiku 75/90%; green → amber → red - **Cost** — session cost in USD; shown as ¢ below $1, $X.XX above; green → amber at $1.50 → red at $3.00 - **Tokens** — cumulative session total, formatted as Xk when ≥ 1000; blue (informational only) - **Vim mode** — magenta, only shown when active Segments joined with ` · `. Missing or zero-value segments are omitted entirely. Files: - `providers/claude-code/statusline-command.sh` — the script - `providers/claude-code/settings.json` — updated with `statusLine` config - `scripts/install.sh` — updated to deploy the script and set executable bit ## Acceptance criteria - [x] `providers/claude-code/statusline-command.sh` exists and is executable - [x] `settings.json` references the script via `statusLine.command` - [x] `install.sh` deploys the script to `~/.claude/statusline-command.sh` with `chmod +x` - [x] All segments render correctly with ANSI colors (no literal `\033[0m` in output) - [x] Segments separated by ` · `, not `|` - [x] Cost shown as ¢ below $1, $X.XX above - [x] Tokens shown as Xk when ≥ 1000, raw number below - [x] Missing fields produce no empty segment - [x] `tests/test-statusline.sh` passes (11 tests) - [x] `tests/test-install.sh` passes (now covers statusline deployment) ## Cost threshold rationale On a $20/month subscription, `total_cost_usd` measures session weight rather than real spend. Thresholds ($1.50 amber / $3.00 red) are calibrated to signal a heavy session, not budget overrun. Adjust upward if amber rarely appears. ## Blocked by - 0002 — install.sh