[FEATURE] Show conversation context length in status line or hook input

Resolved 💬 5 comments Opened Nov 27, 2025 by BobbyWang0120 Closed Jan 27, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When working with Claude Code, it's important to track the size of the current conversation context to avoid exceeding the model's context window. At the moment the only way to check context usage is to run the /context command manually. This interrupts the workflow and is cumbersome when you need to monitor context usage frequently while working. I tried to compute the token count using the values in the transcription file, but the total is always lower than what the official /context command reports, so it's not accurate. Having to constantly call /context to see how much context is used and how much remains is inconvenient and not user-friendly.

Proposed Solution

Expose the current conversation context length within the status line input or any hook input. This input should show the number of tokens used and optionally the remaining allowance, updating as the conversation grows. Making this information available via a status bar element or a hook variable would allow users to build scripts or extensions to calculate context window usage and automate decisions based on how much space is left, without having to call /context manually.

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

Example scenario:

  1. I'm working on a large Python project and collaborating with Claude Code to generate code and explanations.
  2. As the conversation grows, I want to keep track of how many tokens have been used so I don't exceed the context window and lose important information.
  3. With the proposed feature, the status line shows something like "30k tokens used", so I know how much capacity remains in real time.
  4. When the usage approaches the limit, I can decide to compact earlier parts of the conversation before continuing.

Additional Context

I attempted to compute context usage by summing the three input token values in the transcription .jsonl file, but the total is always lower than the official /context command. Therefore this method is not accurate; we need Claude Code to provide the exact value so users can trust it.

View original on GitHub ↗

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