Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

9 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 …es | Subagent completion | Aggregate results from parallel tasks | | `PreCompact` | Yes | Yes | Conversation compaction request | Archive full transcript before summarizing | | `PostCompact` | No | Ye… 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 …a worktree that a `WorktreeCreate` hook created is being removed | | `PreCompact` | Before context compaction | | `PostCompact` | After context compaction completes | | `PreModelSwitch` | Before Claud… Week 16 · April 13–17, 2026 Claude Code CLI · in the page whats-new/2026-w16 …ds like `/init`, `/review`, and `/security-review` via the Skill tool`PreCompact` hooks can block compaction by exiting with code 2 or returning `{"decision":"block"}``ENABLE_PROMPT_CACHING_1H` opts A…
Feedback