.claude/settings.json
raw| 1 | { |
| 2 | "hooks": { |
| 3 | "PostToolUse": [ |
| 4 | { |
| 5 | "matcher": "Edit|Write", |
| 6 | "hooks": [ |
| 7 | { |
| 8 | "type": "command", |
| 9 | "command": "sh -c 'f=$(echo \"$CLAUDE_HOOK_INPUT\" | jq -r \".tool_input.file_path // empty\"); [ -n \"$f\" ] && echo \"$f\" | grep -q \"\\.go$\" && gofmt -w \"$f\" || true'" |
| 10 | } |
| 11 | ] |
| 12 | } |
| 13 | ] |
| 14 | } |
| 15 | } |