Feature Request: Per-skill token usage tracking
Feature Request: Per-Skill Token Usage Tracking
Submitted by: Eric H. Howard
Problem
When using Claude Code skills (e.g., /implement-work-item, /commit, custom skills), there is no way to see how many tokens a specific skill invocation consumed. This makes it difficult to:
- Understand cost per skill — Which skills are expensive vs. cheap to run?
- Optimize skill prompts — Without usage data, it's hard to know if a skill rewrite reduced token consumption
- Budget and plan — Teams evaluating Claude Code for workflows need to estimate per-task costs
- Debug context exhaustion — When a skill runs out of context, knowing where tokens went (main conversation vs. subagents vs. tool results) would help diagnose the issue
Current Behavior
/costshows cumulative session cost (API billing only; subscription plans just show "You are currently using your subscription")/contextshows current context window fill as a snapshot, not cumulative consumption- Subagent token usage (launched via Task tool) is not surfaced to the parent conversation at all
- No per-skill or per-invocation breakdown exists
Proposed Solution
Add a token usage summary that tracks per-skill invocations, ideally including:
| Metric | Description |
|--------|-------------|
| Skill name | Which skill was invoked |
| Main context tokens | Input + output tokens in the primary conversation |
| Subagent tokens | Total tokens consumed by Task tool subagents spawned during the skill |
| Tool result tokens | Tokens from tool call results (file reads, bash output, etc.) |
| Total tokens | Sum of all above |
This could be exposed via:
- A new
/usagecommand with per-skill breakdown - An addition to
/costoutput - A summary line printed when a skill completes (e.g., "Skill completed. Tokens used: 45,230 (main: 32,100, subagents: 13,130)")
Additional Context
This came up while running a complex multi-phase skill (implement-work-item) that orchestrates codebase exploration, architecture design, implementation, code review, git operations, and ADO/GitHub integration. The skill spawns multiple subagents and consumes significant context, but there's no visibility into the total cost of the run. This is especially relevant for teams evaluating Claude Code for production workflows where per-task cost tracking matters.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗