Source - Session Pruning (OpenClaw Docs)
Source - Session Pruning (OpenClaw Docs)
Origin: https://docs.openclaw.ai/concepts/session-pruning
Fetched: 2026-04-15
Summary
Session pruning is a per-request, in-memory operation that trims aged tool outputs (exec results, file reads, search results) from context before each LLM call. Unlike compaction, it never modifies the on-disk transcript.
Key Points
- Scope: tool results only — normal conversation text is untouched
- Steps: await cache TTL → soft-trim (preserve begin/end + ellipsis) → hard-clear remaining content with placeholder → reset TTL
- Default enablement: Anthropic OAuth/token → enabled (1h heartbeat); Anthropic API key → enabled (30m heartbeat); non-Anthropic providers → disabled
- Config:
contextPruning: { mode: "cache-ttl", ttl: "5m" } - Legacy image handling: keeps 3 most recent completed turns byte-for-byte; replaces older image blocks with removal notices
Linked Wiki Pages
- Session Pruning — full concept page
- Compaction — durable counterpart