Claude Code hooks
Use case: Skills & routines
Run shell commands at lifecycle events (pre/post tool use, stop) for deterministic guardrails.
Like Claude Code hooks? Find tools like it on X.
Follow @AgentstackDaily, plus the free Top 25 Agent Tools checklist.
At a glance
- Category
- Skills & routines
- Best for
- Skills & routines use cases
- Official site
- docs.anthropic.com
- Link checked
- November 4, 2026
- Data
- JSON
When to use Claude Code hooks
Consider Claude Code hooks when your agent work falls under Skills & routines. Our directory summarizes it this way: Run shell commands at lifecycle events (pre/post tool use, stop) for deterministic guardrails. If you are still choosing, compare it with Agent Skills (Anthropic), anthropics/skills and Claude Code subagents before committing, since they sit in the same category.
How Claude Code hooks fits an agent workflow
In an agent stack, Claude Code hooks belongs to the Skills & routines category, which covers the instruction layer, where reusable skills, rules, hooks and automations shape how an agent behaves. Other Skills & routines entries worth a look alongside it include Claude Code slash commands, Claude Code GitHub Actions and AGENTS.md.
Pricing & open source
Our data does not list a price or license for Claude Code hooks. Check the official site for current pricing and licensing before you build on it.
Claude Code hooks alternatives
- Agent Skills (Anthropic) — Package instructions, scripts and resources as folders that Claude loads on demand.
- anthropics/skills — Public repo of example and document-handling skills you can copy and adapt.
- Claude Code subagents — Define specialized subagents with their own prompts and tool permissions for delegation.
- Claude Code slash commands — Save reusable prompts as custom commands checked into your repo.
- Claude Code GitHub Actions — Run Claude Code in CI to respond to @claude mentions and automate routine PR work.
- AGENTS.md — Open, simple format for giving coding agents project instructions across tools.
Related tools
- Cursor Rules
Persistent project/user rules that shape Cursor agent behavior.
- n8n
Workflow automation with AI agent nodes
- Codex AGENTS.md guide
How Codex reads AGENTS.md files to follow repo conventions.
- Zapier Agents
AI agents that act across Zapier's app integrations.
- Make
Visual automation platform with AI agents.
FAQ
What are Claude Code hooks?
Hooks are user-defined shell commands, HTTP endpoints, MCP tool calls, LLM prompts or subagents that run automatically at specific points in Claude Code's lifecycle. Events include PreToolUse, which fires before a tool call and can block it, and PostToolUse, which fires after a tool call succeeds.
Where are hooks configured?
Hooks are defined in JSON settings files. They can also come from managed policy settings and plugins, and administrators can use allowManagedHooksOnly to restrict which hooks run.
Why use a hook instead of an instruction in CLAUDE.md?
Claude Code's best practices describe CLAUDE.md as non-deterministic: the model reads it and decides what to do. Hooks are deterministic, so Claude Code runs them every time regardless of what the model decides.
Get new agent tools and tips as they're added
Follow @AgentstackDaily on X for new tools and copy-paste tips. Free.