Skip to content

Add input token breakdown to Token Usage Metadata #120

@matifali

Description

@matifali

Description

As discovered in #119, the Token Usage Metadata display currently shows zeros even when significant tokens are being consumed. Investigation revealed that extra input tokens come from:
• Coder's MCP tool injection - adds tokens not reflected in metadata
• For CLI or IDE Agents - includes a long system prompt

Problem

• Simple messages like "Hello from Zed" consume ~6000+ input tokens in Text mode (No System prompt)
• Agent mode consumes ~11000+ input tokens (System prompt)
• Users cannot see where these tokens originate since metadata shows all zeros

Image

Proposed Solution

Capture and display a breakdown of input token sources in the Token Usage Metadata, including:
• Prompt tokens (user message)
• System prompt tokens
• Injected tokens (MCP tools, editor context, etc.)

Acceptance Criteria:

• Token Usage Metadata accurately reflects actual token consumption
• Users can see the breakdown of token sources (prompt vs system vs injected)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions