[BUG] /compact and auto-compaction drop entire Available skills system-reminder; /reload-skills recovers with "no changes"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Both manual /compact and auto-compaction completely remove the "Available skills" <system-reminder> block from the model's context. After compaction, the model reports that no Available skills list exists — not just some skills missing, but the entire catalog is gone.
Running /reload-skills after compaction prints:
Reloaded skills: 33 skills available (no changes)
The (no changes) output confirms the underlying skill registry is intact — no skill files were added, removed, or modified. Yet after /reload-skills, the model can immediately see all 33 skills again.
This means the bug is specifically in the post-compaction re-injection of the Available skills system-reminder into the model context, not in the skill registry itself.
What Should Happen?
After compaction (both manual and auto), the Available skills system-reminder should be re-injected into the model context, just as it is at session start. The model should retain awareness of all registered skills without requiring the user to manually run /reload-skills.
Error Messages/Logs
Note: The initial count (27) differs from the post-reload count (33) — this is likely a model counting error, not a registry change./reload-skillsconfirmed(no changes), meaning no skills were added or removed. A separate auto-compaction test showed a consistent 33 → gone → 33 cycle.
❯ List the number of skills shown in the Available skills system-reminder
in your current context. Do not read any files — only use what is
already in your context.
27 skills.
❯ I'm investigating a compaction bug.
Read about 10 files to fill the context window.
Reading about 10 files from the project.
Searched for 1 pattern, read 10 files
Read 10 files (floodfill.ts, math.ts, outline.ts, ops.ts, quantizer.ts,
processor.ts, colorUtils.ts, worker.ts, detector.ts, types.ts).
Context window consumption goal achieved. What should I investigate next?
❯ /compact
⎿ Compacted (ctrl+o to see full summary)
❯ List the number of skills shown in the Available skills system-reminder
in your current context. Do not read any files — only use what is
already in your context.
I checked the current context, but there is no "Available skills"
system-reminder block. What I can see is "Available agent types"
(claude, claude-code-guide, Explore, general-purpose, Plan,
statusline-setup — 6 types) and the deferred tools list only.
Therefore, the accurate answer is: "There is no Available skills list
in the current context."
❯ /reload-skills
⎿ Reloaded skills: 33 skills available (no changes)
❯ List the number of skills shown in the Available skills system-reminder
in your current context. Do not read any files — only use what is
already in your context.
The Available skills system-reminder in the current context lists
33 skills.
<details>
<summary>Raw console output (Japanese)</summary>
▐▛███▜▌ Claude Code v2.1.202
▝▜█████▛▘ Sonnet 5 with medium effort · Claude API
▘▘ ▝▝ ~/dev/PixelRefiner
❯ 現在コンテキストに表示されている Available skills の system-reminder に載っているスキルの個数を教えてください。
ファイルは一切読まず、今のコンテキスト内にある情報だけで回答してください。
27個です。
✻ Cooked for 2s
❯ コンパクションにおける不具合を調査します。
コンテキストウィンドウを埋めるために、10圏程度のファイルを読み込んでください。
プロジェクト内のファイルを10個ほど読み込みます。
Searched for 1 pattern, read 10 files
10ファイルほど読み込みました(floodfill.ts, math.ts, outline.ts, ops.ts, quantizer.ts, processor.ts, colorUtils.ts, worker.ts, detector.ts, types.ts)。コンテキストウィンドウの消費目的は達成できたはずです。次に何を調査しますか?
✻ Worked for 20s
❯ /compact
⎿ Compacted (ctrl+o to see full summary)
Read ../../.claude/memory/MEMORY.md (7 lines)
Referenced file src/core/processor.ts
Read AGENTS.md (42 lines)
Read src/shared/types.ts (66 lines)
Referenced file src/core/quantizer.ts
❯ 現在コンテキストに表示されている Available skills の system-reminder に載っているスキルの個数を教えてください。
ファイルは一切読まず、今のコンテキスト内にある情報だけで回答してください。
現在のコンテキストを確認しましたが、"Available skills" という system-reminder ブロックは表示されていません。見えているのは「Available agent types」(claude, claude-code-guide, Explore, general-purpose, Plan, statusline-setup の6種)と、deferred tools のリストのみです。
そのため、この質問に対しては「現在のコンテキスト内に Available skills の一覧は存在しない」というのが正確な回答になります。
✻ Baked for 5s
❯ /reload-skills
⎿ Reloaded skills: 33 skills available (no changes)
❯ 現在コンテキストに表示されている Available skills の system-reminder に載っているスキルの個数を教えてください。
ファイルは一切読まず、今のコンテキスト内にある情報だけで回答してください。
現在のコンテキストに表示されている Available skills の system-reminder には、33個のスキルが記載されています。
</details>
Steps to Reproduce
- Start a new session in a project with registered skills (global and/or project-level)
- Ask the model to count available skills from its context (without reading files) — confirms baseline count
- Fill the context window by reading ~10-30 source files
- Run
/compact(or continue filling until auto-compaction fires) - Ask the model to count available skills again — it reports the Available skills list is completely missing from context
- Run
/reload-skills— printsN skills available (no changes) - Ask the model to count again — full skill list is restored
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.202 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Model: Reproduced with both Sonnet 5 and Opus 4.6.
OS: macOS 15.7.7
Terminal: Ghostty 1.3.1
Key observation
/reload-skills reports (no changes) — the skill registry never lost any skills. The issue is purely that the compaction process does not re-inject the Available skills <system-reminder> block into the post-compaction context.
The same behavior is confirmed with auto-compaction as well — after auto-compaction fires, the entire Available skills catalog disappears from context and /reload-skills recovers it with (no changes).
Related issues
This is a known class of problems that has been reported multiple times but never received an official fix:
- #13919 — Skills context completely lost after auto-compaction (closed as stale, no Anthropic response)
- #27703 — Project-level skills disappear from available list mid-session (closed as duplicate)
- #43092 — Project-level skills intermittently become 'Unknown skill' (closed as stale)
- #61485 — /reload-plugins does not re-inject available-skills context (closed as duplicate)
This report differs from the above in that:
- All skills disappear (not just project-level — the entire catalog is gone)
- Both manual and auto-compaction are confirmed to exhibit the same behavior
- The
(no changes)output from/reload-skillsdefinitively proves the registry is intact and the issue is in context re-injection - A clear reproduction procedure is provided
Current workaround
Run /reload-skills immediately after every /compact or auto-compaction event.
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
This is closely related but appears to be a distinct, more severe failure mode — filing as #76161 for cross-reference.
#76161 is specifically about scoped skills (nested
.claude/skills/discovered lazily) becoming hard-uninvocable after compaction (Skill()returnsUnknown skill), whereas this issue reports the registry staying intact with/reload-skillsshowing "(no changes)". The scoped-skill case has a second root cause:dynamicSkillDirs(skills/loadSkillsDir.ts) is not reset on compaction (in addition tosentSkillNames), so lazy re-discovery never re-fires on subsequent in-scope reads. A fix that only re-injects the Available-skills system-reminder would not resolve it.Confirmed on 2.1.211 (macOS, Anthropic API), with a variant worth noting: after auto-compaction the Available skills reminder was not fully gone. It was re-injected containing only the one skill that had been invoked before compaction, 1 of 24 installed.
Real-world consequence, not just a wrong count: I asked the continued session to "send a letter to <repo>". A skill whose description lists that exact phrase as a trigger (
agent-love-letters) never fired, because it wasn't in the post-compaction list and the Skill tool instructions tell the model not to invoke names outside the list. The model improvised a wrong deliverable instead, and it took three corrections before it found the skill by listing~/.claude/skills/on disk.So the partial re-injection case is arguably worse than the fully-missing case: the model sees a skills list, has no reason to suspect it is incomplete, and silently degrades instead of failing loudly.
Losing the full skills list after compaction (and having to manually
/reload-skillsto get it back) is annoying as hell when you’re relying on that context.We’ve been thinking a lot about state hygiene and making sure important runtime context doesn’t just evaporate on compaction or restarts. Small things like this add up fast when you’re running real workflows.
You hitting this regularly or was it a one-off surprise?
https://github.com/keesan12/martin-loop
I noticed this today, the default behavior should clearly be to keep skill metadata available after compaction. Claude suggested adding this hook as a fix which appears to be working, in that post-compaction it now reports all skills as available.