feat(agents): a Claude Code status line that follows the Omarchy theme - #16
Merged
Conversation
The bottom bar for the Claude Code CLI, in two lines: where you are (model, effort, worktree, branch, uncommitted count, open PR and its review state), then what it costs (a context-window gauge, the 5-hour and 7-day quota windows, session spend and lines changed). Everything it shows comes from the JSON Claude Code writes to the command's stdin — no API poll, no `gh` call, no transcript parsing. It paints with the sixteen ANSI colors and nothing else. The palette then comes from the terminal, so the bar re-themes itself when Omarchy switches theme or flips light/dark, the same way starship and bat already do here. Truecolor would have meant a theme-set hook and a second copy of the palette. Two details the bar would be wrong without: Nerd Font icons come from the non-Mono family and take two cells, so the width budget counts them as two; and `COLUMNS` is not exported to the status line command while `tput cols` answers 80 whenever stdout is a pipe, which is always, so a wide bar would truncate at 80 — the fallback is a generous 200 instead. `--test` is the self-check: thresholds, the gauge ramp, a quiet session, narrow-terminal truncation, the Touch Bar hand-off, and empty or invalid stdin. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R
The assertions shipped inside `claude-statusline.sh --test`, where nothing ran them. This is the wrapper that makes `tests/*.sh` — the gate CI actually runs — call it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bottom bar for the Claude Code CLI, in two lines: where you are (model, effort, worktree, branch, uncommitted count, open PR and review state), then what it costs (context gauge, 5-hour and 7-day quota windows, spend, lines changed). Every value comes from the JSON Claude Code puts on the command's stdin — no API poll, no
ghcall, no transcript parsing.Why it belongs here rather than being one more npm status line: it paints with the sixteen ANSI colors and nothing else. The palette then comes from the terminal, so the bar re-themes itself when Omarchy switches theme or flips light/dark — exactly how starship and bat already behave on this machine. Truecolor would have meant a
theme-set.dhook and a second copy of the palette to keep in sync.It stays quiet: a quota window appears at 25 %, a cost at $0.10, the diff only when non-zero. A fresh session shows two short lines.
Two things it would be wrong without:
COLUMNSis not exported to the status line command, andtput colsanswers 80 whenever stdout is a pipe — which is always. Falling back totputtruncated a wide bar at 80; the fallback is a generous 200 instead.It also drops each session's context percentage in
$XDG_RUNTIME_DIR/macarchy-claude/<session id>, which macarchy/macarchy-touchbar#claude-context reads to put the fullest session on the Touch Bar. A no-op when nothing reads it.Test
bash agents/claude-statusline.sh --test— thresholds, the gauge ramp, a quiet session, narrow-terminal truncation, the Touch Bar hand-off, and empty or invalid stdin.🤖 Generated with Claude Code
https://claude.ai/code/session_01TN4cPFxUtafhd87w2ZqY7R