context_window data in hooks/statusline payload excludes system overhead

Resolved 💬 3 comments Opened Jan 28, 2026 by ThomasDarby Closed Feb 1, 2026

Summary

The context_window.used_percentage and remaining_percentage fields in the JSON payload passed to hooks and statusline commands only reflect conversation context (messages, tool outputs). They exclude system prompts, CLAUDE.md files, MCP tool definitions, git status, and other injected context.

Problem

The built-in "context low" warning uses a more inclusive calculation that accounts for all context window consumers. This creates a discrepancy: tooling consuming the context_window data will show significantly more remaining context than is actually available.

For example, a custom status indicator may report 25% remaining while the built-in warning simultaneously reports only 11% remaining. The ~14% gap represents system overhead that isn't reflected in the payload data.

Request

Either:

  • Include all context window consumers (system overhead included) in the existing context_window fields, or
  • Add separate fields for total vs. conversation-only usage so consumers can choose which to display

View original on GitHub ↗

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