Show HN: Lemmafit: Make agents prove that their code is correct
7 points
1 month ago
| 2 comments
| github.com
| HN
namin
1 month ago
[-]
Hey HN! We've been experimenting with Dafny formal verification in web apps. We've been using AI to write verified state machines, proving undo/redo preserves invariants, verifying business logic, and creating apps with this logic. That work has lived in blog posts and research experiments so far. lemmafit is the first time we've packaged it into something you can npm install.

lemmafit is an npm package that gives AI coding agents (currently only Claude Code) a formal verification loop. Any effect-free logic gets written in Dafny, verified on every save, and auto-compiled to TypeScript. The agent then hooks the logic up to a React UI, and you get an app with state transitions and business logic with guarantees of correctness.

Happy to answer questions about the verification pipeline or the Dafny integration.

reply
Karrot_Kream
1 month ago
[-]
Curious if there is any analysis on how often an LLM can create proofs correctly without special prompting.
reply
namin
1 month ago
[-]
Since around Opus 4.5, systems like Claude Code are very good at Dafny proofs. They don’t get everything right in one shot but can iterate with verifier feedback. Some proofs take over 20 minutes to complete. The system knows to put temporary axioms to tackle proofs step by step.
reply
Karrot_Kream
1 month ago
[-]
Awesome thanks! Would be nice to have a sort of "worked example" where you take a simple project and derive Typescript and Dafny for it and have the LLM (Claude) generate proofs. Just some feedback to broaden it up to folks not as familiar with Dafny.
reply
namin
1 month ago
[-]
Thanks, we will provide case studies. Already today, lemmafit doesn't need familiarity with Dafny. It is used under the hood, so you just use Claude Code normally and lemmafit adds the verification harness. You don't need to interact with Dafny or the proofs at all.
reply