Run coding agents in long autonomous cycles

Use a planner-worker loop with periodic review to keep coding agents moving on a large repository task.

Done with Cursorยท Advanced

What they did
Cursor tried to scale one project by running hundreds of agents at once. A shared coordination file with locks, and later optimistic concurrency, did not hold up, so they changed the design: one set of planners inspected the codebase and turned work into tasks, while separate workers handled those tasks and pushed changes. At the end of each pass, a judge agent chose whether to launch another round, and each new round began from a clean state.
How it went
Using that setup, Cursor built a browser from scratch in about a week and ended up with more than 1 million lines across 1,000 files. They also used it for a Solid-to-React migration that ran for more than three weeks, passed CI, and still needed careful human review. Even then, some agents kept going too long, so fresh resets were still necessary to limit drift.
Tips
Give the agent small, checkable tasks and make it prove progress often. Leave a human approval step before any commit, push, deletion, or submission, and plan for periodic restarts when the work starts to wander.

Try it yourself with Cursor

I want an agent to keep working on [large repo task] in [repo] for an extended period. First, inspect the codebase and split the work into small tasks that can be checked independently. Then assign one worker per task, have each worker make the change, run tests, and wait for my approval before any commit, push, delete, or submission. After each cycle, summarize what changed, what failed, and whether the job should continue. Stop if the goal is done or if you hit [number] failed attempts in a row, and start the next cycle from a fresh plan.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Read the original on cursor.com โ†—

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.