Parallel background agents with shared context?

I like the background agents feature. The models are getting better and better and I think I have learned a way of defining just enough dense tasks so that agents don’t mess up everything, and I get biggest bang for the buck.

But how are you guys running tasks in parallel?

For a smaller complete feature, the granularity that works for me is too small to run everything in a single agent. But if tasks are given to different agents, I am unable to have the dependency. I can of course do this serially, after one agent finishes then spawn the next one, but that kills my purpose.

I would like to fire up all the agents when I go to sleep and see some work when I wake up.

Since agents have different workspaces, the work of agent 1 is not available readily in agent 2.

IMO we either need shared memory kind of solution (if you know IPC) or some way to programatically spawn the agents, like an api. Another way to solve this could be creating github issues and having a single agent that keep scanning GH issues and solves them in the given order. But all of these require some work from Cursor team.

I am really wondering how are other members of the community doing it right now?

hi @cm007 and welcome to Cursor Forum.

Thank you for your detailed post.

Background agents are running in separate virtual machines and they have no shared state apart of Git repository.

You could structure the tasks so a shared feature is completed first and then merge it so other Agents can work on separate tasks from there.

Alternatively if you use the same structure and provide independent agents with the definitions of functions or classes to use.

We already have BugBot which can scan your repo for issues, though it does not work on Github Issues.

For an API we have received feature requests for this and are considering it.

Thanks for the reply. Can you elaborate more on “shared feature is completed first and then…” part. Because as far as I researched, there is no scheduling of background agents. So how do we do waiting for completion of one agent and then spawning next agent?

Someone on discord gave me a script that has a command akin to:

cursor --project . --background-agent "count number of lines in the src/lib/services/utils dir"

but cursor --help does not show --project or --background-agent option for me. Maybe he was using some extension or MCP, am yet to receive his response.

In this case I meant you could finish first the shared part, then let agents do independent coding and use the shared part.