Hook Types
Last updated
What is Hook Types?
In Claude Code, you can configure three distinct handler types for your hooks—Command, Prompt, and Agent—depending on whether you need a script, an AI "judgement call," or a specialized researcher to validate actions. Command hooks (type: "command") are deterministic shell scripts that execute standard commands (like npm run lint) and use exit codes to either approve the action or block it with an error message. Prompt hooks (type: "prompt") use a lightweight Claude model for single-turn evaluation, where the model analyzes the context (e.g., "Is this commit message descriptive?") and returns a simple JSON yes/no decision. Finally, Agent hooks (type: "agent") are the most sophisticated, spawning a multi-turn subagent with tool access (like Read or Grep) to conduct deep, autonomous verification before deciding if the main agent should proceed.
Free resources to learn Hook Types
- Official docsHook Types
- Official docsPrompt-based hooks
- Official docsAgent-based hooks
- Official docsAutomate workflows with hooks
More in stage 9: Hooks
Hook Types: common questions
Can I learn Hook Types in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Hook Types in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Hook Types tutorial for beginners?
It is lesson 68 of 109 in the free Claude Code roadmap, in stage 9, Hooks. If you are new to Claude Code, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.