[BUG] Skill invocations persist through context compaction and are re-executed as new requests

Resolved 💬 3 comments Opened Mar 28, 2026 by rbtcollins Closed Apr 24, 2026

Background

#28449 precisely captured my issue but was closed with a request that new bugs be opened. Reopening here with current version information.

What's wrong

Skill invocations (slash commands like /update-config, /plan) persist in the system-reminder registry across context compaction. After compaction, the model sees the stale invocation — including the original User Request text embedded in the skill's system-reminder — and acts on it as if it were a new user message, instead of resuming the actual in-progress task described in the compaction summary.

From #28449: "After compaction, the model sees stale invocations from previous sessions and acts on them — working on closed/irrelevant issues."

Specific reproduction (this session)

  1. Earlier in the session, user invoked the built-in /update-config skill with request: "configure vscode as my jj editor". Task completed successfully.
  2. Long coding session continues. Context compaction triggers automatically.
  3. After compaction, the update-config skill's system-reminder is still present in context, containing:

``
## User Request
configure vscode as my jj editor
``

  1. The compaction summary clearly states the current pending task (fixing a Rust source file).
  2. Model ignores the compaction summary and instead executes "configure vscode as my jj editor" as if it were a new request — checking jj editor config and reporting back to the user, who was mid-way through a coding task.

Expected behavior

From #28449:

  • Skill invocations should be scoped to the session/task that created them.
  • After compaction, only the current pending work (as described in the compaction summary) should drive the model's next action.
  • The ## User Request section of a skill's system-reminder should not survive compaction as an actionable instruction.

Why CLAUDE.md instructions don't fix this

Open issues #19471 and #6354 confirm that CLAUDE.md instructions are not reliably re-injected after compaction, making project-level workarounds ineffective.

Environment

  • Claude Code version: 2.1.83
  • Platform: Linux (WSL2) — Linux 6.6.87.2-microsoft-standard-WSL2 x86_64
  • Model: claude-sonnet-4-6
  • Skill affected: update-config (built-in)

Related issues

  • #28449 — exact same bug, closed stale 2026-03-25
  • #20466 — skill re-execution after compaction, also closed stale
  • #19471, #6354 — CLAUDE.md not re-injected after compaction (open)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗