---
name: adom-statusline
description: Install the Adom-branded status line for Claude Code — model name, a 20-segment context-usage bar, and 5-hour session usage, colored with Adom brand truecolor (teal → yellow → red as usage climbs). Use when the user says "set up the adom statusline", "install the status line", "add the context bar to claude code", or asks for a Claude Code status line showing context/session usage.
---

# Adom Statusline for Claude Code

A single POSIX-sh status line for Claude Code that shows, left to right:

- **Model name** in Adom purple (e.g. `Fable 5`)
- **Context bar** — 20 segments (`━` filled / `╌` empty), one per 5% of context used,
  with the percentage. Teal below 50%, yellow at 50–79%, red at 80%+.
- **5h session usage** — `5h: N%` from the five-hour rate-limit window, blue → yellow → red
  on the same thresholds.

No dependencies beyond `sed`/`grep`/`printf` (no jq). Colors are 24-bit ANSI truecolor
(supported by every modern terminal: Terminal.app, iTerm2, VS Code, Ghostty, Windows Terminal).

## Install

Run the packaged installer from the package root:

```sh
./install.sh
```

It does exactly two things, both idempotent:

1. Copies `statusline.sh` to `~/.claude/statusline.sh` and marks it executable.
   An existing different file is backed up to `~/.claude/statusline.sh.bak` first.
2. Merges into `~/.claude/settings.json` (creating it if absent, preserving every
   other key):

   ```json
   { "statusLine": { "type": "command", "command": "~/.claude/statusline.sh" } }
   ```

Then restart Claude Code (or start a new session) — the status line renders under the
input box on the next status update.

## Manual install (no installer)

1. Save this package's `statusline.sh` as `~/.claude/statusline.sh`; `chmod +x` it.
2. Add the `statusLine` block above to `~/.claude/settings.json`.

## How it works

Claude Code pipes a JSON status payload to the command on stdin. The script pulls
three fields without a JSON parser:

- `model.display_name` — via `sed`
- the first `used_percentage` (context window) — via `grep -o`
- `five_hour.used_percentage` (session window) — via `grep -o` on the `"five_hour":{...}` object

Each field renders only if present, so the line degrades gracefully on older
Claude Code versions that omit a field.

## Customizing

Edit `~/.claude/statusline.sh`:

- **Colors** — the `C_*` variables at the top are `\033[38;2;R;G;Bm` truecolor
  escapes. Defaults are the Adom brand palette: teal `0,184,177`, blue `100,171,255`,
  purple `140,107,247`.
- **Thresholds** — the `-ge 80` / `-ge 50` tests set where the bar turns red/yellow.
- **Bar width** — `filled=$(( ctx_int / 5 ))` and `empty=$(( 20 - filled ))`; change
  both `5` and `20` together (width = 100 / divisor).

## Uninstall

```sh
./uninstall.sh
```

Removes `~/.claude/statusline.sh` and deletes the `statusLine` key from
`~/.claude/settings.json` (other settings untouched).

## Troubleshooting

- **No status line at all** — check `statusLine` is present in `~/.claude/settings.json`
  and the script is executable. Test by hand:
  `echo '{"model":{"display_name":"Test"},"context":{"used_percentage":42}}' | ~/.claude/statusline.sh`
- **Garbled color codes** — the terminal lacks truecolor; swap the `C_*` escapes for
  basic 16-color ones (e.g. `\033[35m` for purple).
- **No `5h:` segment** — the payload only includes rate-limit data on plans with the
  5-hour window; the script correctly omits it otherwise.
