[BUG] Claude Skills context completely lost after auto-compaction, causing repeated errors and massive productivity loss
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:
- Claude forgets which skills were being used during the session
- Claude forgets the procedures/methodologies from those skills
- Claude does NOT proactively re-read the skill files after compaction
- Claude repeats errors that the skills were specifically designed to prevent
- 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?
- Compaction summary should record which skill files were actively loaded/referenced during the session
- After compaction, Claude should automatically re-read those skill files before continuing work
- Or: Critical skill procedures should be preserved in the compaction summary itself
- 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
- 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:
- Say "SKILL ACTIVE" at the start of each response
- Follow the XYZ methodology
- Never do ABC (common mistake)
- Add post-compaction recovery instructions to ~/.claude/CLAUDE.md:
POST-COMPACTION PROTOCOL
After compaction, IMMEDIATELY:
- Re-read this file
- Re-read any skills that were in use
- Ask user which skills were being used
3.Start Claude Code in VS Code and begin a task that uses the skill
- Verify Claude says "SKILL ACTIVE" and follows the procedures
- Continue working until auto-compaction triggers (~55K tokens in VS Code extension)
- Observe after compaction: Claude no longer says "SKILL ACTIVE"
- Observe: Claude starts doing "ABC" (the thing the skill said never to do)
- 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:
- Preserve skill references in compaction summary - Record file paths of skills that were read during the session
- Auto-reload skills post-compaction - After compaction completes, automatically re-read skill files that were in use
- Skills as protected context - Allow marking certain content (like skills) as "protected" from compaction summarization
- 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.
This issue has 15 comments on GitHub. Read the full discussion on GitHub ↗