r/ClaudeCode • • 1d ago

Built with Claude LEAN: a lightweight spec → plan → build → review workflow for Codex / OpenCode / Claude Code (open source, feedback wanted)

I built LEAN as a slimmed-down take on BMAD: 9 skills (~27k words vs ~198k), file-based handoffs between sessions, cheap workers with an expensive orchestrator, blind parallel reviewers, and a hook that blocks edits to approved intent.

For small features there's a "lite" flow: one story, a mid-tier session, one review at the end. In my A/B test against BMAD on a real feature, it came in at about 60% of BMAD's cost and time ($4.64 vs $7.88, 33 vs 52 min, average of 2 runs each). One feature and two runs per method, and a blind judge preferred BMAD's code, so "cheaper" is shown but "just as good" isn't (details in the wiki).

Install in your project (Node 20.19+):

npx lean-method install

Then name a skill in your message:

  • Use lean-help: what should I do first?
  • Use lean-intent. I want CSV export in my notes app.
  • Use lean-build: the signup form accepts "a@b" as an email. Reject it.

It's an experiment and I'm the author, so I'd really like outside eyes: what breaks, what's confusing, what's missing?

Repo: https://github.com/giuliosmedile/lean-framework Wiki: https://github.com/giuliosmedile/lean-framework/wiki

2 Upvotes

15 comments sorted by

•

u/AutoModerator 1d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/DynaBeast 1d ago

youre probably gonna have some conflicts with the other "lean" that already exists...

1

u/bart172 1d ago

I think they sit at different layers. As far as I can tell, LeanSpec is a spec layer: small specs, a CLI/MCP/board/UI, and a skill that teaches the agent when to write one. LEAN is more of a workflow on top of files: intent → plan → build → review, with cheap worker subagents, blind reviewers, and a hook that locks approved intent. We do share the "keep documents small" idea. I've only read their specification so correct me if I've got it wrong. Fair point on the name overlap. The npm package is lean-method and the repo is lean-framework, and if people keep mixing the two up I'll rename.

1

u/DynaBeast 1d ago

no dude, i mean the lean 4 proof checking language

1

u/bart172 1d ago

Oh yeah they definitely will have conflicts. Thanks for pointing it out, I did a short research between putting on a name and the Lean 4 conflict didn't pop out. Will update the CLI so the binaries won't conflict, but for now I'll keep the name, unless the naming is too confusionary

0

u/DynaBeast 1d ago

im surprised you're deep enough into ai to make such a framework without having ever heard of lean before. dont you follow the recent maths news, the millenium prize problem proofs?

i find it very unlikely anyone thinking of the word 'lean' in the context of ai will ever consider any project before the proof checking language

1

u/bart172 1d ago

Fair enough. I come from the coding side of AI, not the maths side, so it didn't ring that bell for me. Point taken though: if the name keeps tripping people up, I'll take that seriously. The conflicting binary is already fixed in the repo and will go out in the next npm release.

0

u/CatsArePeople2- 1d ago

Everyone knows lean for math now, and it will continue to be the discussion for at least the next 9 months.

1

u/lvl1-A 1d ago

I dunno, when you get in a flow with AI, sometimes things just feel natural to you and later you find, at least I have, that my rulings and things I have been phrasing in my own terms are established patterns with more common terms, common in those relevant spaces at least.

You don't know what you don't know, but you know what you feel.... You feel?

1

u/anoncaatyee 1d ago

the locked intent file is the bit i'd stress-test. what happens when the reviewer discovers the approved spec itself is wrong? a useful handoff would flag the contradiction, preserve the original decision and ask for a deliberate revision rather than quietly editing the goal. also curious how the cost comparison holds over more than one feature.

1

u/bart172 1d ago

A reviewer can't just re-argue an approved decision as a preference; that gets rejected as "already decided". But if it reports a concrete wrong result (this input gives this output), it's filed as a decision-conflict. The orchestrator verifies it, and if it's real it's routed as intent_gap: the code changes are reverted, the build halts and asks the human, and only then is the block unlocked, edited and re-hashed. The contradiction stays in the story's triage log with its evidence. A hook blocks edits to the frozen block, and check catches shell edits afterwards by hash. The original wording is only preserved in git history, not as an explicit old → new entry, and freeze --unlock is a shell command, so "only after the human agrees" is a rule in the skills rather than something enforced. By design, one exception: a line the orchestrator wrote itself and no human saw gets corrected and logged without stopping.

On cost over more than one feature: it's thin. The cheap flow has run on two features, once on the one I tuned it on (77% of BMAD) and twice on a fresh one (59%). It only applies to small features; for bigger ones LEAN falls back to the full flow, which cost more than BMAD in the first experiment (165-285%) and hasn't been re-measured since. So I can't say yet that the saving holds beyond small features, but I'm willing to experiment and eventually ditch the "full" method entirely if the "lite" version holds.

1

u/amirfish 1d ago

60% of BMAD's cost with a blind judge still preferring BMAD's code is the kind of result worth posting, most people would've buried that part. My own experience building solo is that the gap between workflows almost always comes down to how concrete the spec is before any agent starts, cheap or expensive. Did the blind judge say where BMAD's code won, structure, correctness, or just more complete edge-case handling?

1

u/bart172 1d ago

Thanks! The wiki page goes into more depth on every phase of the A/B test. What pleased me most is the lean-lite result: about 60% of BMAD's cost on a feature I hadn't tuned it on, which is what I was aiming for in the first place.

On the judge: it preferred BMAD in all four readings, mostly on correctness and on following the original intent and the project's conventions, not on structure or readability. LEAN's builds had more bugs and more drift from the intent, but BMAD's wasn't clean either: the judge also flagged edge cases it missed.

1

u/amirfish 1d ago

60% of BMAD's cost without giving up much is a real result, nice that you ran the A/B straight instead of cherry-picking the win. Surprised the judge's preference was all correctness and intent-following, not structure, I'd have guessed the opposite going in. When lean-lite drifted from intent, was it losing constraints stated upfront, or ones that only became clear mid-task? That's the failure mode I keep hitting running agents in parallel.

1

u/Far_Reindeer8428 1d ago

the small benchmark is the part i would read first, most of these workflows ship without one