[Feature Request] Include initial context token counts in statusline data at session start
Problem
The statusline script receives token data in the context_window JSON payload, but current_usage is null until after the first API call. However, the /context command can display token counts immediately on session start (showing system prompt, CLAUDE.md, skill descriptions, MCP tool definitions, etc.).
This creates an inconsistent experience where users with custom statusline scripts cannot display token usage until after sending their first prompt, even though the data clearly exists.
Proposal
Include initial context token counts in the statusline payload at session start. Options:
- Populate
context_window.current_usagewith initial context tokens when the session starts (before any user prompt) - Add initial context data to the
Statushook event payload - Fire the statusline update after session initialization completes
Use Case
Custom statusline scripts that display context usage should show meaningful data immediately, not just after the first prompt. Since /context proves this data is available at startup, the statusline should have access to it too.
Related Issues
- #13653 - Status line shows wrong percentage (different root cause)
- #11535 - Original feature request to expose token data (implemented, but missing startup data)
Environment
- Platform: darwin
- Version: 2.1.x
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗