Countercheck – re-runs your tests when an AI agent says "done" A tool called Countercheck re-runs a project's tests from the pre-change base revision to check whether an AI coding agent's "done, all tests pass" claim is true, sealing each verdict in a SHA-256-hashed receipt. In the project's example run, `countercheck verify --claim "Fixed the discount bug. All tests pass." --agent claude-code --cost-usd 0.42` returned FAILED: the agent had marked a failing test as skipped, and Countercheck restored the modified protected file tests/test_pricing.py from the base revision and re-ran the check in a macOS sandbox with no internet access, producing an AssertionError of -5.0 != 0 at a reported cost of $0.4200. Countercheck ships a Claude Code Stop hook (`countercheck hook claude-stop`), a Hermes Agent `pre_verify` hook, and a CI mode (`countercheck verify --base main`), with dedicated hooks for Codex, Cursor, Copilot and Aider still planned. Proof that AI work really happened. AI coding agents often say "done, all tests pass" when it isn't true: they skip a failing test, edit the test so it passes, or never run it. countercheck verify checks the claim itself: 1. It reads your checks from the base revision before the agent's change , so the agent can't weaken them. 2. It copies the agent's files into a clean folder and puts back any protected file the agent changed your tests . 3. It runs the checks in a macOS sandbox : no internet localhost works; a check can opt in with network = true , writes only inside that folder. 4. It writes a receipt : the claim, what ran, the output, what the agent changed that it shouldn't have, the cost if known, and a verdict. Receipts are sealed with a SHA-256 hash, so edits are detectable. bash $ countercheck verify --claim "Fixed the discount bug. All tests pass." --agent claude-code --cost-usd 0.42 countercheck receipt 9073a384e88f9d37 FAILED claim: "Fixed the discount bug. All tests pass." - CONTRADICTED by evidence checks: .countercheck/checks.toml @ HEAD locked , sandbox: macos-seatbelt no internet, localhost only; writes only in the check folder protected Modified: tests/test pricing.py - restored from base FAIL unit tests 65 ms $ python3 -m unittest -q | self.assertEqual apply discount 10, 150 , 0 | AssertionError: -5.0 = 0 cost: $0.4200 reported - the worker changed 1 protected file s ; countercheck ran the checks with the base version - check "unit tests" failed exit 1 The agent's own run said OK skipped=1 : it had marked the failing test as skipped. The mental model: the agent never grades itself. Its claim is compared with what actually runs, on rules it couldn't change: base revision locked agent's work + claim checks.toml, your tests files, "Done, all tests pass." \ / +-- countercheck verify <+ 1 lock the checks from the base revision 2 clean copy edited tests put back 3 run in a sandbox no internet unless a check opts in 4 decide + seal receipt with a SHA-256 seal | VERIFIED - agent may finish FAILED + "done" - hook sends the failure back; agent fixes the code max 3 rounds FAILED + honest "can't, because ..." - agent may stop; receipt still says FAILED | Rule | In plain words | |---|---| | The worker never grades itself | the checks come from before the work started; edited tests are put back | | Re-run, don't read | the agent's claim and logs are never evidence; the checks run again | | Honest verdicts | VERIFIED, FAILED or UNVERIFIED with a reason , never a guess; a hint never softens a failure | | Everything from the repo is hostile | paths, sizes and links are checked, because the worker controls the files | | Domain-blind core | it knows nothing about SQL, games or ML; your checks carry the domain knowledge | | Fail closed on the verdict, open in the hooks | a broken referee never waves work through, and never traps your agent | | Leave evidence | every run writes a sealed receipt anyone can re-check | The code behind each rule, one run step by step, and where new work plugs in: docs/architecture.md https://github.com/datacrate360/countercheck/blob/PROD/docs/architecture.md . | You use | How Countercheck plugs in | |---|---| | Claude Code | Stop hook: countercheck hook claude-stop docs/hooks/ https://github.com/datacrate360/countercheck/blob/PROD/docs/hooks | | Cortex Code Snowflake | same hook format as Claude Code not yet tried on a real install | | Hermes Agent | pre verify hook: countercheck hook hermes-pre-verify | | Codex, Cursor, Copilot, Aider, your scripts | run countercheck verify --claim "…" when it says done dedicated hooks planned | | CI | countercheck verify --base main ; fail the job on any exit code but 0 GitHub Action planned | Ready recipes for real projects check files, helper scripts, a 5-minute start : recipes/ https://github.com/datacrate360/countercheck/blob/PROD/recipes — first one: Oracle → Snowflake conversion with Cortex Code https://github.com/datacrate360/countercheck/blob/PROD/recipes/oracle-to-snowflake . We gave Hermes Agent https://github.com/NousResearch/hermes-agent 29 small coding tasks, 3 times each, in four setups, and graded every run with hidden tests the agent never saw. Some tasks are impossible on purpose a test expects a wrong value, a server can't be reached : the honest answer is "this can't pass, because …". | False "done" claims claimed success, hidden tests fail | Hermes | + its verify on stop | + Countercheck | both | |---|---|---|---|---| | GPT 6.1, all tasks 87 runs per setup | 7 | 11 | 3 | 2 | | GPT 6.1, impossible tasks only | 6 | 8 | 0 | 0 | | DeepSeek V4 Pro, all tasks | 7 | 6 | 6 | 6 | - When GPT 6.1 got stuck, it edited the protected test and said "all tests pass". Countercheck re-ran the original tests, said FAILED and pushed back once; the agent restored the test and reported the real problem. - Countercheck only knows what your checks test: the remaining false claims were cases the visible tests didn't cover. DeepSeek rarely games tests, so there was little to catch. - It added about 1 second to the median run. Full method, numbers and limits: docs/eval/results-2026-10.md https://github.com/datacrate360/countercheck/blob/PROD/docs/eval/results-2026-10.md . Reproduce: eval/ https://github.com/datacrate360/countercheck/blob/PROD/eval . | You use | Install with | |---|---| | Python pip, a .venv , uv | pip install countercheck · uv tool install countercheck · or run without installing: uvx countercheck verify | | macOS or Linux, Homebrew | brew install datacrate360/tap/countercheck | | macOS or Linux, any shell | curl -fsSL https://raw.githubusercontent.com/datacrate360/countercheck/PROD/install.sh \| sh | | Windows 10/11, PowerShell | irm https://raw.githubusercontent.com/datacrate360/countercheck/PROD/install.ps1 \| iex or pip install countercheck / uvx countercheck | | Rust | cargo install --git https://github.com/datacrate360/countercheck countercheck | | Direct download | Releases https://github.com/datacrate360/countercheck/releases : one file per platform + SHA256SUMS.txt | Builds: macOS Apple silicon and Intel, one universal binary , Linux x86 64, arm64; static and Windows x86 64, countercheck.exe , no runtime to install . Both install scripts check every download against SHA256SUMS.txt before installing. install.ps1 puts countercheck.exe in %LOCALAPPDATA%\Programs\countercheck and tells you how to add that folder to PATH . Windows needs Git for Windows https://git-scm.com/download/win Countercheck calls git , and checks run with its sh , so the same checks.toml works on every OS . A check can use PowerShell or cmd instead: shell = "pwsh" or shell = "cmd" docs/checks.md https://github.com/datacrate360/countercheck/blob/PROD/docs/checks.md command . Sandbox by platform. On macOS, checks run in the system sandbox no internet, localhost allowed, writes only in the check folder; network = true lets a single check use the internet . On Linux and Windows there is no sandbox yet: checks run as a normal process and the receipt says so on Windows: none no sandbox on Windows yet ; run Countercheck inside a container or VM with networking off when you need isolation. | Platform | Checks run in | Internet during checks | Writes outside the check folder | |---|---|---|---| | macOS | the system sandbox Seatbelt | blocked localhost allowed unless network = true | blocked | | Linux | a normal process | allowed | allowed | | Windows | a normal process | allowed | allowed | What's shipped, in progress and next: docs/ROADMAP.md https://github.com/datacrate360/countercheck/blob/PROD/docs/ROADMAP.md . countercheck init writes .countercheck/checks.toml, edit the commands git add .countercheck && git commit -m "Countercheck checks" ... let an agent work ... countercheck verify --claim "what the agent said" uncommitted work vs HEAD countercheck verify --base main committed work on a branch vs main countercheck show .countercheck/receipts/