Statusline context_window.used_percentage doesn't match actual context usage
Problem
The context_window.used_percentage value provided in the JSON input to the statusLine command doesn't match the actual context usage displayed in the CLI UI.
Expected Behavior
When the UI displays "Context low (2% remaining)", the statusLine JSON input should report context_window.used_percentage at approximately 98%.
Actual Behavior
The statusLine receives context_window.used_percentage: 88% while the UI simultaneously shows "Context low (2% remaining)". This represents a consistent ~10% discrepancy between the JSON data and the actual context state.
Impact
Custom statusLine implementations cannot accurately display context usage to users, as the provided percentage doesn't reflect reality.
Configuration
Using a custom PowerShell statusLine command that reads from stdin:
"statusLine": {
"type": "command",
"command": "pwsh -NoProfile -File statusline-command.ps1"
}
The script reads $input.context_window.used_percentage and displays it, revealing the mismatch with the UI warning.
Steps to Reproduce
- Configure a custom statusLine command that displays
context_window.used_percentage - Continue a conversation until context is nearly exhausted
- Observe the UI showing "Context low (2% remaining)"
- Compare with the percentage shown in the statusLine (will be ~10% lower)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗