Skills
Claude Code System Prompt Compaction: Auto-Trim System Prompts to Fight Context Drift in Long Sessions — But Critical Rules Must Live in CLAUDE.md
Claude Code now includes automatic system prompt compaction that trims prompts to prioritize essential instructions when context windows approach capacity. However, the key practitioner insight is what NOT to rely on it for: everything the agent must always remember should live in CLAUDE.md (loaded at every turn), not in conversation context that gets compacted. For sessions over 60 minutes, proactive preservation beats reactive recovery. Best practice: use /compact manually at natural breakpoints, keep CLAUDE.md as the source of truth for invariant rules, and treat compacted context as lossy.
↳ Follow the thread