Scaling Long-Running Autonomous Coding
Cursor's Wilson Lin recently published "Scaling long-running autonomous coding", a field report on how far they can push AI agents beyond quick pull requests. The team let fleets of copilots run for weeks, write over a million lines of code, and coordinate on projects that would normally require entire engineering orgs. Here's a condensed tour of the most useful lessons for builders.
The Limits of Lone Agents
A single agent can close a ticket, but it quickly stalls on week-long efforts. Cursor found that:
- Latency accumulates: one agent serializes every decision, so complex projects crawl.
- Context drifts: as requirements shift, the agent forgets earlier decisions and rework explodes.
- Risk aversion creeps in: without accountability, agents zig toward safe refactors instead of gnarly architectural work.
Their conclusion: scale means parallelism, but naïvely adding more agents creates brand-new coordination failure modes.
Dynamic Coordination Wasn't Enough
The first multi-agent attempt relied on a shared status file and optimistic concurrency. Agents would:
- Check what others were doing.
- Grab a task with a lock.
- Update the shared state when done.
It looked elegant on paper, yet reality bit back. Locks became contention points, failed agents stranded work-in-progress, and nobody owned the hard problems. With equal roles, agents optimized for easy wins, leaving the system oscillating without finishing major threads.
Enter the Planner-Worker Pipeline
The breakthrough came from introducing specialization:
- Planners continuously explore the codebase, break work into tasks, and even spawn sub-planners for deep areas.
- Workers take a single task, ignore the rest of the world, and grind until it's done.
- Judges validate progress between cycles and decide whether to keep pushing or reset.
This simple hierarchy removed the need for heavyweight locking, gave every task a clear owner, and let hundreds of workers contribute without stepping on each other.
Proof via Week-Long Runs
With the pipeline in place, Cursor stress-tested it on audacious goals:
- Web browser from scratch: Nearly a week of uninterrupted agent work produced 1M+ lines across 1,000 files.
- Solid ➝ React migration inside Cursor: Three-plus weeks, +266K/-193K diff, CI green.
- Rust video renderer: A long-running agent landed a 25× faster path with smooth zoom/pan motions.
- Ongoing bets: A Java LSP (550K LoC), Windows 7 emulator (1.2M LoC), and spreadsheet engine (1.6M LoC) continue to evolve under autonomous stewardship.
The takeaway isn't that these projects are production-ready, but that autonomy can stay coherent over millions of tokens when structure is right.
What Model Choices Revealed
Not all models behave the same in marathon sessions. Cursor reports that GPT-5.2 variants stay on-task longer, respect instructions, and finish implementations more completely. GPT-5.1-Codex is faster for local edits but tends to hand control back early. Matching model strengths to roles (planner vs. worker) produced a measurable uptick in throughput.
Prompts Still Make or Break Everything
Even with the right architecture, most improvements came from better prompting:
- Clear termination criteria keep workers from timing out aimlessly.
- Guardrails against hoarding tasks or rewriting each other prevent churn.
- Periodic "fresh starts" reset context to avoid tunnel vision.
Infrastructure matters, but the words we feed agents matter more.
How Builders Can Apply These Lessons
- Structure beats spontaneity: If you're experimenting with multi-agent setups, define distinct roles and handoffs, even if the team is small.
- Reset deliberately: Long tasks benefit from checkpoints where you reassess assumptions instead of letting agents drift indefinitely.
- Measure agent behavior: Track lock time, abandoned tasks, and diff sizes to spot coordination rot early.
- Pick models per role: A "coding" model might not be the best planner; mix and match based on observed behavior.
- Plan for human review: Cursor still treats agent output as a draft. CI, code review, and manual QA remain essential.
Why This Matters
Cursor's experiments suggest that the ceiling on autonomous coding is much higher than most teams assume. With the right scaffolding, hundreds of agents can share one repo for weeks, attack multi-layer refactors, and keep making forward progress. For anyone building complex systems—or tools that empower others to do so—the message is clear: invest in coordination patterns now, because agent swarms are coming either way.
If you're curious to dive deeper or even help shape the next round of experiments, Cursor is hiring (hiring@cursor.com). This is one of the most exciting frontiers in applied AI, and it's moving fast.
Reference
📬 Subscribe to Newsletter
Get the latest blog posts delivered to your inbox every week. No spam, unsubscribe anytime.
We respect your privacy. Unsubscribe at any time.
💬 Comments
Sign in to leave a comment
We'll never post without your permission.