[BUG] Skill invocations persist across /clear and context compaction

Resolved 💬 4 comments Opened Feb 25, 2026 by TimZenit Closed Mar 25, 2026

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?

Summary

Skill invocations (slash commands like /plan, /build) persist in the
system-reminder registry across /clear commands and across context
compactions. After compaction, the model sees stale invocations from
previous sessions and acts on them — working on closed/irrelevant issues.

What Should Happen?

### Expected Behavior

  • /clear should reset the skill invocation registry
  • Skill invocations should be scoped to the session that created them
  • After compaction, only the CURRENT session's skill invocations should be visible

Error Messages/Logs

Steps to Reproduce

Reproduction (from real session data)

  1. Session 02cd2df4 at 05:57 — user invokes /plan 719
  2. User runs /clear to start fresh
  3. Session 9ab0840f at 08:27 — user invokes /build 667
  • After compaction, model sees BOTH /build 667 and stale /plan 719
  • Model works on closed #719 instead of #667
  1. User runs /clear again
  2. Session ddf63025 at 09:35 — user invokes /build 665
  • After compaction, model AGAIN sees both /build 665 and stale /plan 719
  • Model AGAIN works on closed #719 instead of #665

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Opus 4.6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

Evidence from debug logs

Session transcript ddf63025 confirms:

  • Zero user messages contain "/plan" or "719"
  • The /plan 719 exists only in <system-reminder> tags
  • /clear was issued at the start of the session (line 2)
  • The stale invocation originated in session 02cd2df4

### Impact

  • Two full context windows wasted (~200k tokens each)
  • Model created spurious GitHub issues, PRs, and branches for closed work
  • No workaround exists — /clear doesn't fix it, only a new terminal process does

### Environment

  • Claude Code CLI v2.1.52
  • macOS Darwin 25.3.0 & Warp v0.2026.02.18.08.22.stable_02
  • Model: Claude Opus 4.6

### Session IDs (for internal debugging)

  • Origin: 02cd2df4-e6d5-451f-ab77-2305e90ffb37
  • First leak: 9ab0840f-3d38-4e76-a710-43f72ff6cb52
  • Second leak: ddf63025-5cff-46eb-93c3-37589f167356

Workaround

Added explicit ignore rules in CLAUDE.md project instructions, but this
is fragile and issue-specific. Only a real fix in the skill registry
persistence layer will prevent this class of bug.

View original on GitHub ↗

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