Skip to content

Add context usage/percentage to statusLine JSON input #10557

Closed as duplicate

Description

@spm1001

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.

Activity

  1. github-actions commented on Oct 29, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. Feature Request: Context data access in statusline hooks #6577
    2. [FEATURE] Include Token Usage in Status Line JSON #10436
    3. [FEATURE] Expose /usage data in statusLine JSON input #8464

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. spm1001 commented on Oct 29, 2025

    @spm1001
    Author

    Closing as dupe. It would be super useful. The inbuilt system does it but only below a threshold.

  3. github-actions commented on Nov 5, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions