Feature Request: Per-MCP-server and per-plugin context window usage breakdown in status line input JSON
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, the context_window field in the status line input JSON only provides session-level totals (remaining_percentage, used_percentage, total tokens). When running multiple MCP servers and plugins, there is no way to see how much context each individual server or plugin is consuming. This makes it difficult to make informed decisions about which servers to enable or disable based on their context cost, especially when approaching context limits.
Proposed Solution
Add a mcp_servers and plugins breakdown within the context_window object in the status line input JSON. Each entry would show the token count consumed by that server/plugin (system prompt injections + tool definitions), along with a combined total for all MCP servers and all plugins. Example structure:
{
"context_window": {
"used_percentage": 45,
"remaining_percentage": 55,
"total_tokens": 200000,
"mcp_servers": {
"total_tokens": 8500,
"servers": {
"filesystem": { "tokens": 3200 },
"github": { "tokens": 4100 },
"postgres": { "tokens": 1200 }
}
},
"plugins": {
"total_tokens": 2000,
"plugins": {
"my-plugin": { "tokens": 2000 }
}
}
}
}
Alternative Solutions
No direct workaround exists within Claude Code. Users must manually estimate context usage by counting tokens in MCP server system prompts and tool definitions externally, which is tedious and error-prone. A separate diagnostic command (e.g., claude --show-context-breakdown) could also serve as an alternative if modifying the status line JSON is not feasible.
Priority
Medium - Would be very helpful
Feature Category
MCP server integration
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗