Install
openclaw skills install shedContext window hygiene for long-running LLM agents. Decision rules for when and how to compress, mask, switch, or delegate context — backed by research (JetBrains/NeurIPS 2025, OpenHands, Letta/MemGPT, LLMLingua). Use when an agent runs for extended sessions, accumulates large tool outputs, approaches context limits, or suffers from compaction/overflow. Also use when designing agent architectures that need to manage context over time.
openclaw skills install shedShed what you don't need. Keep what matters.
Named for molting — the process of shedding an outer layer to grow. Your context window is your skin. When it gets too heavy, shed the dead weight.
Tool outputs are 84% of your context growth but the lowest-value tokens you carry. (Lindenbauer et al., NeurIPS 2025 DL4C workshop, measured on SWE-agent). Everything flows from this.
ls -la from 20 turns ago.memory/YYYY-MM-DD.md. Future-you needs a trailhead, not a transcript.Don't assume sophisticated compression (LLM summarization) beats simple approaches (observation masking). The JetBrains "Complexity Trap" paper (2025) tested both across 5 model configurations on SWE-bench Verified:
The lesson: start simple. Mask tool outputs. Only add summarization if masking alone isn't enough.
Without intervention, cost per turn scales quadratically (each turn adds tokens AND reprocesses all previous tokens). Periodic condensation converts this to linear scaling. OpenHands measured 2x cost reduction with their condenser.
| Situation | Action |
|---|---|
| Tool returned big output | Extract facts → file → discard raw |
| Context at ~70% | Mask old tool outputs |
| Context still growing after masking | Summarize oldest reasoning turns |
| Task complete | Write results → switch context |
| Complex sub-task needed | Spawn fresh sub-agent |
| Already condensed, still growing | Switch context or spawn |
| Critical info to preserve | Put at start or end, not middle |