Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 9b2950d

Browse files
committed
feat(.claude): add project hooks for Python code quality
- format-on-edit: Auto-format with ruff after Write/Edit - lint-check-on-edit: Check for lint errors after Python edits - typecheck-on-edit: Run mypy on edited files - pre-commit-quality-gate: Full make quality before git commits
1 parent f925832 commit 9b2950d

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.claude/hooks.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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

Comments
 (0)