Source Intelligence
Sweep 28 Aug 2026 · 00:00Z Build v2.1.250 478 read Stable v2.1.236 Latest v2.1.250 Next v2.1.251 Feeds RSS JSON llms.txt
Reading a new release v2.1.251 Analysing changes · 2/5 Deeper second pass · 0/5 agents 427 findings $12.75 so far

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

Search the documentation

10 pages for precompact.

Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.

How the agent loop works Claude Code CLI · in the page agent-sdk/agent-loop …compactor matches on intent, so the section header is free-form. * **`PreCompact` hook:** Run custom logic before compaction occurs, for example to archive the full transcript. The hook receives a `tr… Intercept and control agent behavior with hooks Claude Code CLI · in the page agent-sdk/hooks …| | `PreCompact` | Yes | Yes | Conversation compaction request… Agent SDK reference - Python Claude Code CLI · in the page agent-sdk/python …ng execution "SubagentStop", # Called when a subagent stops "PreCompact", # Called before message compaction "Notification", # Called for notification events "SubagentStart", # Cal… Agent SDK reference - TypeScript Claude Code CLI · in the page agent-sdk/typescript …this option. Some hook events, such as `Notification`, `SessionEnd`, `PreCompact`, and `PostCompact`, never produce an `SDKHookStartedMessage`, even with this option. For those events, Claude Code sti… CLI reference Claude Code CLI · in the page cli-reference …d this flag. Some hook events, such as `Notification`, `SessionEnd`, `PreCompact`, and `PostCompact`, never produce a `hook_started` event, even with this flag. For those events, Claude Code still emi… Explore the context window Claude Code CLI · in the page context-window …const visibleCount = EVENTS.filter(e => e.t <= time).length; const preCompactVisible = useMemo(() => EVENTS.slice(0, visibleCount), [EVENTS, visibleCount]); const compactGateIdx = GATES.length -… Hooks reference Claude Code CLI · in the page hooks …d, TaskCompleted), and Stop or StopFailure, followed by TeammateIdle, PreCompact, PostCompact, and SessionEnd, with Elicitation and ElicitationResult nested inside MCP tool execution, PermissionDenied… Automate actions with hooks Claude Code CLI · in the page hooks-guide …| | `PreCompact` | Before context compaction… Plugins reference Claude Code CLI · in the page plugins-reference …| | `PreCompact` | Before context compaction… Week 16 · April 13–17, 2026 Claude Code CLI · in the page whats-new/2026-w16 …<code>/security-review</code> via the Skill tool</div> <div><code>PreCompact</code> hooks can block compaction by exiting with code 2 or returning <code>{"{"}"decision":"block"{"}"}</code></div>…