Boris Cherny Used Opus 5.5 + Lean to Formally Verify Claude Agent SDK, Shipping 16 Bug-Fix PRs

AccBalanced · x · 2026-09-25

Boris Cherny used Opus 5.5 to formally verify the Claude Agent SDK with Lean, the theorem-proving assistant—a few short prompts produced 16 PRs fixing real bugs and race conditions, despite him not knowing Lean well.

Bugs found include a session phase where a sandbox network request and a permission prompt could both resolve and leave the session waiting forever, a retry loop fighting a token cutoff guard, and a streaming response ending mid-message but logged as success with no error or cost recorded. He says TLA+ also works well and he sometimes combines both to check data flow, concurrency, and state management in one pass. He asks whether formal verification is the future of coding—or at least of bug finding.

Related event: Claude Opus 5.5 + Lean Formal Verification of Agent SDK Yields 16 Bug-Fix PRs(19 posts)→

Original post →

More from coding & agent

coding & agent channel →