BUILD / configure-grok-build-status-line

Build

Configure the Grok Build status line

Configure the Grok Build status line

The status line is an optional row at the bottom of Grok Build, above the shortcuts bar. It can show live session values (model, context usage, cost) or the stdout of a script you provide. It is off by default.

Add a [ui.status_line] section to ~/.grok/config.toml and restart Grok. The type key selects the mode: builtin, command, or disabled. Because a command status line runs a program on your machine, Grok reads this section only from your own config or from configuration your administrator manages. A cloned repository cannot set one.

Built-in items

[ui.status_line]
type = "builtin"
items = ["cwd", "model", "context"]

The default set renders like my-project │ Grok 4.5 │ 12% ctx. Available items:

Item What it shows
cwd Current directory name
model Model display name
context Context window usage % (turns amber at the auto-compaction threshold, or at 80% when the agent does not report one)
cost Session cost (hidden below $0.005)
turn-timer Elapsed time of the current turn (after one second)
session-name Session name, if set

Run your own script

Set type = "command" and point command at a script or an inline shell command. Leading ~/ expands to your home directory. Recipes are POSIX shell (macOS/Linux); a command status line is untested on Windows.

#!/bin/sh
payload=$(cat)
model=$(printf '%s' "$payload" | jq -r '.model.display_name // "?"')
ctx=$(printf '%s' "$payload" | jq -r '.context_window.used_percentage // 0')
printf '%s │ %s%% ctx\n' "$model" "$ctx"

Save as ~/.grok/statusline.sh, chmod +x it, then:

[ui.status_line]
type = "command"
command = "~/.grok/statusline.sh"

Restart Grok. The row appears once a session is active (not on the welcome screen or a fullscreen subagent view).

For values outside the session (CI status, for example), set refresh_interval in seconds (1–86400). The JSON field trigger is "refresh_interval" on timed runs and "state" otherwise. Fetch on timed runs and read a cache on state runs so a busy turn does not hammer the network.

Options

Key Default Notes
type disabled builtin, command, or disabled (off / none / hidden also mean disabled)
items ["cwd", "model", "context"] Built-in segments, in order
command Script or shell for type = "command"
padding 0 Horizontal spacing per side (max 16)
refresh_interval unset Timed re-runs for command only

Pitfalls

  • Restart after editing config.toml. Grok reads [ui.status_line] at startup.
  • Scripts get one JSON object on stdin, 10 seconds, and up to five output lines. Prefer printf over echo -e. Absent JSON fields are omitted, never zero — use jq // defaults.
  • grok inspect surfaces config problems. Messages that begin with [ui.status_line] name the bad key.
  • Pair with Compact a long Grok Build session when context % climbs.