A declarative build system for AI-assisted development. Lathe reads pass definitions from your project, computes an optimized execution DAG based on dependencies and file-scope conflicts, and outputs phased plans that Claude Code (or any AI coding tool) executes.
Lathe is the build system. Claude Code is the compiler.
.lathe/passes/*.md -> lathe plan -> DAG (JSON + ASCII) -> /lathe:run -> Claude executes
(config) (Rust CLI) (deterministic) (plugin) (AI does work)
claude plugin install latheThe plugin auto-installs the binary on first use. Then ask Claude:
"Set up lathe for my project"
That's it. Claude reads the plugin's built-in guide and handles everything — creating passes, configuring the pipeline, and running it.
git clone https://github.com/ConaryLabs/Lathe.git
cd Lathe
cargo build --release
# Binary at target/release/lathelathe init # Scaffold .lathe/ directory with example passes
lathe plan # Show the execution plan
lathe validate # Check for errors
lathe list # List all passes| Lathe's job | Claude Code's job |
|---|---|
| What passes exist | Spawning agents |
| What order they run in | Worktree isolation |
| What file scopes they're limited to | Actually writing code |
| Whether gates pass | File-locking |
| Tracking metrics | Context management |
| Showing the plan before execution | Tool execution |
Each pass is a markdown file with YAML frontmatter:
---
name: security-audit
description: Review code for OWASP Top 10 vulnerabilities
reads:
- "src/**"
writes:
- "docs/security-report.md"
depends_on:
- implementation
gate: true
---
Review all source files for security vulnerabilities.
Focus on SQL injection, XSS, and auth flaws.
Output findings to docs/security-report.md.$ lathe plan
Pipeline: my-project (5 passes)
Phase 1 ----------
analysis reads: src/** writes: docs/plan.md
Phase 2 ----------
implementation reads: docs/plan.md, src/** writes: src/**
Phase 3 (parallel, 2 passes) ----------
security-audit reads: src/** writes: docs/security-report.md
tests reads: src/** writes: tests/**
Phase 4 ----------
review [gate] reads: src/**, tests/** writes: -
Critical path: analysis -> implementation -> tests -> review
Parallel speedup: 1.25x over sequential
Lathe computes ordering from three sources:
- Explicit dependencies —
depends_ondeclarations - Implicit read-write — if pass A writes
src/**and pass B readssrc/**, B runs after A - Write conflicts — overlapping write scopes are sequenced automatically
Run /lathe:run in Claude Code. It validates, shows the plan, and executes phase by phase — spawning parallel subagents where possible, enforcing write scopes, and pausing at gates for your approval.
- Automatic parallelization — passes with no conflicts run concurrently
- Write-scope enforcement — a PreToolUse hook blocks writes outside declared scope
- Conditional passes — only run when relevant files have changed (
when.files_changed) - Gated passes — pause for human approval before continuing
- Model routing — assign different models to different passes (
model: claude-sonnet-4-6) - Resume support — pick up where a failed run left off (
lathe plan --resume) - Tag filtering — run subsets of the pipeline (
lathe plan --tags review) - Shared pass libraries — import passes from shared directories (
extends)
| Field | Required | Description |
|---|---|---|
name |
yes | Unique identifier (kebab-case) |
description |
yes | What this pass does |
reads |
no | Glob patterns for readable files |
writes |
no | Glob patterns for writable files |
depends_on |
no | Passes that must complete first |
tags |
no | Labels for filtering |
gate |
no | Pause for approval after completion |
model |
no | Suggested model for execution |
when |
no | Conditional execution (files_changed globs) |
.lathe/pipeline.toml:
[pipeline]
name = "my-project"
parallel_limit = 4 # Max concurrent passes
default_gate = false # Gate all passes by default
extends = [ # Import shared passes
"~/shared-passes/reviews"
]| Command | Purpose |
|---|---|
lathe init |
Scaffold .lathe/ directory |
lathe plan |
ASCII execution plan |
lathe plan --json |
Machine-readable JSON |
lathe plan --mermaid |
Mermaid flowchart diagram |
lathe plan --tags X,Y |
Filter by tags |
lathe plan --from X |
Plan from pass X forward |
lathe plan --all |
Ignore when conditions |
lathe plan --resume |
Skip completed passes |
lathe validate |
Check for errors |
lathe list |
Show all passes |
lathe stats |
Run history and metrics |
lathe scope-check |
Check file against write scope |
- Complete Guide — Full reference for passes, pipelines, DAG mechanics, recipes, and troubleshooting
- Design Document — Architecture and rationale
MIT