🧠 All Things AI
Advanced

Hooks

Pre- and post-tool hooks — run custom shell commands in response to Claude Code events.

What You Will Learn

  • What hooks are and when they fire (PreToolUse, PostToolUse)
  • Configuring hooks in settings.json
  • Use cases: auto-format on write, log tool calls, run tests on edit
  • Writing hook scripts: shell commands and exit code semantics
  • Security considerations: hooks have full shell access

This page is under development. Content is being added progressively. Check back soon for the full article.