leanlab
Self-improving labs for AI agents. Point leanlab at a task and a team of Claude agents iterates toward a goal — evolving ML / optimization experiments against a frozen metric, or shipping coding tasks through a spec → gate → review → merge loop with locked acceptance tests.
Install
pipx install leanlab # or: pip install leanlab · uvx leanlab
📦 On PyPI: pypi.org/project/leanlab
Requires Python 3.11+ and the claude CLI (the agents run on Claude Code).
Quick start
leanlab runs inside your own project — each lab lives in a .leanlab/<name>/
folder; the engine stays in the installed tool.
Metric lab — evolve a number (ML, optimization, anything that prints a score):
cd ~/my-project
leanlab init iris # describe the task; Claude drafts the lab + scorer
leanlab check iris # verify it's wired correctly (free)
leanlab lock iris # freeze the scorer
leanlab run iris --n 5 # the agents evolve experiments (uses Claude)
leanlab serve iris # watch the live dashboard
Coding lab — ship a coding task with locked acceptance tests:
cd ~/my-repo # a git repository
leanlab spec "add a /health endpoint" # spec-writer drafts + locks the tests
leanlab build add-health # engineer → gate → reviewer → merge
leanlab board # live board: tasks, timeline, playbook
Let Claude Code drive it
cd ~/my-project && leanlab init --for-agent # installs a Claude Code skill
Then just ask Claude Code — "use leanlab to add a /health endpoint" — and it specs, builds, and merges through the honest test gate for you.
Docs
- docs/USAGE.md — every command, in order, with examples.
- docs/OVERVIEW.md — how it works: the loop, the two lab types, the coding-lab flow, and the project structure.
- CONTRIBUTING.md — local development (uv, tests, the React board).
MIT licensed — see LICENSE.
Metadata
Release files for leanlab 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| leanlab-0.2.4.tar.gz | 308.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| leanlab-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 428.4 kB
Release files / leanlab-0.2.4.tar.gz
| Download URL | leanlab-0.2.4.tar.gz |
|---|---|
| Size | 308.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d320f845ebd90c63d8cc2d254467f86d4d654fe6464c3def21af19f7364e62d5
|
|
BLAKE2b-256 checksum How to use checksums |
8f0233e58685d48a9265238cffc92c191e39188ba20ddc1c50afc3241592900b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.
Transparency logRelease files / leanlab-0.2.4-py3-none-any.whl
| Download URL | leanlab-0.2.4-py3-none-any.whl |
|---|---|
| Size | 119.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f3eb9d7b6dd05ea364310d32b66f86c0a181737bb5ae5cee9f8c32e72576e95
|
|
BLAKE2b-256 checksum How to use checksums |
da10293fb2fce5167139f337af4c3f44e6db6019f8142271616d8336eef3f92a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.
Transparency log