Home › Learn › Claude Code Hooks — Lifecycle Automation for Agents
Claude Code Hooks — Lifecycle Automation for Agents
Claude Code hooks are shell commands that Claude Code runs automatically at well-defined points in the agent's lifecycle. They're configured in ~/.config/claude-code/settings.json under the hooks key, scoped by event name (PreToolUse, PostToolUse, Stop, UserPromptSubmit, Subagent
Claude Code hooks are shell commands that Claude Code runs automatically at well-defined points in the agent's lifecycle. They're configured in ~/.config/claude-code/settings.json under the hooks key, scoped by event name (PreToolUse, PostToolUse, Stop, UserPromptSubmit, SubagentStop) and optionally filtered by tool name or matcher pattern.
Hooks are how you wire Claude Code into your existing workflow: format code before edits commit, validate generated SQL, post a notification when a long task finishes, or block dangerous bash commands at the proxy layer. Unlike skills (which Claude invokes when it judges them relevant), hooks fire deterministically — the harness runs them, not the model.
The skills below either ship hook configurations of their own or are designed to be invoked from within hooks (a Stop-event hook that runs a code-review skill, for instance). For the raw mechanic, see Anthropic's official Claude Code docs.
Top 40 indexed skills
- hubspot-webhook-handlersSales
Build and harden HubSpot v3 webhook handlers that survive production: HMAC-SHA256 signature verification, Redis SET NX deduplication, async batch processing with immediate 200 ACK, dead-letter queuing for permanent…
- build-bash-scriptTools
Scaffolds a standalone Bash 4.0+ script — a single-file CLI tool, glue automation, or ops utility — with explicit shebang, `set -euo pipefail`, header comment, `readonly` constants, `die` helper, `local` variables,…
- build-python-scriptEngineering
Scaffolds a standalone Python 3 script — a single-file CLI tool, automation helper, or data-wrangling utility — with shebang, module docstring, `main(argv) -> int`, `__main__` guard via `sys.exit(main())`,…
- vibe-coding-background-agentContent
Build background AI agents that run alongside developers during vibe coding sessions, proactively helping without being asked. Covers file watcher architecture, event queue design, LLM router for triage, action…
- subscription-lifecycle-requirementsGeneral
Use when documenting, reviewing, or gathering requirements for Salesforce CPQ subscription lifecycle behavior: how amendments, renewals, upgrades, downgrades, and cancellations must work for a specific business.…
- hubspot-lifecycle-and-listsSales
Manage HubSpot lifecycle stages and list segmentation in production without silently destroying CRM trust. Covers lifecycle stage progression guards that prevent regression, dynamic list criteria drift, static list…
- guidewire-webhooks-integrationsGeneral
Consume Guidewire App Events into downstream systems (SQS/SNS, Kafka, webhooks) and survive the event-side failures — events not firing because Gosu registration was missed, duplicates from queue redelivery,…
- hooked-uxGeneral
Build habit-forming product loops using the Hook Model (Trigger, Action, Variable Reward, Investment). Use when the user mentions "users aren't coming back", "engagement loops", "habit…
- webflow-webhooks-eventsGeneral
Implement Webflow webhook registration, signature verification, and event handling for form_submission, site_publish, ecomm_new_order, page_created, and more. Use when setting up webhook endpoints, implementing…
- claude-md-guardianGeneral
Produces a CLAUDE.md health report listing conflicts, redundancies, and stale rules across the global, project, and subdirectory hierarchy — and optionally installs a PreToolUse hook to block unauthorized…
- databricks-bundle-medicEngineering
Fix the deploy-time foot-guns of Databricks Asset Bundles (DAB) and the infrastructure operations around them: the bundle-bind gap for UC catalogs and external locations, the "unexpected EOF reading…
- databricks-streaming-guardianGeneral
Guard production Databricks data pipelines — Delta Lake, Liquid Clustering, Structured Streaming, Auto Loader, and DLT — against the twelve foot-guns that fire at scale: OPTIMIZE/auto-compaction conflicts,…
- changelog-reviewGeneral
Internal skill invoked by repo-standards polish phase 6 to audit Claude Code plugin projects. Fetches live docs and runs scripts/validate-plugin-json.sh + scripts/validate-skill-frontmatter.py (via…
- copywriting-hooksGrowth
Generate opening hooks for long-form articles in EN or FR — blog posts, Substack/Medium/dev.to, LinkedIn long-form, paid newsletters, opinion essays, reported features, technical deep-dives. Trigger whenever the user…
- design-lifecycleSales
Designs lifecycle / email-automation flows — onboarding, activation, winback, churn-save — as multi-step trigger, message, timing, and branch maps anchored to an activation metric, with suppression rules and a…
- hook-writeScience
Generate 5-10 hook variations for any post, thread, or caption across X, LinkedIn, Instagram, and TikTok — using different styles (question, contrarian, statistic, story, observation, promise) so the best one can be…
- hooks-patternsEngineering
Use when reasoning about React Hooks as a discipline: when a render is the right shape for state, why the Rules of Hooks exist as a compile-time invariant, how the dependency array encodes a contract between closure…
- miro-webhooks-eventsGeneral
Implement Miro REST API v2 webhooks with board subscriptions, event handling, and signature verification for real-time board change notifications. Trigger with phrases like "miro webhook", "miro…
- react-hook-composerEngineering
Design composable custom React hooks with proper dependency management, testing with renderHook, and reusable patterns. Activate on: custom hook design, useEffect cleanup, hook composition, renderHook testing, hook…
- session-lifecycle-automationGeneral
Designs and configures all three loops of solo-operator session automation — session bookends, background maintenance agents, and a delegation flywheel. Use when setting up a new workspace, recovering from the 44%…
- stripe-webhook-signature-verificationSecurity
Use when validating incoming Stripe webhook requests in a Node.js or Next.js backend before processing any payment event. Verifies the `stripe-signature` header against `STRIPE_WEBHOOK_SECRET` using Stripe's…
- twinmind-webhooks-eventsContent
Handle TwinMind meeting events including transcription completion, action item extraction, and calendar sync notifications. Use when implementing webhooks events, or managing TwinMind meeting AI operations. Trigger…
- vercel-webhooks-eventsEngineering
Implement Vercel webhook handling with signature verification and event processing. Use when setting up webhook endpoints, processing deployment events, or building integrations that react to Vercel deployment…
- anima-webhooks-eventsGeneral
Use Figma webhooks to trigger automatic Anima code generation on design changes. Use when building event-driven design-to-code pipelines, auto-generating components when Figma files change, or integrating design…
- bamboohr-webhooks-eventsGeneral
Implement BambooHR webhook endpoints with HMAC signature validation and employee change event handling. Covers global and permissioned webhooks. Use when setting up real-time employee notifications, implementing sync…
- groq-webhooks-eventsEngineering
Build event-driven architectures with Groq streaming, batch processing, and async patterns. Use when setting up real-time SSE endpoints, batch processing pipelines, or event-driven LLM processing with Groq. Trigger…
- intercom-webhooks-eventsGeneral
Implement Intercom webhook handling and data event tracking. Use when setting up webhook endpoints, processing Intercom notifications, or submitting custom data events for contact activity tracking. Trigger with…
- lindy-webhooks-eventsGeneral
Configure Lindy AI webhook triggers, callback patterns, and event handling. Use when setting up webhook triggers, implementing callback receivers, or building event-driven Lindy integrations. Trigger with phrases…
- lwc-styling-hooksGrowth
Use when theming Lightning base components or custom LWCs with SLDS Styling Hooks — CSS custom properties such as `--slds-c-button-color-background`, `--slds-g-color-brand-base-50`, and `--sds-c-*` — across app,…
- notion-webhooks-eventsGeneral
Build change detection and event handling for Notion workspaces using polling, native webhooks, and third-party connectors. Use when implementing real-time sync, change feeds, incremental backup, or event-driven…
- onenote-webhooks-eventsGeneral
Implement change detection for OneNote using polling and delta queries (webhooks decommissioned June 2023). Use when building real-time sync, change monitoring, or event-driven OneNote integrations. Trigger with…
- perplexity-webhooks-eventsEngineering
Build event-driven architectures around Perplexity Sonar API with streaming, batch pipelines, and scheduled search monitoring. Trigger with phrases like "perplexity streaming", "perplexity…
- supabase-webhooks-eventsEngineering
Implement Supabase database webhooks, pg_net async HTTP, LISTEN/NOTIFY, and Edge Function event handlers with signature verification. Use when setting up database webhooks for INSERT/UPDATE/DELETE events, sending…
- build-hookGeneral
Builds a Claude Code hook (event-driven quality gate) with a script and the corresponding settings.json hooks entry. Use when the user wants to "create a hook", "add a PostToolUse hook", or…
- check-hookGeneral
Audits Claude Code hooks configuration for event coverage, script safety, async and blocking contradictions, Stop hook loop risks, rule overlap, and idempotency. Use when the user wants to "audit hooks",…
- clade-webhooks-eventsGeneral
Use Anthropic Message Batches for async bulk processing and event handling. Use when working with webhooks-events patterns. Trigger with "anthropic batches", "claude batch api", "anthropic…
- community-claude-md-guardianGeneral
Audits CLAUDE.md files for conflicts, stale rules, missing sections, and cross-file coherence. Produces a health report with auto-fix suggestions — audit only, no enforcement mechanism. Full version (adds a…
- hook-event-emitterEngineering
로컬 관측성(observability) 스킬 — Claude Code hook 이벤트를 JSONL 큐로 fan-out하고 localhost WebSocket 브로드캐스트로 대시보드에 노출. 외부 전송 0건, Artibot 내부 전용. Use when building a local hook monitor, agent dashboard, event tap, or any…
- hooks-designerEngineering
Designs Claude Code hooks — lifecycle event handlers (PreToolUse, PostToolUse) that enforce quality gates, block dangerous operations, auto-lint, run tests before commits, and log tool usage. Use when creating,…
- hooks-workflowGeneral
Convert rule-file hook guidance into target-appropriate config. Reads hook recommendations from the resolved language rules, consults the target-capability matrix, and emits only config the target can execute (Claude…
Frequently asked questions
What hook events does Claude Code support?
PreToolUse (before Claude invokes a tool, can block), PostToolUse (after a tool returns), Stop (when the agent reaches a natural stopping point), UserPromptSubmit (every time the user submits input), and SubagentStop (when a delegated subagent finishes). The full list and matcher syntax is in Anthropic's official Claude Code documentation — we don't restate the spec here because it moves.Can a hook block Claude from taking an action?
PreToolUse hook that exits non-zero blocks the pending tool call and the exit message is fed back to Claude. This is the standard pattern for guardrails: refuse rm -rf, refuse force-pushes to main, require a confirmation for git tag deletes, etc. See the skills below tagged type:hook for working examples.Where do hooks live: per-project or global?
./.claude/settings.json (project-local) with ~/.claude/settings.json (user-global) at session start; later entries win on conflict. Per-skill hook configs from ~/.claude/skills/<name>/SKILL.md frontmatter merge into the same tree.