Use hooks to run logic as part of the agent lifecycle. For example:

  • Dynamically load in context each time you start Claude (SessionStart)
  • Log every bash command the model runs (PreToolUse)
  • Route permission prompts to WhatsApp for you to approve/deny (PermissionRequest)
  • Poke Claude to keep going whenever it stops (Stop)

Original source on X