ox status line in the Claude desktop app (Claude Code tab)
Context
How the status line works today (cmd/ox/statusline.go): Claude Code runs ox statusline as the
statusLine command on every status-bar refresh (installed in .claude/settings.local.json by ox init /
ox doctor, gated by ox config set statusline on|off, default on). It is a fast path in main.go (no daemon,
no network), reads Claude Code's JSON from stdin (session_id, cwd), resolves the agent ID from the session
marker, loads .sageox/cache/statusline/<agent>.<session>.json (internal/oxactivity), and prints one line:
● ox 3 discussions · 1 plan · 1 murmur · 2 used ● rec (on origin/main, #1582/#1608; the local checkout is
13 commits behind and still shows the older action/whisper feed). ● ox green bold, numbers green, nouns dim,
● rec red while recording; oxactivity.Fit drops the smallest count first on a narrow bar.
The problem: the Claude desktop app's Claude Code tab has no status bar, so the line never appears there.
The one desktop surface a plugin can hold persistently is the AbovePrompt band, the row directly above the
prompt input (plugin types: "Raised on the terminal and desktop surfaces only"). That is the pane above the input
the user proposed, and it is the right place: $.ui.status is the terminal's status row, and a Pane is a docked
sidebar, too heavy for one line.
What already exists to build on (origin/main): the /ox-brief pane mod (internal/usagepane/mod/) is a
Claude Code plugin installed at user scope by default from ox init and ox doctor
(cmd/ox/doctor_usage_pane.go, generic installer internal/claudemod). It is a thin view over
ox brief --json fetched with $.process.run, re-read after each ox Bash call and on a 15 s timer. A user-scope
mod "loads in that local session too, and its ui.render hooks draw for the desktop surface" (plugin-authoring
reference), which is how Oxy reached the desktop in #1606.
Decision: add the band as a new ui.render hook inside the existing ox-cli-brief-pane mod, fed by a new
ox statusline --json. One plugin, one install path, already on by default, same "thin view over an ox JSON
command" shape. Visibility follows the existing statusline setting (--json answers show:false when off), so
ox config set statusline off hides it on desktop exactly as it removes the terminal row. A separate
ox-cli-statusline plugin would cost a second claude plugin install in init/doctor and ~250 lines of mirrored
Go for no user-visible gain; revisit only if the pane is ever made opt-in.
Outcome: in the desktop app a coworker sees ● ox … ● rec above the prompt, live, by default.
Prerequisite
Branch from origin/main (git pull --rebase on main first): internal/claudemod, internal/usagepane, and the
counts-based oxactivity.Counts only exist there.
Design
Claude desktop, Code tab ox binary
┌───────────────────────────────┐
│ transcript │ ui.render {AbovePrompt}, e.surface === 'desktop'
│ │ │ draws last fetched line
│ ● ox 3 discussions · 1 plan │◄──────┤
│ · 2 used ● rec │ │ refresh: turn.start/complete, after each ox Bash call,
│ > prompt… │ │ $.clock.every(15 s)
└───────────────────────────────┘ ▼
$.process.run(['ox','statusline','--json'], briefRunInit(sessionId))
│ env CLAUDE_CODE_SESSION_ID (same as the pane)
▼
{"show":true,"counts":{"discussions":3,"plans":1,"used":2},"recording":true}
1. ox statusline --json — cmd/ox/statusline.go
- Add
--json. ExtendisStatuslineFastPathto also match["statusline","--json"]so the fast path (no daemon ping, no feature flags) still applies. - Session id: stdin JSON as today, else
CLAUDE_CODE_SESSION_IDfrom the environment (what the pane already passes viabriefRunInit; the desktop host process has no stdin JSON to give). - JSON mode calls
buildOxStatuslineand skips the chained user command (the band is ox's alone). Payload viacli.PrintJSONTo(.claude/rules/json-output.md):{ "show": bool, "counts": oxactivity.Counts (omitempty ints: discussions, plans, docs, sessions, murmurs, used), "recording": bool }. Addjsontags tooxactivity.Counts(internal/oxactivity/render.go); nothing else in the package changes. show:falsewhen the setting is off or cwd is outside a SageOx project; still exits 0, never prints errors.- Update the command's
Longtext to mention the desktop band.
2. The band — internal/usagepane/mod/
hooks/logic.ts (pure, unit-tested):
STATUSLINE_ARGV = ['ox','statusline','--json'],parseStatusline(stdout): Statusline | null(tolerant likeparseReport).statuslinePieces(line, bodyColumns): mirrorsoxactivity.layout/Fit—● ox, thenN nounitems joined by·in display order (discussions, plans, docs, sessions, murmurs),N usedlast,● recreserved first and the smallest count dropped first when wider thanbodyColumns. Returns typed pieces (mark|num|dim|recDot|recLabel) so the draw is a map, not logic.
hooks/register.tsx:
- Module state
statusline: Statusline | null, its ownrefreshStatusline($)with the same inflight-fold asrefresh(burst of ox calls → at most two runs),RUN_TIMEOUT_MS2 s. - Triggers:
turn.start,turn.complete, the existingtool.call {tool:'Bash'}hook whenisOxCommand, and a$.clock.every(REFRESH_MS)timer started on the first desktop draw (so terminal-only sessions never poll). When the parsed result differs from the last, store it and$.ui.invalidate('ui.render'). on('ui.render', { component: 'AbovePrompt' }, …):if (e.surface !== 'desktop' || e.props.hasSurvey) return next(e)(the terminal already shows the row in its status bar; drawing it there would duplicate it). No data yet orshow:false→next(e). Otherwiseconst { Box, Text } = $.ui.resolve(e)and one row:<Text color="success" weight="bold">● ox</Text>, numberscolor="success", nouns/separatorsdimColor,<Text color="error">●</Text><Text dimColor> rec</Text>. Sized toe.props.bodyColumns.- Every hook ends
.catch(($, e, next) => next(e)); a missingoxbinary or non-zero exit draws nothing and retries on the next trigger (no toast). Stop the timer onsession.end. - No new slash command or
$.state: the engine's[-]collapses the band;ox config set statusline offhides it.
types/index.d.ts: add the Statusline type (show, counts, recording).
3. Install / docs — no new install code
- The mod is already installed by
ensureUsagePane(cmd/ox/init.go) and thebrief-panedoctor check; a version bump of ox rewrites the folder and reinstalls (claudemod.Installer.Enable). Existing sessions pick it up with/reload-plugins(the doctor message already says so). doctor_usage_pane.goDescriptionand thebrief-panecheck text: mention the status band.docs/guides/agent-compatibility.md"Status line" paragraph: add the desktop sentence.CHANGELOG.md: one human-focused entry ("See● oxabove the prompt in the Claude desktop app").- Regenerate
docs/referenceifox statuslinehelp changed.
Files
| File | Change |
|---|---|
cmd/ox/statusline.go (+ statusline_test.go) | --json, env session id, fast-path match, JSON payload |
cmd/ox/main.go | isStatuslineFastPath accepts --json (if the match lives there) |
internal/oxactivity/render.go | json tags on Counts |
internal/usagepane/mod/hooks/logic.ts, register.tsx, types/index.d.ts, tests/usage-pane.test.tsx | band hook, parser, layout, tests |
cmd/ox/doctor_usage_pane.go, docs/guides/agent-compatibility.md, CHANGELOG.md | wording |
Verification
- Go:
go test ./cmd/ox -run 'Statusline' ./internal/oxactivity- new
TestRenderStatuslineJSON_*: on → counts + recording; setting off →show:false; outside a project →show:false; env session id used when stdin is empty; chained user command never runs in JSON mode; stdout is exactly one JSON document.TestIsStatuslineFastPathcovers--json.
- new
- Mod:
claude plugin validate internal/usagepane/mod && claude plugin test internal/usagepane/modstatuslinePiecestable tests (ordering,usedlast, narrow-width drops, rec reserved).- UI: mount
AbovePromptover['terminal','desktop']withmock$.process.runreturning fixture JSON: terminal passes through, desktop draws● ox+ counts +● rec;show:falsedraws nothing; non-zero exit draws nothing and does not throw;hasSurveyyields. Red-first: flip the surface check and watch the desktop case fail, then restore.
- Real session (
.claude/rules/testing.md):make build && make install,ox doctor --fix(reinstalls the mod at the new version), open this repo in the Claude desktop app's Code tab, run/reload-plugins, runox agent prime/ox query …in the session and confirm the band above the prompt updates and shows● rec. Thenox config set statusline off→ band disappears on the next refresh;on→ returns. make lint && make test.
Out of scope
- Terminal
AbovePromptrendering (duplicates the status bar row). - Codex (no band surface).
- Any change to what the line counts; the band is a renderer of
ox statusline --jsononly.

