[BUG] Clean boot sends skill catalog in both Skill tool schema and skill_listing message

Status Open
Reported on v2.1.241
Maintainer reply None cached
Activity 0 comments · opened Aug 24, 2026

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:

  1. Skill descriptions embedded in the built-in Skill tool definition. /context attributes these to Skills.
  2. A separate skill_listing attachment in the message stream containing the same skill names and descriptions. /context includes this attachment in Messages.

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 Skill tool schema and do not emit the initial skill_listing attachment.
  • 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

  1. Install many user skills under ~/.claude/skills/. Ensure skill names are unique.
  2. Set skillListingBudgetFraction to 0.02 to make the cost easy to observe.
  3. Start a new Claude Code CLI session.
  4. Send one short prompt.
  5. Run /context all and note the Skills and Messages totals.
  6. Inspect the session JSONL before the first assistant record. Observe one initial skill_listing attachment containing the discovered catalog.
  7. Confirm that /context all lists every skill only once. The excess is not duplicate scanning; it is the catalog's simultaneous presence in the Skill tool 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 /context and the system prompt
  • #35051: repeated skill system reminders for large registries
  • #56382: full catalog repeated after Skill tool 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.

View original on GitHub ↗