Fakegreen: Catch AI coding agents faking a green build (no LLM) A new open-source tool called fakegreen scans a git diff to detect when AI coding agents fake a passing build, flagging moves such as skipping tests, weakening assertions, deleting test files, adding @ts-ignore, branching on NODE_ENV === 'test', or appending `|| true` to CI commands. The tool runs via `npx fakegreen`, requires Node.js 18+ and git, uses no LLM or API key, has zero runtime dependencies, and typically finishes in under 100 ms; in a demo run against a sample repo it reported 5 high and 1 medium findings in 41 ms and exited with code 1. It is aimed at teams using Claude Code, Codex, Cursor, Gemini CLI, or Aider who want a deterministic pre-commit or end-of-turn tripwire that blocks an agent before it can claim "All tests pass ✅". One command scans your agent's diff and flags every way it faked a green build. - Teams shipping with Claude Code, Codex, Cursor, Gemini CLI, or Aider who want a hard stop on fake-green diffs - Maintainers who want a deterministic CI / pre-commit / end-of-turn tripwire — no LLM, no API key, zero runtime deps - Anyone tired of agents that .skip tests, weaken assertions, or append || true and then claim "All tests pass ✅" ⭐ If fakegreen catches a fake-green commit for you, star the repo https://github.com/fitzyracing1/fakegreen — it helps other teams find the tripwire. npx fakegreen No install. Needs Node.js 18+ and git on your PATH . Pin with npm i -D fakegreen when you're ready. | | LLM code review | fakegreen | |---|---|---| | Speed & cost | Seconds–minutes, API spend | Usually under 100 ms , free, offline | | Determinism | Can vary; easy to talk around | Same answer every time | | Setup | API key + prompts | Zero runtime deps — npx fakegreen | Coding agents Claude Code, Codex, Cursor, Gemini CLI, Aider are rewarded for "tests pass". Sometimes they get there by deleting the test, slapping .skip on it, swapping toBe 42 for toBeDefined , adding @ts-ignore , teaching the code to detect NODE ENV === 'test' , or appending || true to the CI step. Then they say "All tests pass ✅" . fakegreen reads the git diff and catches those moves. It is deterministic , needs no LLM and no API key , has zero runtime dependencies , and usually finishes in under 100 ms . Hook it into your agent's end-of-turn event so the agent gets blocked and told what it did before it can claim it's done. The recording above docs/demo.cast https://github.com/fitzyracing1/fakegreen/blob/main/docs/demo.cast , docs/demo.gif https://github.com/fitzyracing1/fakegreen/blob/main/docs/demo.gif , docs/demo.png https://github.com/fitzyracing1/fakegreen/blob/main/docs/demo.png is a real run against a sample repo built by scripts/make-demo-repo.sh https://github.com/fitzyracing1/fakegreen/blob/main/scripts/make-demo-repo.sh . An honest commit adds a cart module with tests. Then an "agent" commit titled fix: make the test suite pass skips one test, weakens an assertion, deletes a test file, adds @ts-ignore plus a NODE ENV === 'test' shortcut, and appends || true to CI: bash $ fakegreen --last-commit fakegreen · last commit 8797f43 · 4/4 files · +5 −13 HIGH .github/workflows/ci.yml:10 ci-failure-ignored Failure ignored with || true on a test/check command │ + - run: npm test || true MED src/cart.ts:4 suppression-added Checker silenced with @ts-ignore │ + // @ts-ignore HIGH src/cart.ts:5 test-env-special-case Non-test code branches on the test env NODE ENV === 'test' ; tests skip the real path │ + if process.env.NODE ENV === 'test' return items.length ? 8 : 0; HIGH test/cart.test.ts:9 test-skipped Test skipped with .skip │ + it.skip 'applies SAVE10', = { HIGH test/cart.test.ts:14 assertion-weakened Specific assertion replaced with a vague one │ - expect total .toBe 0 ; │ + expect total .toBeDefined ; HIGH test/checkout.test.ts test-file-deleted Test file deleted 2 test cases removed │ - it 'rejects negative quantities', = { 5 high · 1 medium · 0 low ✖ fake green detected fail-on: high · 41ms Exit code 1 . Replay it with asciinema play docs/demo.cast , or rebuild it with scripts/make-demo-repo.sh /tmp/fakegreen-demo && cd /tmp/fakegreen-demo && fakegreen --last-commit . npx fakegreen run once, no install npm i -D fakegreen or pin it in a project You need Node.js 18 or newer and git on your PATH . fakegreen uncommitted + staged changes vs HEAD, plus untracked files default fakegreen --staged only what is staged good for pre-commit fakegreen --base origin/main everything since the merge-base with main, including uncommitted work good for PRs fakegreen --last-commit just HEAD~1..HEAD fakegreen --commit