claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] /context command shows full skill tokens instead of loaded metadata tokens

Open PaulRBerg opened this issue 1 month ago • 10 comments

What went wrong?

The /context command displays the absolute token count for skills (the full SKILL.md content), not the minimal amount of tokens they actually consume at startup (only name and description from the YAML frontmatter).

This confuses users because it appears as though all skill tokens are loaded into context, when in fact skills use progressive disclosure—only their metadata (~100 tokens per skill) is loaded initially, with full content loaded on-demand when triggered.

What should happen?

The /context command should either:

  1. Display the actual tokens consumed (just name + description metadata), or
  2. Clearly indicate that the displayed token count is the "potential maximum" vs "currently loaded" amount, or
  3. Show both values (e.g., "50 / 2,500 tokens" meaning 50 loaded, 2,500 if fully activated)

Steps to reproduce

  1. Install several skills (user or project level)
  2. Run /context command
  3. Observe that skills show their full token counts
  4. Compare to actual context usage—skills aren't fully loaded until triggered

Environment

  • Version: 2.0.74 (Claude Code)
  • OS: macOS 26.2 (Tahoe)
  • Terminal: Warp v0.2025.12.17.17.17.stable_02

Is this a regression?

Don't know - this may have always been the behavior, but it's misleading given the progressive disclosure architecture.

PaulRBerg avatar Dec 20 '25 06:12 PaulRBerg

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9425
  2. https://github.com/anthropics/claude-code/issues/14785
  3. https://github.com/anthropics/claude-code/issues/12841

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 20 '25 06:12 github-actions[bot]

And I think this bug applies to slash commands and plugins, too.

PaulRBerg avatar Dec 20 '25 06:12 PaulRBerg

Hope they get to this soon. It's been several days of increased token usage and degraded experience as a result. This should be close to top priority / urgent. Each passing day is probably causing millions of wasted tokens for both users and Claude. I've also felt a decrease in quality due to the large amount of mixed context loaded into conversations.

leuquim avatar Dec 24 '25 15:12 leuquim

can confirm this.

turbo-soft avatar Dec 25 '25 18:12 turbo-soft

can reproduce, MacOS, Claude Code 2.0.76

rsc-soxes avatar Dec 27 '25 12:12 rsc-soxes

It's been several days of increased token usage and degraded experience as a result.

Your increased token usage is due to a different reason.

As far as I can see, the bug I reported here is merely a visual/informational issue (albeit an important one). The skills are loaded correctly (i.e. only their metadata).

PaulRBerg avatar Dec 28 '25 08:12 PaulRBerg

It's been several days of increased token usage and degraded experience as a result.

Your increased token usage is due to a different reason.

As far as I can see, the bug I reported here is merely a visual/informational issue (albeit an important one). The skills are loaded correctly (i.e. only their metadata).

You're right, I think I'm confusing your issue with a separate problem. Claude Code now treats slash commands in a similar way as skills, and "eager loads" their metadata into context regardless of them using frontmatter or not. The issue with the /context command is separate, they just need to clarify it's showing the "total token count that would load if invoking a given skill or command" and not the "currently loaded tokens for a given skill or command".

leuquim avatar Dec 28 '25 15:12 leuquim

yep.

at any rate, it's a mess

PaulRBerg avatar Dec 28 '25 16:12 PaulRBerg