[Feature Request] Include initial context token counts in statusline data at session start

Resolved 💬 2 comments Opened Jan 22, 2026 by gmarcus Closed Feb 28, 2026

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:

  1. Populate context_window.current_usage with initial context tokens when the session starts (before any user prompt)
  2. Add initial context data to the Status hook event payload
  3. 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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗