Claimcheck is a CLI tool and Node.js library that audits whether Dafny lemmas faithfully express the natural-language requirements they claim to cover. By the end of this page you will have Claimcheck installed, a mapping file created, and your first audit running against a real Dafny claims file.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metareflection/claimcheck/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before installing, make sure you have:- Node.js 18+ — Claimcheck uses ES modules and top-level await.
ANTHROPIC_API_KEYenvironment variable — Claimcheck calls the Anthropic API by default. Set this before running any audit.dafnyinPATH(optional) — Only required if you use the--verifyflag to run Dafny verification before the LLM audit.
Installation
Install Claimcheck
Install globally to make the
claimcheck command available anywhere on your system:Create a mapping file
A mapping file is a JSON array that pairs each natural-language requirement with the name of the Dafny lemma that claims to prove it:Each entry needs exactly two fields:
mapping.json
requirement— the natural-language statement of what the lemma should provelemmaName— the name of the lemma as it appears in the.dfyfile
Run your first audit
Point Claimcheck at your mapping file and your Dafny claims file:Claimcheck extracts each lemma named in the mapping, back-translates it to English without seeing the requirement, then compares the back-translation against the requirement. Results are printed as markdown by default; add
--json for structured output.Usage modes
- File mode (CLI)
- Stdin mode
- Library mode
File mode extracts lemmas directly from a The
.dfy source file. This is the default mode.--module flag is optional; it is only required when using --verify with module-based .dfy files.Understanding output
Each claim in the results gets one of four statuses:| Status | Meaning | What to do |
|---|---|---|
confirmed | Round-trip passed — the lemma faithfully expresses the requirement | Nothing required |
disputed | Round-trip failed — a discrepancy was found between the lemma meaning and the requirement | Fix the lemma or refine the requirement, then re-run |
verify-failed | Dafny verification failed (only reported when using --verify) | Fix the lemma so it compiles and verifies before re-running the audit |
error | Lemma not found in the source file | Check that lemmaName in your mapping matches the lemma name exactly in the .dfy file |
In single-prompt mode (
--single-prompt), disputed results include richer detail: a weakeningType field categorizing the failure (tautology, weakened-postcondition, narrowed-scope, or wrong-property), a vacuity analysis, and a description of any surprising scope restrictions.