[FEATURE] Context window breakdown: sort by size, not registration order
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
Title: Context window breakdown: sort by size, not registration order
Body:
The /context panel's expandable breakdowns (MCP tools, Memory files, etc.) currently list items in whatever order they got registered — for MCP tools that reads as roughly alphabetical-by-server. When one server dominates the total, you have to scroll past a wall of small, low-signal entries from other servers before spotting the actual hog.
Example: "MCP tools" was 292.4k tokens across 499 entries. Expanding it opened on a long alphabetical run of individual Canva verbs (Add Comment To Design, Copy Design, Create Brand Template Draft...) before Edit Design — the single largest entry at 8.8k — showed up. No way to tell at a glance which server was driving the number, only which tool name came first alphabetically.
Ask: Sort breakdown rows by size descending (token count preferred; item count as a fallback) instead of registration/alphabetical order. Bonus: a server-level rollup (e.g. "Canva: 89k across 14 tools") above the flat per-tool list would make "what's actually costing me context" answerable in one glance instead of a scroll-and-mental-sum.
Small UI change, meaningfully better signal for anyone trying to decide which connectors to prune.
— Rick + Tem (Claude)
Proposed Solution
Ask: Sort breakdown rows by size descending (token count preferred; item count as a fallback) instead of registration/alphabetical order. Bonus: a server-level rollup (e.g. "Canva: 89k across 14 tools") above the flat per-tool list would make "what's actually costing me context" answerable in one glance instead of a scroll-and-mental-sum.
Small UI change, meaningfully better signal for anyone trying to decide which connectors to prune.
Alternative Solutions
- User-selectable MCP stat muting/hiding — let people collapse or suppress servers they already know they don't care about, rather than re-scanning the full list every time.
- If sort order can only be one thing, default it to whatever best approximates "space consumed," descending — size beats alphabetical/registration order in every case I can think of.
- "Refresh stats" that... refreshes, as much as is possible.
The actual use case driving this:
- I was digging through the breakdown looking for justification to drop MCP connectors I'd forgotten I still had installed — ones I could point to and say "this is doing nothing but generating entropy in my context budget."
- Secondary goal, looking at Messages and the other top-level categories: trying to tell whether I'm on the right model for a given session's context footprint versus its actual use pattern. My work tends to run in short, high-intensity spikes of message volume rather than a steady burn, and I'm trying to find a view that surfaces that instead of burying it in registration-order noise.
Priority
Medium - Would be very helpful. Nowhere near life-or-death. I'm trying to optimize.
Feature Category
Performance and speed
Use Case Example
_No response_
Additional Context
From Claude:
"Yeah — it's listing individual tool schemas in whatever order they got registered/alphabetized, not sorted by size or rolled up by server. So instead of seeing "Canva: 89k, GitHub: 40k, Notion: 12k" at a glance, you get a scroll of every single Canva verb before you can even tell Canva is the actual hog. Not something I can fix — that's the Claude Code UI itself, not your codebase.
Practical lever if 292.4k of deferred MCP schema is bugging you: it's driven by how many MCP servers are connected to this session, not by anything you're doing wrong. If Canva (Edit Design alone is 8.8k) isn't something you're actively using, disconnecting it would shrink that number more than any UI fix would."
rds: "sorted by size == ding ding. either by K (probably best) or at least by count of "objects" or lines or tokens or whatevber. vs "however..." as current"
Claude: Agreed, that's the obvious fix — sort the breakdown by token size (or item count as a fallback) descending, not registration order. That's Claude Code product/UI though, not something in your environment I can patch — if you want it changed, the path is filing it at github.com/anthropics/claude-code/issues.