Feature Request: Expose conversation context metrics to status line hooks

Resolved 💬 4 comments Opened Dec 15, 2025 by loadinglucian Closed Feb 27, 2026

Summary

The status line hook API currently only exposes session-wide cumulative token metrics. It would be valuable to expose the same conversation-level context breakdown that the /context command displays.

Current Behavior

The status line hook receives this JSON payload:

{
  "context_window": {
    "total_input_tokens": number,
    "total_output_tokens": number,
    "context_window_size": number
  }
}

These are session-wide cumulative values, not current conversation context.

Requested Behavior

Expose the detailed context breakdown that /context calculates internally:

{
  "context_window": {
    "total_input_tokens": number,
    "total_output_tokens": number,
    "context_window_size": number,
    // NEW: Current conversation context metrics
    "conversation": {
      "total_tokens": number,
      "system_prompt_tokens": number,
      "system_tools_tokens": number,
      "mcp_tools_tokens": number,
      "custom_agents_tokens": number,
      "memory_files_tokens": number,
      "messages_tokens": number,
      "free_space_tokens": number,
      "autocompact_buffer_tokens": number
    }
  }
}

Use Case

Users who customize their status line want to display current conversation context usage (how close they are to hitting the context limit / autocompact) rather than cumulative session usage. This matches what /context shows:

⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁   claude-opus-4-5-20251101 · 69k/200k tokens (34%)

The 69k/200k represents current conversation context, which is the actionable metric users care about for understanding when autocompact will trigger.

Additional Context

  • The /context command already calculates and displays these metrics
  • The data exists internally; this request is to expose it via the hook API
  • Would enable status line displays that mirror /context output

🤖 Generated with Claude Code

View original on GitHub ↗

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