Feature request: Invoke statusline command on session start before first assistant response
Problem
When using a custom statusLine command (configured in ~/.claude/settings.json), the statusline area is completely blank when a new session starts or after running /new. It only appears after the first assistant response, because that's the first time Claude Code invokes the statusline command with model/context data via stdin.
This creates a confusing UX — users see an empty bottom bar and assume their statusline plugin is broken or not configured, when in reality it's just waiting for data.
Use Case
We built Redline, a statusline plugin that displays:
- Current model name (e.g., Opus 4.6)
- Context window usage with a progress bar
- Session (5-hour) and weekly (7-day) rate limit utilization with progress bars
- Reset times for rate limits
The plugin fetches data from the Anthropic usage API and renders a boxed statusline. It works perfectly once the first message is exchanged, but on session start, users consistently think the plugin isn't installed or is broken because the statusline area is empty.
Proposed Solution
Invoke the statusline command once on session start with empty/default stdin data, e.g.:
{
"model": {},
"context_window": {}
}
This would allow statusline scripts to detect the "no data yet" state and render a meaningful placeholder. For example, Redline could show:
╭─ Redline ────────────────────────╮
│ Waiting for first response... │
╰──────────────────────────────────╯
or display just the usage API data (session/weekly limits) which is available independently of the conversation state.
Current Behavior
- User opens new Claude Code session
- Statusline area is blank
- User sends a message and receives a response
- Statusline appears
Expected Behavior
- User opens new Claude Code session
- Statusline command is invoked with empty/default data
- Statusline renders a placeholder or partial info
- After first response, statusline updates with full data
Environment
- Claude Code with
statusLinetypecommandin~/.claude/settings.json - macOS / Darwin
- Affects all custom statusline commands, not just Redline
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗