Native context awareness for Claude and users
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
Currently, Claude Code has no native way to:
- Let Claude know how much context window is being used
- Let users easily see context usage status
- Trigger actions when context reaches certain thresholds
We had to build a complex workaround using:
- Status line script to read
context_window.used_percentageand write to file - Stop hook to check thresholds and create trigger files
- Manual CLAUDE.md instructions for Claude to check trigger files
- ANSI color codes for visual alerts
This requires 5 shell scripts + 3 config files + multiple hours of debugging to achieve what should be a
simple built-in feature.
Proposed Solution
- Expose context percentage to Claude directly
- Allow Claude to access
context.percentor similar variable - No need for external file-based workarounds
- Built-in threshold alerts
- Configurable thresholds (e.g., 30%, 60%, 90%, 99%)
- Visual indicator in status line when threshold crossed
- Optional hook trigger on threshold
- Declarative configuration
```json
{
"contextAlerts": {
"thresholds": [30, 60, 90, 99],
"showInStatusLine": true,
"onThreshold": ".claude/scripts/on-threshold.sh"
}
}
Alternative Solutions
_No response_
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
Why This Matters
- For users: Know when to save/summarize conversation before context runs out
- For Claude: Make better decisions about response length and complexity
- For productivity: Avoid losing important context due to unexpected truncation
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗