slow software Β· grown overnight
lazycode is an open-source coding agent that plans with a realtime model, then does the actual work on batch APIs β overnight, at half the price. Hand over the backlog, make tea, go to bed. Branches are waiting by morning.
We rush the wrong things.
Refactors don't need you hovering. Tests don't care if they finish at three in the morning. Migrations were never urgent β only postponed.
A garden doesn't grow faster because you watch it. Some work just needs time β and time, it turns out, is half price.
β the case for lazy code
an evening with lazycode
how it works
Chat agents burn tokens round-tripping one message at a time, because you're sitting there waiting. Remove the waiting and a better shape appears: lazycode treats your goal like a database treats a query β plan, optimize, execute in parallel waves, verify.
A realtime model reads your repo map and decomposes the goal into a DAG of typed operators β Explore, Generate, Edit, Verify, Judge, Reduce. You see the whole plan and approve it before a cent is spent on execution.
Rule-based rewrites, straight out of a query optimizer: push mechanical work to local tools, prune each node's context, factor shared prompt prefixes for cache hits, widen independent fan-out. Breadth is free β only depth costs time.
Every node whose dependencies are met ships in one batch submission β one wave can carry fifty file edits at half price. The daemon persists everything and waits without impatience; most waves finish within the hour.
Results are harvested into git worktree sandboxes, diffs applied with three-way merge, your test command run per group. You wake to branches, a report, and an assumption ledger β not a wall of chat.
independent nodes ride the same wave β one batch call, fifty files
economics
Batch APIs are 50% off list price. Most tools would stop there. We don't β because realtime agents get prompt-cache discounts on input that batch mostly gives up. Here is where the savings actually come from, measured honestly.
Every token the model writes overnight costs half. No caveats. For generation-heavy work β new tests, migrations, mass refactors β this is the bulk of the bill.
A chat agent re-reads the conversation every turn; caching makes that cheap (0.1Γ on hits). lazycode wins on input differently β it collapses thirty hurried turns into a few wide waves, so the context is simply read far fewer times. Fewer rounds beats cheaper re-reads.
Batch providers don't care whether a wave carries one request or a thousand. The optimizer widens fan-out aggressively, because only depth costs wall-clock time β and the night is long anyway.
durability
An agent that works while you sleep has one non-negotiable job: never lose work, never pay twice. Every guarantee below is enforced by the test suite β including a kill -9 β resume end-to-end test.
Every state change is an event; job state is a replayable projection. Crash at any instant β plan approved, wave in flight, results half-processed β and lazycode resume reconstructs exactly where it was.
Submissions carry content-derived idempotency keys, stamped into the provider's batch metadata. If the process dies between paying and recording, reconciliation finds the orphaned batch and adopts it instead of re-submitting.
A daemon holds a heartbeated per-job lease as the sole database writer; CLI and UI are read-only clients. No second process can double-submit your job β not even you, accidentally, from another terminal.
The daemon keeps your machine from sleeping (it asks first). Results land in git worktree sandboxes, diffs apply with three-way merge and an applied-diff ledger β your working tree is never touched.
quickstart
Python 3.12+, a git repo with at least one commit, and an Anthropic API key. Or try the built-in mock provider first β zero network, zero spend.
# install pip install lazycode-agent # hand over the backlog cd /path/to/your-repo export ANTHROPIC_API_KEY=sk-ant-... lazycode run "add type hints to services/" --verify "pytest -q" # approve the plan, close the laptop. in the morning: lazycode review jb_7f3a
| lazycode run | Plan with a realtime model, approve, execute in batch waves |
| lazycode status | Per-node progress: what's queued, in flight, landed, failed |
| lazycode explain | Logical and physical plan trees β Spark-style, for your code |
| lazycode review | Branches, verification results, and the assumption ledger |
| lazycode resume | Pick an interrupted job back up after a crash or reboot |
| lazycode daemon | Single-writer orchestrator that owns jobs and stays awake |
Plan β waves β verified branches. Crash-safe resume, idempotent submits, daemon, benchmark harness.
Repair loop: failed verify feeds back into a fix wave instead of stopping. Typed contracts, merge/cancel.
Cost estimates in the plan preview, explain analyze, hedging and deadline-aware realtime fallback.
Web UI for plan DAGs, rolling wave flush, OpenAI & Gemini batch adapters, webhook-first completion.