Test suites: why AI coding agents need tests they can find
This check looks for tests an agent could run: a test directory, or test-named files in each language.
By Himanshu Singh · Updated · How we score →
How many repos have a test suite?
Of the 434 repos on the leaderboard, 423 pass in full (97%), 0 pass in part (0%) and 11 fail (3%).
Why do AI coding agents need tests?
Tests tell an agent whether its change worked. With them it edits, runs and corrects itself; without them it hands back code nobody has run. Claude Code's profile weighs tests as heavily as AGENTS.md.
How do I get Claude Code and other agents to test their work?
- Put the test command, and how to run one test file, in AGENTS.md or CLAUDE.md. Claude Code's docs call the command that runs your check the most useful line in CLAUDE.md.
- For a bug, ask for a failing test first: the docs' example prompt has Claude write a test reproducing it, then fix it.
- Ask it to run the tests until they pass. With a pass-or-fail check, the agent makes the change, runs it, and fixes what broke.
- To enforce it, a
Stophook in.claude/settings.jsonexiting with code 2 sends Claude back to work until the command passes. - Ask for evidence: the command it ran and its output. "All tests pass" alone tells you little.
423 of 434 leaderboard repos pass this check in full (97%). Sources: code.claude.com/best-practices (new tab).
What counts as a test suite?
- Full pass: a
tests/,test/,__tests__/,spec/,specs/,testsuite/orsrc/test/directory; atests/,test/,__tests__/,spec/orsrc/test/in a top-level folder, or a source set such asapp/src/test/orsrc/commonTest/; or a test project such as .NET'sApp.Tests/or Xcode'sAppTests/. - Full pass: test-named files within four folder levels, such as
*.test.ts,*_test.go,test_*.py,*Test.java,*_spec.rb,*_unittest.cc, Perl'st/*.tor a roottest.js. Tests kept beside the code are a suite too. - 70%: no test files, but
package.jsonhas atestscript other than npm's placeholder or a bareexit,trueorecho. - Fail: none of these. We check that tests exist, not that they pass.
How checks become a score: methodology.
How do I make tests easy for AI agents to find?
Keep tests where your language expects them and put the command that runs them in AGENTS.md.
Which AI coding agents weigh tests most?
- Aider14% of its score
- Claude Code13% of its score
- Pi12% of its score
- Kimi Code CLI12% of its score
- Devin10% of its score
- Codex10% of its score
- Gemini CLI10% of its score
- OpenHands9% of its score
- Cursor8% of its score
Pass rate by language
- TypeScript88 of 88 (100%)
- Go41 of 41 (100%)
- JavaScript16 of 16 (100%)
- Swift14 of 14 (100%)
- C#12 of 12 (100%)
- Dart12 of 12 (100%)
- Ruby11 of 11 (100%)
- Elixir7 of 7 (100%)
- Haskell7 of 7 (100%)
- Scala6 of 6 (100%)
- Zig6 of 6 (100%)
- Clojure5 of 5 (100%)
- Rust46 of 47 (98%)
- Java31 of 32 (97%)
- Python54 of 56 (96%)
- PHP13 of 14 (93%)
- C++19 of 21 (90%)
- C9 of 10 (90%)
- Kotlin12 of 15 (80%)
Top-scoring repos that pass
- Ruby · 48.1k ★
- Rust · 6.8k ★
- PostHog/posthog91.2Python · 41.2k ★
- novuhq/novu91.2TypeScript · 40.4k ★
- jdx/mise91.2Rust · 36.6k ★
- TypeScript · 136.4k ★
- Python · 68.4k ★
- TypeScript · 395.3k ★
- vercel/next.js89.5JavaScript · 143.8k ★
- astral-sh/ruff89.5Rust · 51.6k ★
- apache/airflow89.5Python · 47.7k ★
- getsentry/sentry89.5Python · 45.9k ★
Popular repos that fail it
- ocornut/imgui30.3C++ · 77.3k ★
- karpathy/nanoGPT18.2Python · 65.1k ★
- git/git61.9C · 64.5k ★
- symfony/symfony54.9PHP · 31.5k ★
- Kotlin · 30k ★
- Kotlin · 19.5k ★
- trinodb/trino67.3Java · 13.5k ★
- mockk/mockk62.4Kotlin · 5.8k ★
Every check, grouped into what to do first: how to make your repo ready for AI coding agents.