[BUG] Hiding skills doesn't reduce total context: tokens removed from the Skills row reappear in System tools (exact 1:1, 3/3 configs)

Status Open
Reported on v2.1.226
Maintainer reply None cached
Activity 1 comment · opened Aug 10, 2026

Summary

Hiding skills from context does not reduce total context usage. Instead, the exact number of tokens removed from the Skills row in /context reappears in the System tools row, leaving the total unchanged.

I measured three configurations on the same machine, same session type, minutes apart. The total is identical to the token in all three — 27.116k — while Skills fell from 3.9k to 800 tokens.

This is a zero-sum transfer, not a coincidence or measurement noise.

Environment

  • Claude Code version: 2.1.226
  • Model: claude-opus-5[1m] (Opus 5, 1M context)
  • Platform: macOS 26.6.1 (Darwin 25.6.0), Apple Silicon
  • Install: native
  • Relevant settings: ENABLE_TOOL_SEARCH=auto:0.5, CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000

Measurements

Every row of /context for each configuration:

| Row | A: baseline | B: disable-model-invocation on 28 commands | C: B + disableBundledSkills: true |
|---|---|---|---|
| System prompt | 3.4k | 3.4k | 3.4k |
| System tools | 18k | 19.1k | 21.1k |
| Custom agents | 408 | 408 | 408 |
| Memory files | 1.4k | 1.4k | 1.4k |
| Skills | 3.9k (49 skills) | 2.8k (22 skills) | 800 (7 skills) |
| Messages | 8 | 8 | 8 |
| MCP tools | 0 (122 tools, deferred) | 0 (117 tools, deferred) | 0 (122 tools, deferred) |
| Reported total | 27.1k | 27.1k | 27.1k |
| Free space | 939.9k (94.0%) | 939.9k (94.0%) | 939.9k (94.0%) |

Summing the categories:

A: 3.4 + 18.0 + 0.408 + 1.4 + 3.9 + 0.008 = 27.116k
B: 3.4 + 19.1 + 0.408 + 1.4 + 2.8 + 0.008 = 27.116k
C: 3.4 + 21.1 + 0.408 + 1.4 + 0.8 + 0.008 = 27.116k

Skills: −3.1k. System tools: +3.1k. Total: 0.

Steps to reproduce

  1. Start from a setup with a substantial number of skills and custom commands. Run /context, record every row.
  2. Add disable-model-invocation: true to the frontmatter of a batch of commands in ~/.claude/commands/. Restart. Run /context.
  • Skills row drops, and the skill count drops correspondingly.
  • System tools row rises by the same amount.
  • Total unchanged.
  1. Add { "disableBundledSkills": true } to settings.json. Restart. Run /context.
  • Skills row drops again.
  • System tools row rises by the same amount again.
  • Total unchanged.

Expected behavior

Removing skills from the model's context should reduce the total context consumed. If a skill is not listed to the model, its bytes should not be in the request payload, and the total in /context should fall.

Actual behavior

The total never moves. Tokens migrate from the Skills row into the System tools row in exact proportion.

What does appear to work

The functional side of these settings is correct and I want to be clear about that:

  • The skill count genuinely drops (49 → 22 → 7).
  • Claude confirms in-session that it can no longer see or invoke the hidden commands and bundled skills.
  • disable-model-invocation correctly blocks the Skill tool.

So this is not "the setting does nothing." It is specifically that the token cost is not released, which is the primary reason most users reach for these settings.

Why this may not be a duplicate

  • #38680 (Disabled skills still consume context tokens) — same family, but auto-closed as a duplicate three days after filing, and it covers disabledSkills only. It contains no per-row measurements.
  • #30480 ([BUG] disabled system tools still consume the context) — the issue #38680 was closed against. It is CLOSED/NOT_PLANNED and scoped to disabledTools and native tool schemas.
  • #14882 (Skills consume full token count at startup instead of progressive disclosure) — open and closely related. A commenter there reports the same symptom informally ("I removed all skills and they no longer show on /context, but context hasn't gone down"), but with no measurements and no identification of where the tokens go.

The new information here is the destination: the tokens do not merely fail to disappear, they are re-attributed to System tools in an exact 1:1 trade. That points at a specific accounting or payload-construction path rather than a general "skills load eagerly" complaint, and it reproduces across two independent mechanisms (disable-model-invocation frontmatter and disableBundledSkills).

Two possible readings

Either would be worth confirming:

  1. Accounting bug. The bytes really do leave the payload, but /context computes System tools as a residual (total minus attributed categories), so the saving is hidden and the total is misreported. Users cannot tell whether their optimization worked.
  2. Payload bug. The bytes stay in the request and are simply re-labeled. The settings deliver invocation control but no token saving at all.

Reading 1 is a reporting defect; reading 2 means the documented benefit of disable-model-invocationthe docs state it "removes the skill from Claude's context entirely" — is not delivered. Either way the current behavior is misleading, because /context is the tool users are directed to for verifying exactly this.

Impact

/context is the sanctioned way to verify context optimization, and disableBundledSkills / disable-model-invocation / skillOverrides are the sanctioned levers. Right now the instrument reports no improvement no matter which lever is pulled, so users cannot tell a working optimization from a no-op. In my case the numbers are small in absolute terms (1M window), but the ratio is what matters: 100% of the reduction was cancelled, three times out of three.

Related

  • #38680 (closed as duplicate)
  • #30480 (closed, not planned)
  • #14882 (open)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗