Describe the bug
Status line used_percentage does not reflect actual context window usage
The context_window.used_percentage field in the status line JSON does not match the context utilization reported by /context.
Observed behavior
used_percentage starts at 0% on session start or resume, regardless of existing context
- It grows disproportionately to actual context usage reported by
/context until it maxes out at 100%
/context reports stable, plausible values throughout (e.g. ~20-22%)
| Point in session |
Status line used_percentage |
/context |
| After resume, before first message |
0% |
~20% |
| After first post-resume message |
16% |
~20% |
| After several more exchanges |
100% |
22% |
Affected version
v1.0.3
Steps to reproduce the behavior
- Configure the status line script in
~/.copilot/config.json (see example below)
- Enable the experimental status line feature: run
/experimental on and restart Copilot CLI
- Start a new session and exchange several messages
- Compare the status line's reported percentage with
/context output
- Continue exchanging messages and observe the status line percentage grow while
/context remains stable
- Exit and resume session.
- Status line percentage resets to 0.
- Repeat Steps 3, 4, and 5.
Minimal script to reproduce -- displays used_percentage as reported in the status line JSON:
#!/usr/bin/env bash
input=$(cat)
used=$(echo "$input" | jq -r '.context_window.used_percentage // "n/a"')
echo "ctx: ${used}%"
Config in ~/.copilot/config.json:
{
"status_line": {
"type": "command",
"command": "/absolute/path/to/statusline.sh"
}
}
Expected behavior
used_percentage should reflect the same context window utilization as /context
Additional context
- Copilot CLI v1.0.3
- macOS 15 (Darwin 24.6.0)
- Status line feature enabled via
/experimental on
Describe the bug
Status line
used_percentagedoes not reflect actual context window usageThe
context_window.used_percentagefield in the status line JSON does not match the context utilization reported by/context.Observed behavior
used_percentagestarts at 0% on session start or resume, regardless of existing context/contextuntil it maxes out at 100%/contextreports stable, plausible values throughout (e.g. ~20-22%)used_percentage/contextAffected version
v1.0.3
Steps to reproduce the behavior
~/.copilot/config.json(see example below)/experimental onand restart Copilot CLI/contextoutput/contextremains stableMinimal script to reproduce -- displays
used_percentageas reported in the status line JSON:Config in
~/.copilot/config.json:{ "status_line": { "type": "command", "command": "/absolute/path/to/statusline.sh" } }Expected behavior
used_percentageshould reflect the same context window utilization as/contextAdditional context
/experimental on