Multi-Agent Parallel Feature Work
Multi-agent parallel feature work coordinates several Codex agents, each running in its own worktree, to implement a set of features at once instead of one engineer working through them sequentially. Shared infrastructure such as middleware or a pagination utility is built first in Local mode so every worktree inherits it, then agents implement their assigned feature in parallel before a developer reviews, tests, and merges each result into the codebase.
Your quarterly planning meeting just ended. The roadmap has five features due in three weeks: notification preferences, billing dashboard, user export, admin audit log, and a public API. Each feature touches different parts of the codebase. Traditionally, your four-person team would work on them sequentially with some overlap. With Codex, a single developer can coordinate five parallel agents, each working in its own worktree, producing reviewed PRs for each feature simultaneously. You become the architect directing a team of agents.
What you’ll walk away with from multi-agent parallel development
Section titled “What you’ll walk away with from multi-agent parallel development”- A coordination pattern for running 4-6 Codex agents in parallel without conflicts
- Prompts for decomposing a feature set into independent workstreams
- Techniques for managing shared dependencies across parallel worktrees
- A workflow for reviewing, testing, and merging results from multiple agents
The Workflow
Section titled “The Workflow”Step 1: Decompose into Independent Workstreams
Section titled “Step 1: Decompose into Independent Workstreams”The key constraint for parallel agent work is independence. Two agents modifying the same file will create merge conflicts. Start by identifying what can run in parallel.
Step 2: Build Shared Infrastructure First
Section titled “Step 2: Build Shared Infrastructure First”Codex’s analysis will identify shared dependencies — maybe all five features need a new middleware, or the audit log feature needs to intercept routes used by other features. Handle these in Local mode first.
Merge this to your base branch. Now every worktree created from this point has the shared infrastructure.
Step 3: Launch Parallel Agents
Section titled “Step 3: Launch Parallel Agents”Open the ChatGPT desktop app in Codex mode and create five worktree threads, all based on the branch with shared infrastructure merged. Each thread gets a comprehensive prompt with clear boundaries.
Thread 1: Notification Preferences
Thread 2: Billing Dashboard (same structure, different files)
Thread 3: User Data Export (same structure, different files)
Thread 4: Admin Audit Log (same structure, different files)
Thread 5: Public API (same structure, different files)
Step 4: Monitor and Steer
Section titled “Step 4: Monitor and Steer”With five threads running, the Codex-mode sidebar in the ChatGPT desktop app becomes your command center. Each thread shows its status: running, waiting for approval, or complete.
While agents work:
- Check progress by clicking into each thread. The conversation history shows what Codex has done and what it is working on.
- Leave inline comments if you spot an issue in the review pane. Then send a message: “Address the inline comments.”
- Send mid-task guidance through the composer (same in the CLI and the App): press Enter while Codex is running to inject new instructions into the current turn, or press Tab to queue a follow-up prompt for the next turn.
- Use the integrated terminal (
Cmd + J) to verify changes in each worktree independently.
Step 5: Review, Test, and Merge
Section titled “Step 5: Review, Test, and Merge”As each thread completes, follow this process:
- Review the diff in the review pane. Focus on business logic, not formatting.
- Run
/reviewin the thread to get a second opinion from the reviewer model. - Create a branch with Create branch here on the worktree.
- Push and open a PR directly from the App.
- Request
@codex reviewon the GitHub PR for team-visible review comments.
Merge order matters. Merge features with the fewest shared file modifications first. For the barrel export conflicts, resolve manually:
git checkout feature/notification-preferencesgit merge feature/billing-dashboard# Resolve conflict in src/routes/index.ts (add both import lines)git add src/routes/index.tsgit commit -m "Merge billing dashboard into notification preferences branch"After merging all five feature branches, run the full test suite once more to catch any integration issues.
Scaling with Cloud Tasks
Section titled “Scaling with Cloud Tasks”For features that require longer execution (complex business logic, extensive testing), delegate to cloud tasks instead of local worktrees. Each cloud task runs independently in its own container.
# Launch three features as cloud tasks in parallelcodex cloud exec --env my-env "Implement the billing dashboard feature..." &codex cloud exec --env my-env "Implement the user data export feature..." &codex cloud exec --env my-env "Implement the public API feature..." &Each task produces a diff and optional PR. Use --attempts 2 for features where quality matters more than speed — Codex generates two solutions and you pick the better one.
When multi-agent parallel development breaks down
Section titled “When multi-agent parallel development breaks down”Merge conflicts in shared files. Despite careful planning, some conflicts are inevitable. The most common: import barrel files, middleware registration, database schema exports. Minimize by telling each agent to add only one or two lines to shared files, and resolve conflicts during the merge phase.
One agent’s implementation is incompatible with another’s. Agent 1 builds the notification service expecting a specific event format; Agent 5 builds the public API emitting a different format. Prevent this by defining shared interfaces in the infrastructure phase. Include “use the EventPayload interface defined in src/types/events.ts” in both agents’ prompts.
Worktree retention reached. ChatGPT desktop keeps the 15 most recent Codex-managed worktrees by default. Five parallel features consume five slots immediately; adjust the retention limit or promote important worktrees to permanent projects.
Local machine runs out of resources. Five worktrees, each with its own node_modules and potentially running processes, can exhaust CPU, memory, or disk. Use cloud tasks for the heaviest features, and stagger local worktree starts so they are not all building dependencies simultaneously.
Tests pass individually but fail together. Each worktree tests in isolation. After merging, tests may fail due to interactions between features (port conflicts, database table conflicts in tests, shared state). Include an explicit integration testing phase after all merges.