Get startedGet started for free

Understanding Hooks

This hook is configured in .claude/settings.json for the Music Analytics API project. It uses a PostToolUse trigger with a matcher and runs a shell command when the condition is met.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "echo 'file modified' >> hook.log"
          }
        ]
      }
    ]
  }
}

Given this hook configuration, what will trigger it?

This exercise is part of the course

Software Development with Claude Code

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise