Run multiple AI agents at once on a Mac, including GUI work

How to run several Claude Code, Codex or Cursor agents in parallel on one Mac: separate checkouts for code, and for app work a cursor, keyboard and clipboard of their own for every agent.

By Paul Kasten · Updated

Short answer: For code, run each agent in its own terminal and its own checkout, for example with claude --worktree <name> or a separate git worktree per agent, so their edits never collide. For work in Mac apps, parallel agents collide on the one pointer, keyboard focus and clipboard your Mac has, and Claude Code's built-in computer use lets only one session use the computer at a time. ShadowCursor gives every agent its own cursor (in its own color, with a name tag), its own keyboard, clipboard and windows, so several agents can operate apps at the same time.

Two kinds of parallel work

Running several agents at once means two different problems, and they have different fixes:

  • Code and shell work happens in files and terminals. Agents collide when they edit the same files or fight over the same port. The fix is separation: one checkout and one terminal per agent.
  • GUI work happens in app windows: testing the app an agent just built, filling a spreadsheet, working through a website. Agents collide because they share one set of input devices. Separate folders do not help here.

Code in parallel: one checkout per agent

The reliable setup for several coding agents is the same for Claude Code, Codex CLI, Cursor and others:

  1. One task per agent. Give each agent a clearly separate job: a feature, a bug, a test suite. Two agents on the same files produce conflicts no tool can resolve for you.
  2. One checkout per agent. A git worktree is a second checkout of the same repository on its own branch. Claude Code creates one for you with claude --worktree feature-auth; run the same command with another name in a second terminal for a second isolated session (source). For other agents, git worktree add ../shop-fix-checkout fix-checkout creates the folder, and you start the agent inside it.
  3. One terminal or window per agent. Each agent runs in its own terminal tab, or each Cursor or VS Code window opens its own worktree folder.
  4. Separate ports and test data. If every worktree starts a dev server on the same port, the second one fails or talks to the first. Give each its own port and, where it matters, its own test database.
  5. Merge through branches. Each agent commits on its branch; you review and merge as you would with a colleague's work.

Unrelated projects are simpler still: a separate folder and terminal per project is enough.

Why GUI work collides

As soon as agents need apps, the separation ends. A Mac has one pointer, one keyboard focus and one system clipboard, and tools that drive them directly hand all three to whichever agent acts last:

  • Pointer: agent A moves the cursor to a button, agent B moves it to its own window before A clicks, and A's click lands in B's app.
  • Keyboard: keys go to the focused window. When B brings its window to the front, the rest of A's typing ends up in B's document.
  • Clipboard: A copies an invoice number, B copies a URL, A pastes the URL into the invoice field.
  • Windows: tools that bring their window to the front, or hide other apps, cover each other's work.

None of this shows up as an error. The agents simply do the wrong thing, which is worse.

The built-in limit: one computer use session in Claude Code

Claude Code's built-in computer use avoids the collision by allowing only one session at a time. A session takes a lock at its first computer use action and releases it when the session exits, not when the task finishes. A second session's computer use fails with an error naming the session that holds the lock. While Claude works, other visible apps are hidden and restored when the turn ends (source).

For Claude Desktop and Codex in the ChatGPT desktop app, running several computer use tasks at once is not documented; OpenAI's guidance is to give ChatGPT "one clear target app or flow at a time" (source).

So with the built-in tools, coding agents can run in parallel, but the GUI steps are serialized: one agent tests its app, the others wait for the lock.

What each agent needs for parallel GUI work

ResourceShared by all agentsPer agent
CursorThe one system pointerA cursor of its own, in its color with its name
KeyboardWhatever window has focusKeys that arrive only in the agent's window
ClipboardThe system clipboardA private clipboard per agent
WindowsBrought to the front, others hiddenStay where they are, work even when covered
ScreenshotsThe whole screenOnly the window the agent works in

How ShadowCursor runs several agents at once

ShadowCursor is a Mac app and MCP server that gives each connected agent the right-hand column of that table. Every agent gets its own cursor, drawn on screen in its color with a name tag, so you can see at a glance which agent is clicking where. Its keys reach only its window. Its copies and pastes stay in its own clipboard and never touch yours or another agent's. Its windows can sit behind yours, and it sees only those windows.

Agents can even work in different windows of the same app: each types into its own window. Claude Code in one terminal, Codex in another and an agent in Cursor can all operate Mac apps side by side. The license covers unlimited agents. If you are new to the idea, background computer use on the Mac explains the basics, and computer use MCP servers covers what to look for in one.

A practical setup

A setup that works well for three agents:

  1. Agent 1, Claude Code in worktree feature-settings: builds the macOS app, launches the build and clicks through the new settings window to check it.
  2. Agent 2, Codex CLI in worktree fix-export: fixes the CSV export, then opens the exported file in Numbers and checks the totals.
  3. Agent 3, Cursor on the website repository: tests the checkout in a Safari window of its own.

Tips that keep it smooth:

  • Name the app in the task. "Open the build in its own window and test the settings" is easier to follow than "test it".
  • One document per agent. Two agents in the same spreadsheet will overwrite each other's cells, whatever tool they use.
  • Browsers: each agent opens its own browser window. A background tab of your window cannot be used.
  • Ask before irreversible steps. Tell agents to stop before sending, buying or deleting.

Limits to know

  • Minimized and hidden windows cannot be seen or operated. Covered windows can.
  • System drag and drop of files, tabs or text follows the real mouse, so ShadowCursor cancels such drags.
  • Hover without a pressed button works in Safari, not in Chrome or Electron apps.
  • When an agent works in the app you are typing in, it waits for your pauses.
  • More agents also mean more model usage on your plan or API key.

FAQ

Can two Claude Code sessions use computer use at the same time?

Not with the built-in computer-use server. One session holds a lock until it exits, and the second session's computer use fails with an error. With a separate MCP server such as ShadowCursor, each session connects on its own and gets its own cursor.

How many agents can run at once?

ShadowCursor does not limit the number of agents. In practice the limit is your Mac's memory and processor and your model usage, not the input devices.

Can Claude and Codex work on the same Mac at the same time?

Yes. Run them in separate terminals and checkouts for code. For app work, both can connect to ShadowCursor, and each gets its own cursor, keyboard and clipboard.

Will parallel agents mix up my clipboard?

With ShadowCursor, no: each agent has a private clipboard for its copies and pastes. App-specific Copy buttons that write to the system clipboard themselves are an exception, because the app writes there directly.

Do I need git worktrees?

For several agents in one repository, yes, or a separate clone per agent. For separate projects, a separate folder per project is enough.