claude.nagdy.me

Effort-aware hook with CLAUDE_EFFORT

A hook that reads the CLAUDE_EFFORT env var to run heavier checks only at high effort levels.

json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "if": "Bash(git commit*)",
        "hooks": [
          {
            "type": "command",
            "command": "if [ \"$CLAUDE_EFFORT\" = \"high\" ] || [ \"$CLAUDE_EFFORT\" = \"max\" ]; then npm run test -- --coverage; else npm run test -- --bail; fi",
            "timeout": 60
          }
        ]
      }
    ]
  }
}
View Full Module