Pre-commit hooks: catching AI coding agent mistakes before CI
This check looks for a git hook framework: pre-commit (.pre-commit-config.yaml), Husky (.husky/) or Lefthook (lefthook.yml).
How many repos use pre-commit hooks?
Of the 401 repos on the leaderboard, 115 pass in full (29%), 0 pass in part (0%) and 286 fail (71%).
Why do pre-commit hooks help AI coding agents?
A hook runs the formatter and linter at commit time, so an agent learns of a problem in seconds rather than minutes later from a failed CI run.
What counts as pre-commit hooks?
- Full pass: a config for pre-commit, Husky or Lefthook.
- Fail: none. Hooks set up any other way, such as a script that writes to
.git/hooks, are not detected.
How checks become a score: methodology.
How do I add pre-commit hooks to my repo?
Add one of the three and have it run the formatter and linter on staged files. Keep it fast; slow checks belong in CI.
Which AI coding agents weigh pre-commit hooks most?
- OpenHands6% of its score
- Devin6% of its score
- Pi5% of its score
- Kimi Code CLI5% of its score
- Claude Code5% of its score
- Codex5% of its score
- Gemini CLI4% of its score
- Aider4% of its score
- Cursor3% of its score
Pass rate by language
- Python40 of 56 (71%)
- TypeScript39 of 82 (48%)
- Ruby4 of 10 (40%)
- JavaScript5 of 15 (33%)
- C++6 of 21 (29%)
- Rust9 of 45 (20%)
- Clojure1 of 5 (20%)
- Scala1 of 6 (17%)
- Elixir1 of 7 (14%)
- Go5 of 40 (13%)
- C1 of 10 (10%)
- PHP1 of 12 (8%)
- Java1 of 28 (4%)
- Kotlin0 of 12 (0%)
- Swift0 of 10 (0%)
- C#0 of 8 (0%)
- Dart0 of 7 (0%)
- Haskell0 of 7 (0%)
- Zig0 of 6 (0%)
Top-scoring repos that pass
- Rust · 6.8k ★
- Ruby · 48.1k ★
- pingcap/tidb89.6Go · 40.7k ★
- gitlab-org/cli88.8Go · 1.1k ★
- apache/superset88.7Python · 75.4k ★
- axios/axios88.1JavaScript · 109.3k ★
- aio-libs/aiohttp88.1Python · 16.6k ★
- PostHog/posthog88.0Python · 40.7k ★
- C++ · 133.6k ★
- Python · 46.3k ★
- Rust · 33.3k ★
- TypeScript · 115 ★
Popular repos that fail it
- react/react64.1JavaScript · 252.3k ★
- TypeScript · 199.4k ★
- microsoft/vscode72.0TypeScript · 195.1k ★
- ollama/ollama76.7Go · 186.2k ★
- flutter/flutter55.0Dart · 181.1k ★
- Python · 168.6k ★
- Python · 165.3k ★
- TypeScript · 154.9k ★
Every check, grouped into what to do first: how to make your repo ready for AI coding agents.