Skip to content

Repository files navigation

LeanLane

Stop AI agents from over-building. Decision ladder, diff scoreboard, prune review, MCP tools, and installable agent skills — local-first, measurable, and safe.

Part of Talocode. Optional cloud routes under /v1/leanlane/*.

npm npm install -g @talocode/leanlane
PyPI pip install talocode-leanlane
CLI leanlane
MCP leanlane mcp
Cloud https://api.talocode.site/v1/leanlane/*
Auth TALOCODE_API_KEY (cloud only)
Repo https://github.com/talocode/leanlane
License MIT

Why LeanLane?

Coding agents often solve a ticket by inventing frameworks: new packages, wrappers, abstractions, and hundreds of lines nobody asked for. That burns tokens, slows reviews, and leaves brittle code.

LeanLane puts a senior “write less” discipline into the loop:

  1. Decide before writing — climb a fixed ladder (skip → reuse → stdlib → native → installed dep → one-liner → minimum new code).
  2. Score the diff — LOC, new files, dependencies, abstraction signals, grade A–F.
  3. Review for over-engineering — delete-list, not vibe comments.
  4. Rules / skill — always-on agent instructions with modes (lite / full / ultra / off).
  5. Safety floor — never cut validation, security, accessibility, or understanding for fewer lines.

Open tool people can trust. Hosted power when teams want shared scoreboards and API metering.

Install

npm install -g @talocode/leanlane
# or
npx @talocode/leanlane --help

pip install talocode-leanlane

Quickstart (CLI)

# What should the agent do *before* coding?
leanlane decide --task "add a date picker to the form"

# Score the working tree diff
leanlane score --git

# Review a file for bloat
leanlane review --file src/app.ts

# Export always-on rules into the repo
leanlane rules --mode full --out AGENTS.leanlane.md

# Export SKILL.md for agent hosts
leanlane skill --mode full --out skills/leanlane/SKILL.md

# Default mode for new sessions
leanlane mode set full

# MCP stdio server for agents
leanlane mcp

Example: decide

leanlane decide --task "add a date picker" --mode full

Returns a recommended rung (often native_platform for date pickers), rationale, full ladder, safety floor, and agent instructions.

Example: score a diff

leanlane score --diff "$(git diff HEAD~1)" --mode full
{
  "ok": false,
  "score": 42,
  "grade": "D",
  "metrics": {
    "filesTouched": 4,
    "linesAdded": 280,
    "newDependencies": 1,
    "newFiles": 2
  },
  "findings": [ ... ]
}

Exit code 2 when the score fails the mode threshold (useful in CI).

TypeScript SDK

import {
  decide,
  scoreDiff,
  reviewCode,
  getRuleset,
  createLeanLaneClient,
} from '@talocode/leanlane'

const plan = decide({
  task: 'add a date picker',
  nativeCandidate: '<input type="date">',
})

const score = scoreDiff({
  diff: await Deno.readTextFile('patch.diff'), // or any unified diff string
  mode: 'full',
})

const client = createLeanLaneClient() // uses TALOCODE_API_KEY for cloud
await client.health()

Local engine calls need no API key. The client is for optional Talocode Cloud routes.

Python SDK

import os
from leanlane import LeanLaneClient, decide, score_diff

print(decide(task="add a date picker"))
print(score_diff(diff=open("patch.diff").read()))

client = LeanLaneClient(api_key=os.environ.get("TALOCODE_API_KEY"))
print(client.health())

MCP

leanlane mcp

Exposes:

Tool Purpose
leanlane_decide Ladder decision before coding
leanlane_score_diff Score unified diffs
leanlane_review Over-engineering review + delete-list
leanlane_rules Mode ruleset markdown
leanlane_health Version + capabilities

Example host config (stdio):

{
  "mcpServers": {
    "leanlane": {
      "command": "leanlane",
      "args": ["mcp"]
    }
  }
}

Modes

Mode Behavior
off No lean pressure
lite Prefer reuse/stdlib; fail only on high/critical bloat
full Default ladder + fail on high findings or weak score
ultra Aggressive minimalism; medium findings fail
export LEANLANE_MODE=full
# or
leanlane mode set ultra

Safety floor (never cut)

  • Input validation at trust boundaries
  • Error handling that prevents data loss
  • Security-sensitive paths
  • Accessibility for user-facing UI
  • Understanding the problem before shrinking the diff
  • One runnable check for non-trivial logic

Cloud routes (optional)

Base: https://api.talocode.site

Path Credits (indicative)
GET /v1/leanlane/health 0
GET /v1/leanlane/pricing 0
GET /v1/leanlane/capabilities 0
POST /v1/leanlane/decide 2
POST /v1/leanlane/score 5
POST /v1/leanlane/review 5
POST /v1/leanlane/rules 1
GET /v1/leanlane/skill 1

Auth: Authorization: Bearer $TALOCODE_API_KEY or X-Api-Key.

Agent skill

leanlane skill --out skills/leanlane/SKILL.md

Compatible with Codra, Cursor-style skill folders, Claude Code-style skills, and OpenCode-style workflows. Copy into your agent’s skills directory or keep under .agents/skills/leanlane/.

CI gate example

leanlane score --git --mode full || exit 1

Related packages

Package Install
LeanLane (this) npm i @talocode/leanlane · pip install talocode-leanlane
VerifyLane npm i @talocode/verifylane · pip install talocode-verifylane
PolicyLane npm i @talocode/policylane
StyleLane npm i @talocode/stylelane
EvalLane npm i @talocode/evallane
TraceLane npm i @talocode/tracelane
GateLane npm i @talocode/gatelane

Talocode ecosystem

Product Role
LeanLane (this package) stop agent over-building
VerifyLane · pip install talocode-verifylane Deterministic code verification
PolicyLane Allow/deny + redaction
StyleLane Constitution packs
EvalLane Assertion eval suites
TraceLane Agent run tracing
RetryLane Retries & circuit breakers
PromptLane Prompt versioning
HandoffLane Schema handoffs
GateLane MCP gateway
SearchLane · pip install talocode-searchlane Agent web search
ContextLane · pip install contextlane Shared agent context
MemoryLane Agent memory
Tera · pip install talocode-tera Capability API
Codra · pip install talocode-codra Coding agent
StackLane · pip install talocode Keys, wallet, metering
Tradia · pip install tradia Trading agents
ScreenLane · pip install talocode-screenlane Screen context
XSearchLane · npm i @talocode/xsearchlane X search
XProLane · pip install talocode-xprolane X pro workflows
Agent Browser Browser automation
ClipLoop Clip / media loops
InvoiceLane Invoicing
GeoLane Geo utilities
DevTool · pip install talocode-devtool Dev tooling

More: github.com/talocode · talocode.site · docs.talocode.site

License

MIT © Talocode

About

Stop AI agents from over-building — decision ladder, diff scoreboard, prune review, MCP, CLI, SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages