[Bug] Advisor state not exposed in status line JSON; workaround produces false indicators
Bug Description
Subject: Advisor state isn't observable to status lines â^@^T and the only workaround produces false indicators
Context: Building a custom shell status line that shows the active advisor model. Claude Code v2.1.x, Linux.
The gap: The advisor's live state is exposed on no surface a status line can read. The status line JSON payload (StatusLineCommandInput) carries model, effort, context_window, cost, worktree, etc., but has no advisor field. Advisor calls also don't fire hooks or appear in the transcript. (Already filed as open feature request #70611 â^@^T I added a corroborating comment.)
Why the only workaround is actively misleading: The single signal available to a status line is reading advisorModel from settings.json. That's a persisted default, not live session state, so it's wrong in both directions:
- /advisor <model> writes advisorModel to user (global) settings. Result: the badge then shows on every session in every project, including ones with no advisor active. This is the concrete symptom that started our investigation â^@^T a status line showing adv:opus universally.
- --advisor <model> (the documented per-session path) writes nothing to disk. Result: those sessions show no badge even though the advisor is active.
Design observation (not a code bug, but a sharp edge): /advisor and /effort persist to global user settings by design (documented). That's reasonable for a default model, but "attach a second, more expensive reviewer model to every session everywhere, set-and-forget from one slash command" is a footgun â^@^T most users would expect advisor to be a per-task choice. The --advisor launch flag exists as the per-session path, but there's no in-app way to say "session only, don't persist" from the slash command, and no signal that a value is now global.
Asks (in priority order):
- Expose resolved advisor state in the status line JSON â^@^T a top-level advisor field reflecting the session-resolved value (precedence: launch flag > project settings > user settings), distinguishing "configured default" from "active this session." (This is #70611.)
- Consider whether /advisor should persist globally by default, or offer a session-only variant / a visible "this is now your global default" confirmation.
- Fire a PostToolUse hook (or transcript entry) on advisor calls so tooling can track invocation count/model.
What we did locally: Removed the stale global advisorModel key; rewrote our status line to read the projectâ^F^Ruser settings hierarchy so the badge is at least truthful for persisted defaults. The --advisor launch-flag case remains unshowable until #70611 ships.
Environment Info
- Platform: linux
- Terminal: cursor
- Version: 2.1.211
- Feedback ID: 0f05168a-37af-4eb0-a488-58c81fbcd3f7
Errors
[]