Skip to main content

Hooks Pipeline

15 hooks across 7 lifecycle events — quality enforcement on autopilot.

Blocking hooks reject actions or force fixes. Non-blocking hooks warn without interrupting. Async hooks run in the background.

SessionStart

On startup, clear, or after compaction

HookTypeDescription
Memory loaderBlockingLoads persistent context from Console memory
post_compact_restore.pyBlockingRe-injects active plan, task state, and context after compaction
session_clear.pyBlockingResets session state on /clear
Session trackerAsyncInitializes message tracking

UserPromptSubmit

When the user sends a message

HookTypeDescription
spec_mode_guard.pyBlockingBlocks /spec in plan mode, warns when not in bypassPermissions mode
Session initializerAsyncRegisters the session with the Console worker daemon

PreToolUse

Before Bash, search, web, or agent tools

HookTypeDescription
tool_redirect.pyBlockingRedirects to MCP alternatives, blocks Explore agent and plan mode conflicts
tool_token_saver.pyBlockingRewrites Bash commands via RTK for token savings (60-90% reduction)

PostToolUse

After file edits, searches, and other tool calls

HookTypeDescription
file_checker.pyBlockingQuality checks: Python (ruff), TypeScript (ESLint), Go (go vet + golangci-lint). Also warns when implementation files are edited without a failing test (TDD)
context_monitor.pyNon-blockingTracks context usage 0-100% with warnings as compaction approaches
Memory observerAsyncCaptures decisions, discoveries, and bugfixes to persistent memory

PreCompact

Before auto-compaction fires

HookTypeDescription
pre_compact.pyBlockingSnapshots active plan and task list to memory

Stop

When Claude tries to finish

HookTypeDescription
spec_stop_guard.pyBlockingBlocks stopping if an active spec hasn't completed verification
Session summarizerAsyncSaves session observations to memory

Additionally, spec_plan_validator.py and spec_verify_validator.py run as command-scoped Stop hooks during /spec phases — they verify plan creation and VERIFIED status respectively.

SessionEnd

When the session closes

HookTypeDescription
session_end.pyBlockingStops worker daemon if no other sessions active, sends dashboard notification
Closed loop

When compaction fires, PreCompact captures your active plan and task list to persistent memory. SessionStart restores everything afterward — no progress lost.