← Back to library

Split huge coding jobs among planner and worker agents

Wilson Lin on Cursor's research team ran hundreds of agents on single projects for weeks. Equal agents sharing one status file stalled on locks and avoided hard tasks. Separate roles fixed it: planners write tasks, workers finish one each, and a judge decides whether to continue. Trials included a browser engine and a front-end framework swap.

  • OutcomeKeep a very large software project moving for weeks with many agents in parallel, without them stalling on shared locks or dodging the hard work.
  • SetupAn afternoon+
  • LevelAdvanced
  • CreditWilson Lin
View original
Works with
Custom agent

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • A migration or build is too big for one agent session
  • You can afford many parallel agent runs
  • CI can tell you whether merged work still holds

Not for: Small feature tickets one agent can finish; Codebases without automated checks

What do you need, and what do you get?

You need

  • A goal and a codebase
  • An agent harness that can spawn planner and worker roles
  • CI and review capacity

You get

  • A rolling task list created by planner agents
  • Many worker changes pushed in parallel
  • A continue-or-stop call after every round

How does it work, step by step?

  1. Skip flat peer coordinationAgents sharing one status file with locks slowed to the throughput of a few and avoided risky tasks.
  2. Give planners the mapLet planner agents explore the code, write tasks and spawn sub-planners for separate areas.
  3. Let workers grindEach worker takes one task, ignores the bigger picture and pushes when it is done.
  4. Add a judge per cycleWhen a round finishes, a judge agent says whether to keep going; each new round begins clean.
  5. Pick models per roleThe team found some models better at planning and long focus, and others quicker to stop early.

The prompt

Our own prompt, inspired by Wilson Lin and written to work in Custom agent. Values in lime are placeholders.

Prompt0 variables
You are the planner for [project]. Explore the codebase and write a task list in TASKS.md: each task small enough for one worker to finish and test alone, with acceptance criteria. Do not write code yourself. Spawn a sub-planner for any area larger than [N files]. After workers push, act as judge: run CI, list what passed and failed, and decide whether another cycle is worth it. Stop if [budget] is reached.

Inspired by Wilson Lin: Scaling long-running autonomous coding · Cursor. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • The authors note the large migration still needed careful human review even though it passed CI.
  • Long runs burn a lot of tokens; decide a budget and a stop rule before launching.

Our take

Most teams will never run hundreds of agents, but Wilson Lin's lessons scale down well. Peer agents with no hierarchy drift toward safe, tiny changes; a planner that owns the task list and a fresh start each cycle keeps work honest. Workers that pick one task and finish it avoid the thrashing of everyone editing the same files. The candid note that a three-week migration passed CI yet still needs careful review is the part to remember: green builds are not the same as correct architecture. Keep a human-readable log of what each cycle's judge decided, so a reviewer can see why the run kept going. Pick models per role if cost matters; planners and judges may need stronger models than grind workers. Cap cycle count and spend before launching a long run. Never point a swarm at production credentials. Merge only through normal review, regardless of how confident the judge sounds.

Where the time goes back: Separating planning from execution lets throughput grow with the number of workers instead of collapsing on coordination.

FAQ

What did they build?
A browser written from nothing, past a million lines, an in-place Solid-to-React migration, and a faster Rust video renderer, among others.
Why did optimistic concurrency not fix it?
It cut lock trouble, but with no hierarchy agents still made safe small edits and nobody owned end-to-end work.

Source and credit

Inspired by Wilson Lin. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Scaling long-running autonomous coding · Cursor
Creator
Wilson Lin
Published on
cursor.com
Original date
Jan 14, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Custom agent
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Operations & Admin

All 203 Operations & Admin playbooks →

Related playbooks

Operations & AdminWorkflow✓ AI dry run

Add a merge check for every way coding agents break code

Keep a running list of the specific ways coding agents have damaged your repository, from hollow tests and invented fake responses to deleted files and silenced type errors, and turn each one into an automated gate that blocks the merge, so the same mistake cannot slip through review twice.

Credit: u/alexmarquardt on r/ClaudeCode

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Build a first web app as a non-coder, one model per job

Split a weekend app build across tools: an app agent for the scaffold, one model for requirements, another for fixes, and expert review before charging anyone.

Credit: u/mrcsvlk on r/replit

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Let a chat model plan and write coding-agent prompts

Plan features in a chat project, have it write the exact prompt for your coding agent, paste back the agent's output, and keep both on the same version number.

Credit: u/Lost-Application4693 on r/codex

Under an hour
Operations & AdminWorkflow✓ AI dry run

Shrink a million-line codebase with an orchestrated swarm

Clear years of deferred cleanup in days by letting one orchestrator split the repo and dispatch many workers, then review and fix what they got wrong.

Credit: Teknium

An afternoon+