Compaction-continued sessions lose the skill inventory (skill_listing) — only deltas follow, model goes routing-blind to all skills
Summary
After auto-compaction, a continued session loses the skill inventory (skill_listing attachments) and the harness never re-injects it. Only delta announcements (newly created/changed skills) arrive afterwards. The model is then routing-blind to all previously registered skills: their trigger descriptions are absent from context, and the model's standing instruction ("only invoke a skill that appears in the available-skills list; never guess skill names") actively prevents it from using skills it can no longer see.
Environment
- Claude Code on macOS (darwin 24.3.0)
- ~85 skills registered (user-level
~/.claude/skills/+ plugins) - Session continued via auto-compaction ("This session is being continued from a previous conversation that ran out of context")
What happened (verified from the session JSONL)
- Pre-compaction: the full
skill_listingattachment appears 3× in the transcript — skill routing worked correctly (trigger phrases resolved to the right skills). - Context overflow → auto-compaction. The rebuilt window contains system prompt + CLAUDE.md + memory + summary — but no skill listing (it lived on discarded conversation turns).
- The continued session then ran for a full day (~1,100 transcript lines) with zero full skill listings. The only
skill_listingattachments in that window were deltas for a single newly created skill — so the model's "available skills" view contained exactly 1 of 85 skills. - Consequence: a user instruction ("codex review") that has a dedicated skill (
codex-review, with explicit trigger phrases and a warning to use the CLI, never the raw MCP tool) failed to route. The model, seeing only the similarly-named MCP tool in its context, invokedmcp__codex__codexinstead — which hung the session for ~3 hours on a passive wait. - Running
/reload-skills//reload-pluginsre-injected the full listing and restored routing immediately.
Expected
Compaction-continuation should re-inject the current skill inventory (same attachment as session start), since delta announcements assume a base listing that no longer exists in the rebuilt context.
Workarounds found
- Manual:
/reload-skillsafter any compaction. - Automatic: a
SessionStarthook (matchercompact) that emits the skill inventory into context.
Impact
Silent degradation: nothing errors, the model just stops seeing its skills. Sessions that rely on skill routing (procedures, safety-critical invocation patterns) misroute to raw tools — in our case turning a standard review procedure into a multi-hour hang.