Claude Code now supports hooks
docs.anthropic.com
Claude Code now supports hooks
1–10 of 184 posts
Re: Claude Code now supports hooks
#2Hooks will be important for "context engineering" and runtime verification of an agent's performance. This extends to things such as enterprise compliance and oversight of agentic behavior.
Nice of Anthropic to have supported the idea of this feature from a github issue submission: https://github.com/anthropics/claude-code/issues/712
Re: Claude Code now supports hooks
#3Re: Claude Code now supports hooks
#4Re: Claude Code now supports hooks
#5Re: Claude Code now supports hooks
#6[flagged]
Re: Claude Code now supports hooks
#7Re: Claude Code now supports hooks
#8 Exit Code 2 Behavior
PreToolUse - Blocks the tool call, shows error to Claude
This is great, it means you can set up complex concrete rules about commands CC is allowed to run (and with what arguments), rather than trying to coax these via CLAUDE.md.E.g. you can allow
docker compose exec django python manage.py test
but prevent docker compose exec django python manage.py makemigrationsRe: Claude Code now supports hooks
#9Exit Code 2 Behavior PreToolUse - Blocks the tool call, shows error to Claude This is great, it means you can set up complex concrete rules about commands CC is allowed to run (and with what arguments), rather than trying to coax these via CLAUDE.md. E.g. you can allow docker compose exec django python manage.py test but prevent docker compose exec django python manage.py makemigrations
Re: Claude Code now supports hooks
#10We’ve been using CLAUDE.md instructions to tell Claude to auto-format code with the Qlty CLI (https://github.com/qltysh/qlty) but Claude a bit hit and miss in following them. The determinism here is a win.
It looks like the events that can be hooked are somewhat limited to start, and I wonder if they will make it easy to hook Git commit and Git push.