Formally verifying the Claude Agent SDK in Lean yields 16 PRs fixing bugs and races

doodlestein · x · 2026-09-23

Developer Jeffrey Emanuel showed a formal-methods-driven debugging workflow: using Opus to formally model the Claude Agent SDK in Lean, a couple of short prompts surfaced and fixed 16 bugs and race conditions via 16 PRs.

He says he barely knows Lean or TLA+ himself, but the model excels at both; he sometimes combines Lean and TLA+ to probe data-flow, concurrency, and state-management issues. The approach is packaged as the open lean-formal-feedback-loop Claude Code skill (Lean 4 + Rust, 1,857 installs), which runs Lean-Rust proof feedback loops to catch runtime bugs.

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 →