[BUG] Clean boot sends skill catalog in both Skill tool schema and skill_listing message
Preflight Checklist
- [x] I searched existing issues. The adjacent reports below cover duplicated entries within one list or repeated catalogs after tool calls; this report covers two different catalog representations on one clean boot.
- [x] This is a single bug report.
- [x] I am using the latest Claude Code version (
2.1.241).
What's Wrong?
On a clean interactive CLI boot, Claude Code sends the discovered skill catalog in two model-visible representations:
- Skill descriptions embedded in the built-in
Skilltool definition./contextattributes these toSkills. - A separate
skill_listingattachment in the message stream containing the same skill names and descriptions./contextincludes this attachment inMessages.
The entries are not duplicated inside either individual list. The duplication is across the tool schema and message attachment.
With 247 discovered skills and skillListingBudgetFraction: 0.02, the measured clean-session costs were approximately:
| Representation | Approximate tokens |
|---|---:|
| Skill metadata in the Skill tool | 19.9k |
| Initial skill_listing message attachment | 16.4k |
| Combined skill discovery cost | 36.3k |
The first provider request contained exactly 72,624 input tokens (input_tokens + cache_creation_input_tokens + cache_read_input_tokens) before any tool result or substantive conversation. After one short greeting and Claude's startup inspection, /context showed 77.7k total, including Skills: 19.9k and Messages: 31.7k.
The initial transcript contains one skill_listing record with 247 unique skill names. The /context all skill table also contains each skill once. This rules out duplicate directory scanning or duplicate entries within one registry.
This is a context and cost issue. Large skill registries lose tens of thousands of tokens before useful work starts.
What Should Happen?
The model should receive one canonical skill catalog representation.
Possible fixes:
- Keep the catalog only in the
Skilltool schema and do not emit the initialskill_listingattachment. - Keep the initial attachment and remove the catalog from the tool schema.
- Emit only skill deltas after the initial canonical catalog.
skillListingBudgetFraction should limit the total skill discovery cost, not independently permit two catalog representations.
Error Messages/Logs
No runtime error is displayed. The problem is visible through API usage fields, /context, and the session JSONL.
First API request:
input_tokens: 2
cache_creation_input_tokens: 72622
cache_read_input_tokens: 0
total input context: 72624
Initial message-stream attachment:
type: skill_listing
skillCount: 247
compact JSON length: 65,762 characters
estimated size at Claude Code's 4-chars/token estimator: 16,440 tokens
Steps to Reproduce
- Install many user skills under
~/.claude/skills/. Ensure skill names are unique. - Set
skillListingBudgetFractionto0.02to make the cost easy to observe. - Start a new Claude Code CLI session.
- Send one short prompt.
- Run
/context alland note theSkillsandMessagestotals. - Inspect the session JSONL before the first assistant record. Observe one initial
skill_listingattachment containing the discovered catalog. - Confirm that
/context alllists every skill only once. The excess is not duplicate scanning; it is the catalog's simultaneous presence in theSkilltool metadata and the message attachment.
Claude Model
Opus
Is this a regression?
I don't know.
Claude Code Version
2.1.241 (Claude Code)
Platform
Anthropic API / Claude subscription authentication
Operating System
macOS
Terminal/Shell
Other (zsh interactive CLI)
Additional Information
Adjacent but distinct reports:
- #27721: duplicate plugin skill entries within one system-prompt list
- #29520: duplicate plugin entries in
/contextand the system prompt - #35051: repeated skill system reminders for large registries
- #56382: full catalog repeated after
Skilltool invocations
This report is specifically about two different skill-catalog mechanisms being active simultaneously on the first clean request, with no skill invocation and no duplicate entries inside either catalog.