Hooks
Hooks — scripts the harness runs automatically at set moments of the agent’s work: before an action, after a file edit, on finish. An agent treats a rule in the instructions as advice, while a hook always runs, so hooks close the blocks that allow no exceptions.
Frequently asked questions
What is a hook?
A script the harness runs automatically at a set moment of the agent’s work: before an action, after a file edit or at the end.How is a hook different from a rule?
The agent treats a rule as advice and may break it, while a hook always runs. That is why prohibitions with no exceptions are enforced with hooks.Source: Claude Code hooks reference
Where it appears · 8
- Escalation to a human in AI agents · Harness
- AI agent maturity levels · Specs and context
- What are quality gates for AI agents · Harness
- How many rules does a game need · Research
- How to find a race condition in code · Specs and context
More 3
- AI agent = LLM + harness · Harness
- Harness engineering in practice · Harness
- What are AGENTS.md and CLAUDE.md and how they differ from spec.md · Specs and context