
lean-verify
Claude Code skill: find bugs and prove optimizations equivalent with Lean 4
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up lean-verify (release-binary project) into my current project. Found on https://claudeers.com/lean-verify Repo: https://github.com/hirosassa/lean-verify Homepage/docs: — Detected install method: release-binary → inspect the README Category: skills. Platforms: cli. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: unknown; community-verified: false. Confirm the source before running anything.
Grab the latest release asset from GitHub.
# download a build from https://github.com/hirosassa/lean-verify/releases
git clone https://github.com/hirosassa/lean-verify
// compatibility
| Platforms | cli |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | MIT |
| Pricing | open-source |
| Language | Shell |
lean-verify
A Claude Code skill that uses the Lean 4 theorem prover as a small, practical tool for:
- Bug hunting: find integer overflow, bit-manipulation, and boundary-condition bugs with concrete counterexamples (
bv_decide). - Safe optimization: prove that an optimized or refactored version is equivalent to the naive one for all inputs.
It targets small functions and single rewrite rules, not whole-program verification. It is language-agnostic (Rust, C, Go, TypeScript, ...): you model the target in Lean, then translate any counterexample back to the original code.
Install
With the GitHub CLI (gh skill, preview):
gh skill install hirosassa/lean-verify lean-verify
# target a specific agent / scope if needed, e.g. --agent claude-code
With APM (Agent Package Manager):
apm install hirosassa/lean-verify
# deploys to .claude/skills/lean-verify (and/or other detected agents); pin with --target claude
Or clone manually:
git clone https://github.com/hirosassa/lean-verify /tmp/lean-verify
cp -r /tmp/lean-verify/skills/lean-verify ~/.claude/skills/
Lean itself is installed on demand by the skill (see references/setup.md), after asking you.
Layout
| Path | Contents |
|---|---|
skills/lean-verify/SKILL.md | Skill entry point: when to use it, workflow, modeling pitfalls |
skills/lean-verify/references/bug-hunting.md | Counterexample-driven bug hunting |
skills/lean-verify/references/perf-equivalence.md | Proving optimizations equivalent |
skills/lean-verify/references/tactics.md | Tactic cheat sheet (core-only first) |
skills/lean-verify/references/setup.md | Installing Lean / elan, minimal lake project |
skills/lean-verify/scripts/check_lean.sh | Checks the Lean environment |
skills/lean-verify/assets/examples/ | Runnable Lean examples |
Try the examples
lean skills/lean-verify/assets/examples/induction_decide_omega.lean
lean skills/lean-verify/assets/examples/bv_overflow_and_strength_reduction.lean # bad_ng is expected to fail with a counterexample
License
MIT
// faq
What is lean-verify?
Claude Code skill: find bugs and prove optimizations equivalent with Lean 4. It is open-source on GitHub.
Is lean-verify free to use?
lean-verify is open-source under the MIT license, so it is free to use.
What category does lean-verify belong to?
lean-verify is listed under skills in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/lean-verify)
// retro hit counter
[](https://claudeers.com/lean-verify)
// reviews
// guestbook
// related in Claude Skills
An agentic skills framework & software development methodology that works.
💫 Toolkit to help you get started with Spec-Driven Development
AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, and more). Turn any folder of code, SQL schemas, R scripts, shell scripts, docs,…