Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@
}
],
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "python3 \"$HOME/.claude/hooks/suggest-compact.py\"",
"description": "Advisory: suggests /compact when Edit/Write call count reaches threshold (ADR-103)",
"timeout": 2000
}
]
},
{
"matcher": "Bash|Write|Edit",
"hooks": [
Expand All @@ -129,6 +139,12 @@
"command": "python3 \"$HOME/.claude/hooks/ci-merge-gate.py\"",
"description": "Gate: block merge to main/master when CI checks are red",
"timeout": 3000
},
{
"type": "command",
"command": "python3 \"$HOME/.claude/hooks/pretool-ruff-format-gate.py\"",
"description": "Ruff format gate: blocks git push when ruff format --check finds violations (Python projects with pyproject.toml only)",
"timeout": 5000
}
]
},
Expand Down
7 changes: 7 additions & 0 deletions hooks/error-learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ def detect_error(event: dict) -> tuple[bool, str]:
"failed over",
"failover",
"not found in cache",
# Timeout false positives: "timeout" appears in config output,
# import lines, and success messages — not as an actual error.
"timeout=", # e.g. timeout=2000 in hook config output
"stdin_timeout", # e.g. from stdin_timeout import ...
"timeout caps", # e.g. "PASS: all hooks now have timeout caps"
"timeout/", # e.g. "Graduated: timeout/abc123 → ..."
"read_stdin(timeout", # e.g. raw = read_stdin(timeout=2)
]
if any(phrase in output_lower for phrase in false_positive_phrases):
return False, ""
Expand Down