Formally verifying the Claude Agent SDK with Lean yields 16 bug-fix PRs from a few prompts

dyn___ · x · 2026-09-24

@bcherny describes using Claude (Opus) with the Lean theorem prover to formally verify the Claude Agent SDK: a couple of short prompts produced 16 PRs fixing bugs and race conditions.

He notes TLA+ works well too, and he often combines Lean and TLA+ to probe data flow, concurrency, and state management issues — despite not knowing either language deeply. He also cautions that without language expertise, a safer claim is 'somewhere between better than me and probably decent — building an eval.'

Related event: Opus 5.5 + Lean Formal Verification of Agent SDK Yields 16 Bug-Fix PRs From a Few Prompts(14 posts)→

Original post →

More from coding & agent

coding & agent channel →