[BUG] Claude Skills context completely lost after auto-compaction, causing repeated errors and massive productivity loss

Resolved 💬 15 comments Opened Dec 13, 2025 by RomanAlexanderW Closed May 7, 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?

After auto-compaction occurs, Claude completely loses awareness of Claude Skills that were actively being used. Specifically:

  1. Claude forgets which skills were being used during the session
  2. Claude forgets the procedures/methodologies from those skills
  3. Claude does NOT proactively re-read the skill files after compaction
  4. Claude repeats errors that the skills were specifically designed to prevent
  5. Even explicit instructions in ~/.claude/CLAUDE.md telling Claude to reload skills after compaction are ignored

This causes simple coding tasks that should take ~1 hour to take 5-6+ hours, with constant circling back to repeat mistakes the skills were designed to prevent.

What Should Happen?

  1. Compaction summary should record which skill files were actively loaded/referenced during the session
  2. After compaction, Claude should automatically re-read those skill files before continuing work
  3. Or: Critical skill procedures should be preserved in the compaction summary itself
  4. At minimum: Claude should follow the post-compaction recovery instructions specified in ~/.claude/CLAUDE.md

Error Messages/Logs

No error messages - the issue is silent context loss. The only observable symptom is Claude suddenly not following skill procedures it was following moments before, and repeating previously-fixed mistakes. Once I realized what was happening, I asked Claude (Opus 4.5) why it wasn't using the Skills I had it invoke earlier ... and Claude had no idea what I was talking about, or any memory of having had used Skills earlier.

Steps to Reproduce

  1. Create a skill file at ~/.claude/skills/test-skill/SKILL.md with specific procedures:

---
name: test-skill
description: Test skill for reproduction
---

Test Skill

Required Procedure

When working on any task, ALWAYS:

  1. Say "SKILL ACTIVE" at the start of each response
  2. Follow the XYZ methodology
  3. Never do ABC (common mistake)
  1. Add post-compaction recovery instructions to ~/.claude/CLAUDE.md:

POST-COMPACTION PROTOCOL

After compaction, IMMEDIATELY:

  1. Re-read this file
  2. Re-read any skills that were in use
  3. Ask user which skills were being used

3.Start Claude Code in VS Code and begin a task that uses the skill

  1. Verify Claude says "SKILL ACTIVE" and follows the procedures
  2. Continue working until auto-compaction triggers (~55K tokens in VS Code extension)
  3. Observe after compaction: Claude no longer says "SKILL ACTIVE"
  4. Observe: Claude starts doing "ABC" (the thing the skill said never to do)
  5. Observe: Claude does not re-read the skill file or ask about skills, despite CLAUDE.md instructions

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.69 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Environment:

OS: Windows 10
Editor: VS Code Insiders with Claude Code Chat extension
Model: Claude Opus 4.5
Platform: Claude Pro Max ($200/mo subscription)

_Impact:_

| Without Skills Loss | With Skills Loss |

|---------------------|------------------|

| Task completed in ~1 hour | Task takes 5-6+ hours |

| Errors caught by skill procedures | Same errors repeated multiple times |

| Linear progress | Going in circles |

| Single compaction cycle | 4-6 compaction cycles, each losing more context |

Workaround attempted:

Added explicit post-compaction instructions to ~/.claude/CLAUDE.md (shown above in reproduction steps). Result: These instructions are also lost/ignored after compaction.

_Related issues:_

#1534 - Memory Loss After Auto-compact (closed, but issue persists)
#3021 - Forgets to Refresh Memory After Compaction
#8209 - Procedural Memory vs Episodic Memory
#10960 - Repository Path Changes Forgotten After Compaction
#11819 - Premature compaction threshold compounds this problem

Suggested solutions:

  1. Preserve skill references in compaction summary - Record file paths of skills that were read during the session
  2. Auto-reload skills post-compaction - After compaction completes, automatically re-read skill files that were in use
  3. Skills as protected context - Allow marking certain content (like skills) as "protected" from compaction summarization
  4. Honor CLAUDE.md post-compaction instructions - Ensure the recovery protocol in CLAUDE.md is followed

This bug makes Claude Skills essentially _unusable for any task that exceeds the premature compaction threshold (~55K tokens)_, which severely limits the value of this powerful feature.

View original on GitHub ↗

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