Add context usage/percentage to statusLine JSON input

Resolved 💬 3 comments Opened Oct 29, 2025 by spm1001 Closed Oct 29, 2025

Feature Request

Add context usage information to the JSON input provided to statusLine commands.

Motivation

The status line currently provides useful information (model, directory, git status), but doesn't include context usage - one of the most important pieces of information during a session. Users want to see how much context budget remains at a glance.

Key Evidence: This Information Already Exists

Claude Code already tracks context usage - evident from the low context warning that appears when approaching limits. If the system can detect when context is running low, it must be tracking token usage internally.

The question is just exposing this information to the status line interface.

Proposed Solution

Add context usage fields to the JSON input structure passed to statusLine commands:

{
  "context_tokens_used": 45000,
  "context_tokens_limit": 200000,
  "context_percentage_used": 22.5,
  "model": { ... },
  "workspace": { ... }
}

At minimum, providing context_percentage_used would enable users to display "22% context used" or "78% remaining" in their status lines.

Alternative Formats

If the above is too specific, any of these would work:

  • context_used / context_limit (raw numbers)
  • context_remaining (calculated remaining)
  • context_percentage (0-100)

Use Case

As a user working on complex tasks, I want to see context usage in my status line so I can:

  • Know when to summarize or start fresh
  • Plan whether to continue current work or wrap up
  • Avoid hitting context limits unexpectedly

This is especially valuable for long sessions or when using extended context models.

View original on GitHub ↗

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