MIT licensed · deterministic · no LLM · no API key

Your agent said "All tests pass ✅". Did it delete them first?

Catch AI coding agents faking passing tests

fakegreen scans the git diff from Claude Code, Codex, Gemini CLI, Cursor or Aider and flags every way the agent faked a green build: skipped or deleted tests, weakened assertions, new suppressions, test-env special-casing, swallowed errors, and CI forced green with || true.

Terminal recording: fakegreen flags an AI agent commit that skipped a test, weakened an assertion, deleted a test file, added @ts-ignore and appended || true to CI
22 rules JS/TS · Python · Go · Rust · Java Zero runtime dependencies Never sends your code anywhere

What it catches

It looks only at added and removed lines, lexes out comments and strings, and ignores pure moves and renames. Same diff in, same answer out, every time.

Tests skipped, focused or deleted

.skip, xit, @pytest.mark.skip, t.Skip(), #[ignore], @Disabled, .only, deleted test files, dropped test counts.

Assertions weakened

toBe(42) → toBeDefined(), assertions removed, expect(true).toBe(true), assert True.

Checkers silenced

@ts-ignore, eslint-disable, # type: ignore, noqa, //nolint, #[allow], coverage exclusions, weakened tsconfig/mypy.

CI forced green

|| true, continue-on-error, allow_failure, removed or disabled test steps, neutered test scripts, lowered coverage thresholds.

Test-env special-casing

Production code branching on NODE_ENV === 'test', JEST_WORKER_ID, "pytest" in sys.modules, cfg!(test).

Swallowed errors

New empty catch {}, except: pass, .catch(() => {}), if err != nil {}.

Block the agent before it says "done"

Hook fakegreen into the end-of-turn event of Claude Code, Codex or Gemini CLI. When it finds something, the agent is told exactly what it faked and is asked to fix it or explain why. Back it up with the pre-commit hook and the GitHub Action, which annotates pull requests in CI. SARIF and JSON output are also available.

# agent end-of-turn hooks
npx fakegreen install claude
npx fakegreen install codex
npx fakegreen install gemini

# everywhere else
npx fakegreen install pre-commit
npx fakegreen --base origin/main --sarif > fg.sarif
# .github/workflows/fakegreen.yml
- uses: actions/checkout@v4
  with: { fetch-depth: 0 }
- uses: fitzyracing1/fakegreen@v0.1.1
  with:
    fail-on: high

HIGH  test/cart.test.ts:9  test-skipped
MED   src/cart.ts:4  suppression-added

FAQ

What does "faking a green build" mean?

AI coding agents get rewarded for "tests pass". Sometimes they get there by skipping or deleting tests, swapping a specific assertion for a vague one, silencing the type checker or linter, special-casing the test environment, or making CI ignore failures. fakegreen flags those changes in the diff.

Does it use an LLM or need an API key?

No. It's deterministic pattern analysis on changed lines, with zero runtime dependencies. It usually finishes in under 100 ms and gives the same answer every time.

Which agents and languages does it support?

It has blocking end-of-turn hooks for Claude Code, Codex and Gemini CLI. For Cursor, Aider and anything else, use the pre-commit hook, the GitHub Action or a plain npx fakegreen run. It analyzes JavaScript/TypeScript, Python, Go, Rust and Java/Kotlin, plus CI and test config files.

Does it send my code anywhere?

No. The CLI never makes a network call. It shells out to git and nothing else.

fakegreen for Teams Early access

The CLI, hooks and GitHub Action stay free and open source. I'm considering a hosted version for teams running AI agents across many repos. It isn't built yet. If enough teams want it, it gets built with the first ones on the waitlist.

  • GitHub App: zero-config check runs and one PR comment on every repo in your org
  • One shared org-wide policy, with locked rules that agents can't loosen
  • Dashboard of fake-pass incidents by agent, repo and rule, waivers included
  • Audit export (CSV/JSON) for reviews and compliance
  • Custom rules for your test helpers and CI conventions
  • Priority support

Rolling out coding agents and want help now? I also do setup and custom-rule work. Email fitzyracing1@gmail.com.

Like the project? Sponsor it on GitHub.

This opens a prefilled email to fitzyracing1@gmail.com. I'll only email you about fakegreen for Teams.