Statusline

From The Hei Canon

The statusline is the fleet's per-pane status display for clanker sessions — a small avatar portrait and live session state rendered at the bottom of each agent's terminal in Claude Code. It answers, at a glance, three questions a wrangler asks constantly: which persona is this pane, what is it doing, and how full is its context window.

What it shows

  • Avatar. A transparency-aware half-block render of the active persona's portrait PNG, resolved per pane from the org chart. The aura of the pane, made literal.
  • Name and role. Display name plus title, pulled from org-chart.json so the label tracks the persona's actual seat rather than a hardcoded string.
  • Directory and model. The working directory (home-relativised) and the model driving the session.
  • Context-usage bar. A ten-cell bar of the window filled so far, colour-graded: green below 60%, amber below 85%, red at or above. This is the rot gauge.

Wedge alert

Above 75% context, the bar trails a red ⚠ wedge marker; at or above 85% it blinks. The alert is an early-warning light for Context rot: it does not measure imminent crash, it measures how deep into the soft-steering band the pane has drifted, so the operator can /compact or hand off before the clanker starts dropping constraints and re-asking settled questions. The name is deliberate — a pane that ignores the warning is on its way to getting wedged.

Implementation

The statusline is a shell script (~/.claude/statusline-avatar.sh) wired into Claude Code's statusLine setting. It receives the session JSON on stdin, reads .context_window.used_percentage for the bar, resolves the persona (env override, then director whoami), and renders the portrait via ~/.claude/avatar-ansi.py. Renders are cached by avatar and org-chart mtime, since statuslines refresh often. Persona-less panes fall back to a plain host/dir line plus the bar.

Sources

  • ~/.claude/statusline-avatar.sh — the statusline script (avatar, bar, wedge alert, org-chart role resolution).
  • ~/.claude/avatar-ansi.py — the half-block portrait renderer.
  • ~/ht/admin/org-chart.json — the name/role source of truth.

See also

  • Context rot — what the context bar and wedge alert exist to warn against.
  • Wedged — the state the alert is trying to keep a pane out of.
  • Aura — the persona-presence the avatar renders.
  • Clanker — the agent the statusline describes.