WHAT NEW IN X10.28 WED

AI collections from X · 22 collections · 58,924 posts

aiVIDEO

Formally verifying the Claude Agent SDK with Lean

The author used Opus 5.5 with Lean and TLA+ to formally verify the Agent SDK, getting 16 PRs that fix bugs and race conditions from a few short prompts.

Boris Cherny
@bchernyArchived 2026.09.24Originally posted 2026.09.23
Boris Cherny @bchernyOriginally posted 2026.09.23
Open original on X

I used Opus 5.5 to formally verify the Claude Agent SDK using Lean. A couple short prompts = 16 PRs fixing various bugs and race conditions. Video attached. TLA+ also works well. I sometimes combine Lean and TLA+ to look for issues around data flow, concurrency, and state mgmt. I don't know either language well, but Claude is excellent at both. This approach is super useful for formally modeling your code and finding bugs that a human probably wouldn't have spotted. Is formal verification the future of coding (or at least, bug finding)?

x.com/bcherny/status/2102543349102338309Archived 2026.09.24 11:05