|
| 1 | +{ |
| 2 | + "$schema": "https://claude.ai/hooks-schema.json", |
| 3 | + "hooks": [ |
| 4 | + { |
| 5 | + "name": "format-on-edit", |
| 6 | + "description": "Run ruff format on edited Python files", |
| 7 | + "event": "PostToolUse", |
| 8 | + "matcher": "Write|Edit|str_replace_editor", |
| 9 | + "type": "command", |
| 10 | + "command": "cd /Users/AllenR1_1/Projects/zircote/git-notes-memory-manager && uv run ruff format $CLAUDE_FILE_PATHS 2>/dev/null || true", |
| 11 | + "conditions": { |
| 12 | + "fileExtensions": [".py", ".pyi"] |
| 13 | + } |
| 14 | + }, |
| 15 | + { |
| 16 | + "name": "lint-check-on-edit", |
| 17 | + "description": "Check for lint errors after Python edits", |
| 18 | + "event": "PostToolUse", |
| 19 | + "matcher": "Write|Edit|str_replace_editor", |
| 20 | + "type": "command", |
| 21 | + "command": "cd /Users/AllenR1_1/Projects/zircote/git-notes-memory-manager && uv run ruff check $CLAUDE_FILE_PATHS --output-format=concise 2>/dev/null | head -20 || true", |
| 22 | + "conditions": { |
| 23 | + "fileExtensions": [".py", ".pyi"] |
| 24 | + } |
| 25 | + }, |
| 26 | + { |
| 27 | + "name": "typecheck-on-edit", |
| 28 | + "description": "Run mypy on edited files to catch type errors", |
| 29 | + "event": "PostToolUse", |
| 30 | + "matcher": "Write|Edit|str_replace_editor", |
| 31 | + "type": "command", |
| 32 | + "command": "cd /Users/AllenR1_1/Projects/zircote/git-notes-memory-manager && uv run mypy $CLAUDE_FILE_PATHS 2>&1 | grep -E 'error:' | head -10 || true", |
| 33 | + "conditions": { |
| 34 | + "fileExtensions": [".py", ".pyi"] |
| 35 | + } |
| 36 | + }, |
| 37 | + { |
| 38 | + "name": "pre-commit-quality-gate", |
| 39 | + "description": "Full quality check before git commits", |
| 40 | + "event": "PreToolUse", |
| 41 | + "matcher": "Bash", |
| 42 | + "type": "command", |
| 43 | + "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE 'git commit'; then cd /Users/AllenR1_1/Projects/zircote/git-notes-memory-manager && make quality; fi", |
| 44 | + "blocking": true |
| 45 | + } |
| 46 | + ] |
| 47 | +} |
0 commit comments