anthropics / anthropics/claude-code

Desktop app context-window breakdown shows 90% free while header shows 60% used

Open
#94,436 0 comments 0 reactions 0 assignees View on GitHub
area:desktop area:ui bug platform:windows
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

## Summary
In the Claude Code desktop app (Code tab, Windows), the **Context window** popover header shows the correct total, but the per-category breakdown below it does not add up and reports ~90% free space for a session that is actually 60% full.

## What I saw
Header: `598.5k / 1M (60%)`

Breakdown rows in the same popover:

| Row | Tokens | % |
|---|---|---|
| System tools | 18.6k | 1.9% |
| Memory files | 14.7k | 1.5% |
| Messages | 13.4k | 1.3% |
| System prompt | 10.8k | 1.1% |
| Skills | 4.3k | 0.4% |
| Custom agents | 529 | 0.1% |
| Autocompact buffer | 33k | 3.3% |
| **Free space** | **904.6k** | **90.5%** |

The rows sum to ~95k, so "Free space" is computed as 1M minus ~95k, ignoring ~500k of real context.

## Verification
I read the session's transcript JSONL. The last assistant message's `usage` was:

```
input_tokens=32 cache_creation_input_tokens=644 cache_read_input_tokens=597573
```

That is 598,249 tokens, matching the header. The session had 174 assistant turns over ~1h12m with many tool results (file reads, command output, subagent reports). "Messages 13.4k" appears to count only message text and omits tool results, which are the bulk of the context.

## Expected
The category rows and "Free space" should reconcile with the header total (i.e. tool results/conversation content should be attributed, and free space should be ~400k / 40%).

## Environment
- Claude Code 2.1.272, desktop app (Code tab)
- Windows 11 Home 10.0.26200
- Model: Fable 5.1, effort High, bypass permissions
- Session running in a git worktree, launched by a scripted chain (`claude` non-interactive launch, then viewed in the desktop app)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.