Skip to content
Back to skills

2578 Compaction Survival D2eeedfb

ASecurity

Long Claude Code sessions automatically compress earlier conversation to stay within the context window. This is invisible — there's no warning. After compaction, detailed reasoning and nuance from earlier in the conversation is lost.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
code-qualitygodebugginggit

Works with

  • claude code

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2578-compaction-survival_d2eeedfb --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2578 Compaction Survival D2eeedfb?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2578 Compaction Survival D2eeedfb
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2578-compaction-survival-d2eeedfb/badge)](https://www.skillsdirectory.com/skills/tools-only-2578-compaction-survival-d2eeedfb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Context Compaction Survival

## What Is Compaction?

Long Claude Code sessions automatically compress earlier conversation to stay within the context window. This is invisible — there's no warning. After compaction, detailed reasoning and nuance from earlier in the conversation is lost.

## What Survives vs What's Lost

| Survives | Lost |
|----------|------|
| Files on disk (SESSION.md, CLAUDE.md) | Conversation details and reasoning |
| Git commits and their messages | Why a decision was made (unless written down) |
| Tool output summaries | Nuanced understanding built up over many exchanges |
| Recent messages (post-compaction) | Earlier trial-and-error context |

## Rules

1. **Write discoveries to files immediately** — if you find a gotcha, command, or pattern, add it to CLAUDE.md now, not "when we wrap up"
2. **Use sub-agents for heavy operations** — sub-agent context is separate from yours, so reading 20 files in a sub-agent doesn't consume your main context
3. **Checkpoint before context fills up** — don't wait for compaction to happen; checkpoint at milestones
4. **Git commits are your safety net** — WIP commits preserve exact file state even if SESSION.md is vague
5. **Make SESSION.md self-sufficient** — a fresh session reading only SESSION.md + CLAUDE.md should know exactly what to do next

## When to Checkpoint

- After completing a logical unit of work (a function, a component, a migration)
- Before attempting something risky (major refactor, dependency upgrade, destructive operation)
- When context feels large (many files read, long back-and-forth debugging)
- Before switching to a different area of the codebase

## Anti-Patterns

| Anti-Pattern | Why It Fails |
|-------------|--------------|
| "I'll update SESSION.md at the end" | Compaction happens mid-session — you lose the context to write a good summary |
| Vague resume instructions | Next session wastes time re-discovering what you already knew |
| SESSION.md over 100 lines | Defeats the purpose — becomes another doc to maintain instead of a quick handoff |
| Checkpointing every 5 minutes | Creates noise; checkpoint at milestones, not on a timer |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.