Home › All prompts › Run Several AI Agents at Once

Mini pack

Free

Run Several AI Agents at Once

Running two, three, or more coding agents on one project? These 10 free prompts help you split the work so no two agents touch the same file, give each agent its own copy of the code, keep track of who is waiting on you, and merge everything back safely.

Split the work, give each agent its own copy of the code, keep track of who needs you, and merge it all back without the agents stepping on each other.

10 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.

Download the free PDF

PDF, 18 pages

Written for use with

  • Claude Code, Cursor's Agent, or Codex: Prompts 1.1, 2.1, 2.2, 4.1, 4.2, 4.3, and 4.4 read your project or run git, so they need a coding tool opened in it. Worktree features (Claude Code's --worktree and .worktreeinclude, Cursor's /worktree, /best-of-n, and .cursor/worktrees.json, Codex's Worktree chats in the ChatGPT desktop app) and their default cleanup limits were checked against each tool's docs.
  • ChatGPT or Claude, in a normal chat: Prompts 1.2, 3.1 (Part 2), and 3.2 only need what you paste in, like a task table or agents' status lines. Claude Code's agent view (claude agents, a research preview) is mentioned as an option for 3.1, checked against its docs.
  • Plain git: the tips use git worktree add, list, remove, and prune, git merge --abort, conflict markers, and git branch -d, checked against git's docs.

Written for use with Claude Code, Cursor's Agent, Codex, ChatGPT or Claude. Not yet tested against them.

All 10 prompts

  1. 1.1 Split This Work So No Two Agents Touch the Same File
  2. 1.2 Write a Kickoff Brief for Each Agent
  3. 2.1 Set Up a Worktree for Each Agent
  4. 2.2 Preflight Check: Latest Code, Same Rules, Ready to Run
  5. 3.1 Who's Waiting on Me?
  6. 3.2 An Agent Wants to Touch Another Agent's File
  7. 4.1 Same Task, Two Agents: Pick the Winner
  8. 4.2 Merge Everything Back Safely
  9. 4.3 Fix a Merge Conflict Without Losing Either Agent's Work
  10. 4.4 Clean Up and Sync Up

Section 1: Split the Work Before Anyone Starts

1.1 Split This Work So No Two Agents Touch the Same File

Untested: not yet run against a model.

Use this when you have a big feature or a list of tasks and want several agents on it at once. It's for splitting the work into tasks that each own their own files, with the risky shared parts pulled out first.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your project. If your tool has a plan mode, use it.

Fill in: [THE WORK] (e.g. "add a settings page, dark mode, and email reminders"), [HOW MANY AGENTS] (e.g. "3"), [WHAT MUST NOT BREAK] (e.g. "login and the payment page").

I want to run several AI agents on this project at the same time, each in its own git worktree and branch. Help me split the work so they never edit the same files. Read the project first. Don't change any files.

The work: [THE WORK]
How many agents I want to run: [HOW MANY AGENTS]
What must not break: [WHAT MUST NOT BREAK]

Please:
1. Split the work into tasks, one per agent. For each task, give a short name, what it does, and the exact files or folders it may edit.
2. Check the lists against each other. No file may appear in two tasks. If two tasks need the same file, either merge them into one task or move that file's change into a separate "do first" task.
3. List the shared contract: anything two or more tasks depend on, like data types, database tables, API routes, or shared components. Say exactly how each one should look, so every agent builds against the same thing.
4. Mark the files every agent should leave alone, like package.json, lock files, the database schema, and rules files, unless their task owns them.
5. Tell me which tasks can run at the same time and which must wait for another one to finish.
6. If the work is too tangled to split safely, say so, and tell me how many agents you'd really use. One is a fine answer.
Show the result as a table: task, files it owns, depends on, can start now (yes or no).

Tips to customize: If the plan has a "do first" task, finish and merge it before you start the others, so everyone builds on the same shared pieces. Keep shared files like package.json with one owner. If two agents both add a package, you'll get a conflict in the lock file. Ask for "the table as TASKS.md in the project root" if you want a file you can check things off in.

1.2 Write a Kickoff Brief for Each Agent

Untested: not yet run against a model.

Use this when your work is split and you're about to start the agents. It's for one short, clear starting message per agent, so each one knows its job, its files, and when it's done.

Use in: ChatGPT or Claude in a normal chat, or the same session where you made the split in 1.1.

Fill in: [PASTE THE TASK TABLE FROM 1.1], [MY APP AND STACK] (e.g. "a Next.js app with Supabase"), [HOW I CHECK THE APP] (e.g. "npm run build and npm test", or "I open it in the browser and click through").

I'm about to start several coding agents at once, each in its own worktree. Write a kickoff brief for each one that I can paste in as its first message.

Task table: [PASTE THE TASK TABLE FROM 1.1]
My app and stack: [MY APP AND STACK]
How I check the app: [HOW I CHECK THE APP]

For each agent, write one brief in its own code block with:
1. Your task: one or two sentences.
2. Files you own: the only files and folders you may edit.
3. Hands off: files other agents own, plus shared files no one edits without asking me.
4. Shared contract: the exact types, tables, or routes you must build against. Don't change them.
5. Done means: 2 to 4 checks, including the commands in "How I check the app".
6. When to stop and ask me: if you need to edit a file you don't own, add a package, or change the shared contract, stop and say "NEED APPROVAL:" with what and why.
7. When you finish: commit your work on your own branch with a clear message, then reply with a 5-line report (what changed, files touched, checks run and results, anything unfinished, questions).
Keep each brief under 200 words, in plain words.

Tips to customize: Start each brief in a fresh session, so no agent carries old ideas from another task. If an agent drifts, paste its brief again and ask "Which part of your brief does this change belong to?" Save the briefs in a file next to TASKS.md so you can reuse them.

Section 2: Give Each Agent Its Own Copy

2.1 Set Up a Worktree for Each Agent

Untested: not yet run against a model.

Use this when you want several agents working at once but they keep overwriting each other in one folder. It's for giving each agent its own worktree and branch, explained in plain words.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your main project folder.

Fill in: [THE TOOL OR TOOLS I USE] (e.g. "Claude Code in two terminals", "Cursor"), [TASK NAMES] (from 1.1, e.g. "settings-page, dark-mode, reminders"), [MY COMPUTER] (e.g. "Mac", "Windows", "Linux").

I want to run one AI agent per task, each in its own git worktree on its own branch, so they never edit the same folder. I'm a beginner with git, so explain each step in one plain line.

The tool or tools I use: [THE TOOL OR TOOLS I USE]
Task names: [TASK NAMES]
My computer: [MY COMPUTER]

Please:
1. Check that this project is a git repository with at least one commit and no uncommitted changes. If not, tell me exactly what to do first. Don't commit anything without asking me.
2. Explain in 3 sentences what a worktree is and why it stops agents from overwriting each other.
3. Tell me whether my tool has its own way to make worktrees. If it does, tell me to check its docs for the current steps, because these features change often. If not, give me the exact git commands to make one worktree and one new branch per task, with clear names.
4. Tell me how to open my agent inside each worktree.
5. Remind me which files a new worktree won't have, like .env files and installed packages (for example node_modules), and how to set each one up. Never print the contents of my .env file.
6. Show me how to list all my worktrees, so I can check the setup.
Wait for my OK before running any command that creates something.

Tips to customize: Claude Code's docs show claude --worktree settings-page (or -w), which makes a worktree under .claude/worktrees/ on a new branch called worktree-settings-page. Run it again with a different name in another terminal for a second agent. The docs suggest adding .claude/worktrees/ to your .gitignore. In Cursor, the docs say the IDE has a /worktree command, and the Agents Window can start an agent in its own worktree. Codex's docs say you can pick Worktree under the chat box in the ChatGPT desktop app. With plain git, git worktree add ../myapp-settings -b settings-page makes a new folder on a new branch, and git worktree list shows them all. Git won't let one branch be checked out in two worktrees at once, which is one more reason to use one branch per agent.

2.2 Preflight Check: Latest Code, Same Rules, Ready to Run

Untested: not yet run against a model.

Use this when your worktrees exist and you're about to start the agents. It's for checking each worktree has today's code, the same rules file, and what it needs to run.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your main project folder.

Fill in: [MY RULES FILE] (e.g. "AGENTS.md", "CLAUDE.md", or "I don't have one"), [THE COMMIT OR BRANCH THEY SHOULD START FROM] (e.g. "the latest main", or "my branch add-login with today's work").

I have several git worktrees, one per AI agent. Before I start the agents, check that each worktree is set up the same way. Don't change any code.

My rules file: [MY RULES FILE]
They should all start from: [THE COMMIT OR BRANCH THEY SHOULD START FROM]

Please:
1. Run git worktree list and show me each worktree, its folder, its branch, and its latest commit.
2. For each worktree, tell me if it started from the right commit. If one is missing recent work, for example because my latest commits are only on my computer and not pushed, tell me how to fix it before the agent starts.
3. Check that the rules file is exactly the same in every worktree. If any differ, show me the lines that differ. Remind me that each branch has its own copy, so a rule I change on one branch won't reach the others until I merge it.
4. For each worktree, check whether the files it needs to run are there: ignored files like .env (just say yes or no, never show what's inside) and installed packages.
5. Check for anything two agents would fight over while running, like the same dev server port or the same local database. Suggest a simple fix, like a different port for each.
End with a checklist per worktree: ready, or what's missing.

Tips to customize: This catches a common surprise. Claude Code's docs say new --worktree worktrees branch from your repository's default branch on the remote (usually main) by default, so if your project is on GitHub or another remote, commits you haven't pushed won't be there. To branch from your current work instead, the docs describe a worktree.baseRef setting set to "head". For .env files, Claude Code and Codex both describe a .worktreeinclude file that copies listed ignored files into new worktrees they create. Cursor's docs describe a .cursor/worktrees.json file with setup commands, such as installing packages and copying .env. Change rules on your main branch first, then start the agents, so they all begin with the same rules.

Section 3: Keep Track While They Work

3.1 Who's Waiting on Me?

Untested: not yet run against a model.

Use this when you have several agents running and lost track of which one is stuck, which is done, and which needs an answer. It's for one short status board across all of them.

Use in: two places. Paste the first part into each agent's session. Paste the second part, with their answers, into ChatGPT or Claude in a normal chat.

Fill in: [AGENT NAME] (e.g. "dark-mode"), [PASTE EACH AGENT'S STATUS LINE].

PART 1 (paste into each agent):
Status check from [AGENT NAME]. Don't do any new work yet. Reply in exactly this format, one line each:
- State: working / waiting on me / done / stuck
- Doing: what you're doing right now, in one sentence
- Need from me: the exact question or approval you're waiting for, or "nothing"
- Files changed so far: a short list
- Outside your task: any file you changed that isn't in your brief, or "none"
- Last check run: what you ran and whether it passed

PART 2 (paste into a normal chat, with every agent's reply):
Here are status lines from my agents. Turn them into one short board.
[PASTE EACH AGENT'S STATUS LINE]
Please:
1. Put agents that need me at the top, with their exact question, sorted by which one is blocking the most other work.
2. Then stuck agents, with one line on what might unstick them.
3. Then working, then done.
4. Flag any agent that changed a file outside its task, or two agents that changed the same file. Those come first, above everything else.
5. End with the one thing I should do next.
Keep it to one screen.

Tips to customize: If you use Claude Code, its docs describe agent view (a research preview): run claude agents to see your background sessions in one list, grouped so the ones that need your input are at the top, and reply to one without leaving the list. You can still use Part 1 to get the same short report from every agent, in any tool. Check the board every 20 to 30 minutes rather than every minute. An agent that's waiting on you isn't getting any work done, so answer those first.

3.2 An Agent Wants to Touch Another Agent's File

Untested: not yet run against a model.

Use this when an agent says it needs to edit a file it doesn't own, or you catch it doing so. It's for deciding whether to allow it, hand it to the owner, or change the plan.

Use in: ChatGPT or Claude in a normal chat, or the agent's own session.

Fill in: [THE AGENT ASKING], [THE FILE IT WANTS] (e.g. "src/types/user.ts"), [WHY IT SAYS IT NEEDS IT] (paste its message), [WHO OWNS THAT FILE] (from your task table), [WHAT THE OWNER IS DOING NOW].

One of my parallel agents wants to edit a file that belongs to another agent's task. Help me decide what to do, so the two don't collide.

The agent asking: [THE AGENT ASKING]
The file it wants: [THE FILE IT WANTS]
Why it says it needs it: [WHY IT SAYS IT NEEDS IT]
Who owns that file: [WHO OWNS THAT FILE]
What the owner is doing now: [WHAT THE OWNER IS DOING NOW]

Please:
1. Tell me if the request is really needed, or if the agent can finish its task without touching that file, for example by using what's already there.
2. If it is needed, pick one option and explain why in two sentences:
   a. The owner makes the change, and the asking agent waits or works on something else.
   b. The asking agent makes the change, and the owner is told to leave that part alone.
   c. Pause both, make the change on the main branch myself, then have both agents bring it into their branches.
3. Write the exact message to paste into each agent involved, in its own code block.
4. If this changes the shared contract (types, tables, or routes), tell me which other agents need to know, and write their message too.
Prefer the option where the fewest agents change direction.

Tips to customize: Option (c) is the safest when the file is part of the shared contract, because every agent ends up with the same version. If the same file keeps coming up, your split in 1.1 was too fine. Merge those two tasks into one next time.

Section 4: Bring It All Back Together

4.1 Same Task, Two Agents: Pick the Winner

Untested: not yet run against a model.

Use this when you gave the same task to two or more agents on purpose to see which does it better. It's for comparing the results side by side and picking one, with reasons, before anything gets merged.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your main project folder, or a normal chat with each diff pasted in.

Fill in: [THE TASK] (e.g. "fix the flaky logout test"), [THE BRANCHES OR WORKTREES] (e.g. "worktree-logout-a and worktree-logout-b"), [WHAT MATTERS MOST] (e.g. "smallest change that really fixes it").

I gave the same task to more than one agent, each on its own branch. Compare the results and help me pick one. Don't merge anything.

The task: [THE TASK]
The branches or worktrees: [THE BRANCHES OR WORKTREES]
What matters most to me: [WHAT MATTERS MOST]

Please:
1. For each branch, summarize what it changed in 3 lines, and list the files it touched.
2. Run the same checks on each one (build, tests, linter, whatever this project uses) and show the results side by side.
3. Compare them on: does it fully do the task, how big the change is, anything risky (deleted checks, new packages, changed shared files), and how easy it is to read.
4. Pick a winner and explain why in 3 sentences. If one branch has a good idea the winner lacks, name it, but don't mix the branches together.
5. Tell me what to do with the other branches: keep them for now, or delete them once the winner is merged.
Base this on the code and the check results, not on which agent sounds more confident.

Tips to customize: Cursor's docs describe a /best-of-n command that runs the same task across several models, each in its own worktree, and note that it doesn't merge anything for you. If you want an idea from the losing branch, ask the winner's agent to add it as a small extra step, rather than combining two branches.

4.2 Merge Everything Back Safely

Untested: not yet run against a model.

Use this when your agents are done and their branches are ready. It's for merging them back one at a time, in a safe order, with a test after each one, so you know exactly which merge broke something.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your main project folder (not inside an agent's worktree).

Fill in: [MY MAIN BRANCH] (usually "main"), [THE BRANCHES TO MERGE] (e.g. "settings-page, dark-mode, reminders"), [HOW I CHECK THE APP] (e.g. "npm run build and npm test").

My parallel agents have each finished on their own branch. Help me merge them into my main branch one at a time, safely. Explain each git command in one plain line, and wait for my OK before each merge.

My main branch: [MY MAIN BRANCH]
The branches to merge: [THE BRANCHES TO MERGE]
How I check the app: [HOW I CHECK THE APP]

Please:
1. Check that my main folder has no uncommitted changes and is on [MY MAIN BRANCH]. Check that every branch has its work committed. Tell me about any that don't.
2. For each branch, list the files it changed. Point out any file changed by more than one branch, since those are where conflicts will show up.
3. Suggest a merge order: shared or "do first" changes first, then the smallest and safest, then the biggest. Explain the order in one line per branch.
4. Then, one branch at a time: merge it, run the checks, and tell me the result. If the checks fail, stop and tell me what broke before merging anything else.
5. If git reports a conflict, stop. Don't pick a side on your own. Show me which files conflict and tell me to use Prompt 4.3, or that git merge --abort cancels the merge so I can start over.
6. At the end, show me a short summary: merged branches, check results, and anything left to do.

Tips to customize: Commit or push your main branch before you start, so you have a clean point to go back to. If you work with GitHub pull requests, you can open one per branch and merge them in the same order. Pause the agents while you merge, so nothing new lands on a branch halfway through.

4.3 Fix a Merge Conflict Without Losing Either Agent's Work

Untested: not yet run against a model.

Use this when git says there's a merge conflict after two agents changed the same lines. It's for understanding what each side wanted and keeping both changes where possible, instead of picking one blindly.

Use in: Claude Code, Cursor's Agent, or Codex, opened in the folder where the merge is happening.

Fill in: [THE BRANCH I'M MERGING IN] (e.g. "dark-mode"), [WHAT EACH BRANCH WAS FOR] (e.g. "dark-mode adds a theme switch; settings-page adds a settings form").

I'm in the middle of a git merge and there's a conflict. Help me fix it so neither agent's work gets lost. Don't run git merge --abort, reset, or checkout on any file unless I say so.

The branch I'm merging in: [THE BRANCH I'M MERGING IN]
What each branch was for: [WHAT EACH BRANCH WAS FOR]

Please:
1. Run git status and list every file with a conflict.
2. For each conflict, show me the two versions and explain in plain words what each side was trying to do.
3. Suggest a fixed version that keeps both changes where they can live together. If they truly can't, explain the choice and ask me which to keep.
4. Show me the fixed version of each file before saving it. Make sure no conflict markers are left (lines starting with <<<<<<<, =======, or >>>>>>>).
5. After I approve, save the fixes, run the build and tests, and tell me the results.
6. Only then, tell me the commands to mark the files as fixed and finish the merge.
If you're not sure what one side meant, say so, and tell me which agent's report or commit to check.

Tips to customize: Git's docs explain that during a conflict, the part between <<<<<<< and ======= is one side and the part between ======= and >>>>>>> is the other. If it all feels too tangled, git merge --abort tries to put things back the way they were before the merge started. Git's docs warn it may not fully work if you had uncommitted changes when the merge began, so commit first. Lock files like package-lock.json are often easier to rebuild than to fix by hand. Ask your agent how for your package manager.

4.4 Clean Up and Sync Up

Untested: not yet run against a model.

Use this when everything is merged and you have leftover worktrees, branches, and agents with old code. It's for safely removing what's done, keeping what isn't, and getting every remaining branch back in sync with the same rules.

Use in: Claude Code, Cursor's Agent, or Codex, opened in your main project folder.

Fill in: [MY MAIN BRANCH] (usually "main"), [MY RULES FILE] (e.g. "AGENTS.md"), [ANYTHING TO KEEP] (e.g. "keep the reminders worktree, it's not finished").

I'm done with a round of parallel agents. Help me clean up safely, without deleting any work I haven't merged.

My main branch: [MY MAIN BRANCH]
My rules file: [MY RULES FILE]
Anything to keep: [ANYTHING TO KEEP]

Please:
1. Run git worktree list and git branch, and make a table: worktree or branch, merged into [MY MAIN BRANCH] (yes or no), uncommitted changes (yes or no), and what you suggest (remove, keep, or ask me).
2. Never suggest removing anything that isn't merged or has uncommitted changes. Mark those "ask me" and tell me what's in them.
3. For each one I agree to remove, give me the commands to remove the worktree and then delete its branch, and explain what each does. Use the safe versions that refuse to delete unmerged or changed work.
4. Check whether any rules learned this round should be added to [MY RULES FILE] (for example "always run the tests before reporting done"). Suggest up to 3 short lines. Don't edit the file without my OK.
5. For any worktree I'm keeping, tell me how to bring the latest [MY MAIN BRANCH], including the updated rules file, into its branch.
Wait for my OK before removing anything.

Tips to customize: Git's docs say git worktree remove only removes clean worktrees unless you add --force, and git branch -d only deletes a branch that's been merged. Those safety checks are good, so don't reach for --force or -D unless you're sure. If you deleted a worktree folder by hand, git worktree prune clears out git's leftover notes about it. Tools also clean up on their own: Cursor's docs say it keeps the newest 25 worktrees per computer by default and may remove older ones, even ones you made with git, and Codex's docs say it keeps your 15 most recent Codex-managed worktrees by default. So commit and push work you care about. Don't leave it sitting in an old worktree.

Get new free packs in your inbox

Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.

More free packs: Vibe Code Starter Pack Ship It Safe Fix My Bugs Ship It Live Make It Pretty Get Paid Signup Emails That Actually Arrive Lovable Credit Saver One Rules File for Every AI Tool Make Your Claude Code Limit Last Graduate From Lovable First App Store Submission Survive Your First Traffic Spike Get Found on Google First 100 Users Two AIs, One Project It Broke in Production Hit the Slop Wall? Refactor Without Breaking Everything Vibe Code From Your Phone AI Reverse Engineering Claude Code Guardrails Let AI Review Your AI's Code Make Your Cursor Usage Last Privacy Policy and Terms That Match Your App Install Skills, Plugins and MCP Servers Without Getting Burned Say What You Mean Prompt Injection: Don't Let a Web Page or a Strange File Hijack Your Agent Hit Your Limit Mid-Task? Switch AI Tools Without Losing Your Place Don't Let the AI Delete Your Data: Safe Database Changes Make the AI Teach You While It Builds Bolt Token Saver v0 to Production Claude Code Subagents and Skills for Beginners Logins, Tokens and JWTs in Plain English Put Your Web App on Their Phone Add AI Features in Lovable Is Anyone Using It? Simple Analytics for Vibe Coders Use the Cheap Model for the Easy Stuff: Claude Code Model Mixing Ship Updates Without Breaking the Live App: Preview Links, Checks and One-Click Rollback Try to Break It: Stress-Test Your App Before Strangers Do Claude Code Memory: Stop It Forgetting Your Decisions Fix Your Lovable Security Warnings Without Breaking the Live App What Will My App Cost to Run? A Monthly Bill You Can Predict Leave Claude Code Running Without It Getting Stuck Put Your Lovable App on Autopilot: Automations That Check and Report for You Spec and Tests First: Tell the Agent When It's Done Only Change What I Asked: Stop the AI Rewriting Code You Didn't Mention Stop Getting 429'd: Call Other People's APIs Without Hitting Limits Use the Current Version: Stop the AI Writing Outdated Library Code What Did My Agent Actually Do? Read Your Claude Code Session History Your First Google Play Launch: Get Through the 12-Tester, 14-Day Closed Test Will Anyone Want It? Check Your App Idea Before You Build Claude Code Code Mode: Try It Without Breaking Your Safety Checks Coding With Gemini 4 Neon: Make It Double-Check Its Own Work Understand the App You Already Built: A Guided Tour of Your Own Code Your Guess Might Be Wrong: Make the AI Find the Real Cause Before It Fixes Replit Missions: Give Agents a Goal, a Budget and Approval Rules Make Your Antigravity Quota Last: Pick the Right Gemini Model and Check /usage Turn a Claude Artifact Into a Desktop App, Without Giving It Too Much Access Built It for Work? Make Sure Only Your Team Can Open It Plan Before It Builds: Use GitHub Spec Kit So the Agent Builds the Right Thing Saves That Stick: Fix Data That Disappears Rebuilt Your Site With AI? Make Sure Google Can Still See Every Page Subscriptions and Paywalls: Gate Features by Plan Your AI App Builder Is Shutting Down: Get Your Code, Data and Domain Out Your Own Android App From a Prompt: Build It in Google AI Studio and Put It on Your Phone Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data Accessibility Pass Before You Ship: Make Your App Work With a Keyboard, a Screen Reader and Zoom Update Your Dependencies Without Breaking the App: npm Updates, Audits, Major Upgrades and Dependabot