Automation
Lifecycle Hooks
Event-driven scripts that automate quality gates, context loading, and workflow orchestration across every coding session.
Lifecycle Flow
Hook Events
PreToolCall
beforeIntercepts tool calls before execution for validation
PostToolCall
afterProcesses tool results and triggers follow-up actions
SessionStart
afterInitializes session context, loads project state
SessionEnd
afterCaptures session summary, updates episodic memory
Notification
afterRoutes important events to external channels
PreCommit
beforeQuality gates: lint, typecheck, test on staged files
PostCommit
afterUpdates changelog, triggers CI notifications
ErrorRecovery
afterSpawns debugging agent on build/test failures
Hook Scripts
pst-timestamp
SessionStartInjects PST/PDT timestamps into every response
~/.claude/bin/pst-timestampshift-left-gate
PreCommitRuns lint + typecheck + tests before allowing commits
pnpm lint && pnpm tsc --noEmitcontext-loader
SessionStartDetects project type and loads appropriate conventions
~/.claude/bin/project-detectormemory-sync
SessionEndPersists learned patterns to episodic memory store
~/.claude/bin/sync-memoryerror-agent
ErrorRecoverySpawns specialized debugging sub-agent on failures
claude --agent error-recovery