agent-statusline
A fast, single-line status renderer for command-backed agent statusline payloads, written in Zig. It reads one JSON snapshot on stdin and prints one formatted status line on stdout.
Behavior
- Reads statusline JSON from stdin and ignores unknown fields.
- Crash-free by design: any error in a segment degrades to hiding that segment, falling back to
~ in the worst case. A return code of 0 is always produced.
- Empty segments emit zero bytes (no stray separators).
- Renders host/working-directory and git segments from the current workspace.
--debug or STATUSLINE_DEBUG=1 appends diagnostics to /tmp/statusline-debug.log
and shows the numeric context percentage inline.
STATUSLINE_DEBUG_LOG=/absolute/path.log appends diagnostics to that file
without changing visible output.
STATUSLINE_CAPTURE_DIR=/absolute/dir writes replay artifacts for every render:
statusline-*.input.json and statusline-*.output.ansi.
- Claude Code, Codex, Antigravity CLI (
agy), Kimi Code, Pi, and Grok Build status payloads are supported. Claude models render with their existing glyphs, and Mythos (Mythos 5.2, claude-mythos-5-2) renders as 🔱. GPT model names with the Sol or Astra tier use the same glyph across versions. Sol renders as 🌞 and Astra renders as 🌠, the shooting star Astra chose. The bare gpt-6.1 alias also renders as 🌞. GPT-6 Luna (gpt-6-luna) renders as 🌕. GPT-5.6 uses its original glyphs (gpt-5.6-sol ☀️, gpt-5.6-terra 🌍, gpt-5.6-luna 🌙); pi's adapter uses the stable model id when its display label is formatted like GPT-6.1 Sol, GPT-6 Luna, or GPT-5.6 Luna. Previous-generation Codex glyphs remain supported, with ⌘ as the generic GPT/Codex fallback. Kimi models (kimi-code/*, k3[1m], Kimi K2) render as 🌑. Grok models (Grok 4.5, Grok Build, grok-4) render as 🌌. DeepSeek models render with the whale brand mark: the Flash tier (deepseek-flash ids, DeepSeek-*Flash* display names) renders as 🐬, while Pro (deepseek-v4-pro, DeepSeek V4 Pro) and untiered legacy ids (deepseek-chat, deepseek-reasoner) render as 🐳. GLM models (glm-4.6, glm-4.5-air, zai/glm-4.6 producer paths, legacy ChatGLM names) render as 🔮. Qwen models (Qwen3.8 display names, qwen3.8 ids) render as 🐉. Gemini 4 Neon (Gemini 4 Neon, gemini-4-neon) renders as 💡, and Gemini 4 Carbon (Gemini 4 Carbon, gemini-4-carbon, gemini-4-carbon-high) renders as 💎. An (auto) tag renders after the context gauge when the payload declares auto-compaction enabled (auto_compact.enabled, sent by the pi adapter); Antigravity CLI (product: "antigravity") and percentage-only context payloads (used_percentage without token buckets) trust the producer's percentage verbatim.
- Codex goal payloads render active goal attention as
🎯; when tokens_used and token_budget are present, the segment renders compact progress such as 🎯12.5k/50k.
- Reasoning effort renders as an emoji dot dial after the model glyph, graded by compute burn: ⚫ minimal, ⚪ low, 🔵 medium, 🟡 high, 🟠 xhigh, 🔴 max, 🟣 ultra. An emoji badge aligns with the emoji model glyph beside it (partial-height block glyphs read as floating next to baseline-bound text). Claude Code's structured
effort.level field is preferred, followed by Antigravity CLI's model.effort, then Codex's model-with-reasoning display name (gpt-5.6-sol xhigh). Unset (none/default) or unknown effort hides the badge. Codex Fast mode adds 🚀 after the effort dial when the structured service_tier is priority or fast; payloads from older Codex versions fall back to an exact service-tier token in model.display_name. Other models and tiers remain unmarked.
- Activity display is hook-owned: the
agent-statusline plugin records UserPromptSubmit (and Antigravity's PreInvocation) as 💬 MM/DD HH:MM and Stop as 💤 MM/DD HH:MM under STATUSLINE_STATE_DIR, XDG_STATE_HOME/agent-statusline, or ~/.local/state/agent-statusline.
See SPEC.md for the full contract (requirements, invariants, segment rules).
Build
Requires Zig 0.16.0+ (the renderer uses the 0.16 std.Io API). The project has no external dependencies.
zig build # build -> zig-out/bin/statusline
zig build run # run (reads JSON from stdin)
zig build run -- --debug # run with debug diagnostics
zig build test # run unit tests
zig build -Doptimize=ReleaseFast # optimized build
python3 test/renderer-smoke.py zig-out/bin/statusline # isolated renderer smoke (Git + Python 3)
Quick check:
zig build && ./zig-out/bin/statusline < test/opus.json
zig build && ./zig-out/bin/statusline < test/codex.json
zig build && ./zig-out/bin/statusline < test/codex-goal.json
Use with Claude Code
Build a release binary and point your Claude Code statusLine setting at it (~/.claude/settings.json):