Constructdocs
section · guides

Hooks

Hooks fire during Claude Code sessions, on file edits, commits, pushes, and prompts. Generated from lib/hooks/.

2 min read·guides / reference / hooks

Generated from lib/hooks/. Re-run construct docs:site to refresh.

Hooks are wired in platforms/claude/settings.template.json and execute as child processes during Claude Code sessions. Each hook reads JSON on stdin, performs its check or transform, and exits with a status that signals whether the surrounding tool call should proceed.

HookDescription
adaptive-lintPostToolUse auto-formatter and debug-log detector.
agent-trackerTask tool lifecycle hook: records dispatch +
artifact-release-gatePostToolUse advisory structure/visual gate for typed docs.
audit-readspost-Read state tracker.
audit-trailappend-only audit log of every mutation Construct
bash-output-loggerpersists long Bash outputs to disk and nudges
block-no-verifyrefuse git commit/push/merge --no-verify.
brand-prose-lintPostToolUse hook: block brand drift at write time.
ci-status-checkUserPromptSubmit hook: inject remote CI status into agent context.
comment-lintPostToolUse hook: enforce the comment policy at write time.
config-protectionprotects code-quality config from being weakened.
context-watchmonitors cumulative token usage and injects
context-window-recoveryContext window recovery hook — detects near-limit context and suggests compaction.
dep-auditPostToolUse / Write
doc-coupling-checkPostToolUse hook: nudge when code edits aren't paired with doc updates.
edit-accumulatoraccumulates edited paths for the next
edit-error-recoveryEdit error recovery hook — recovers from failed edit attempts and suggests fixes.
edit-guardEdit guard hook — validates old_string exists in target file before allowing edits.
graph-impact-advisoryPostToolUse hook: test-impact advisory on code edits.
guard-bashGuard bash hook — blocks dangerous shell commands from running unreviewed.
mcp-auditMCP audit hook — logs all MCP tool calls for observability and review.
mcp-health-checkMCP health check hook — verifies MCP servers are reachable before tool use.
model-fallbackProvider-aware model fallback hook.
orchestration-dispatch-guardbackstop against solo-authoring an orchestrated deliverable.
policy-engineconsolidated session policy enforcement hook.
post-merge-docs-checkPostToolUse / Bash (async)
post-merge-trackingclose beads referenced by a merged PR.
pre-compactPre-compact hook — prepares context summary before compaction runs.
pre-push-gatePreToolUse / Bash
proactive-activationEvent-driven specialist activation.
readme-age-checkStop hook (async)
registry-syncRegistry-change reminder hook.
rule-verifierStop hook that audits the session for
scan-secretsScan secrets hook — detects potential secrets in files before they are committed.
session-optimizeSession end optimization hook — triggers agent optimization for low-performers.
session-reflectSession end auto-reflect hook.
session-startSession start hook — emits resumable project context at the start of each session.
session-tracking-refreshkeep the project's tracking
stop-notifyStop notify hook — emits a session summary notification when Claude stops.
stop-typecheckStop typecheck hook — runs TypeScript type-check at session end and records result.
test-watchPostToolUse / Bash (async)