A
abhishek.it
Back to posts
aiagentscodexopen-source

Building Native Agent Team Mode for Codex

How I added Claude Code-style team coordination to Codex — one lead agent spawning and coordinating multiple teammates in parallel using a shared filesystem task board.

I've been hacking on Codex (OpenAI's open-source CLI agent) and one thing missing was the ability to run multiple agents in parallel, coordinated by a single lead. Claude Code has this built in — a lead agent spawns teammates, creates a task board, and each teammate polls for work, claims tasks, and writes results back. Simple filesystem-based protocol, no fancy orchestration layer.

So I built it natively into Codex.

How it works

The lead agent creates a team and a shared task list on the filesystem. It breaks down the work, creates tasks, and spawns teammate agents. Each teammate:

  1. Polls the task board for available work
  2. Claims a task (atomic file write — no race conditions)
  3. Does the work
  4. Writes results back to the board
  5. Checks for more work

The lead reads results directly from the task board. No message passing, no pub/sub, no database. Just files. It's the same pattern Claude Code uses internally — I just wired it into Codex natively.

Why bother?

GPT-5.3 Codex pricing is significantly cheaper than Claude Opus. If you're running 3-5 agents in parallel doing research, writing code, running tests — the cost difference adds up fast. And for tasks like "write haiku about nature, technology, and time" (my test case), you get 3 agents writing in parallel instead of sequentially.

The coordination pattern

Lead Agent
  ├── Creates team + task board (filesystem)
  ├── Breaks work into tasks
  ├── Spawns N teammate agents
  │
  ├── Teammate 1: polls → claims → works → writes result
  ├── Teammate 2: polls → claims → works → writes result
  └── Teammate 3: polls → claims → works → writes result

Each teammate is a separate process. They don't talk to each other directly — all coordination happens through the shared task board. The lead can monitor progress by reading task statuses.

Shared store, not message passing

Someone asked if the lead handles state sync across the team or if there's a shared store. It's a shared store — per team. The lead creates tasks, agents poll the board, claim work, write results. The lead reads results directly from the board. No need for the lead to relay messages. Agents use team_message only to ask questions, not to send results.

This is the same filesystem protocol pattern Claude Code uses internally. I added it to Codex because it makes agent coordination dead simple and with GPT-5.3 Codex pricing, running a team of agents is very cost-effective.

Will share the fork soon.