Agents · Codex
OpenAI Codex for teams, without collisions
In shortRun lanes init --agents codex in your repository and commit the result. Lanes writes .codex/hooks.json so that every Codex edit is committed as you and published to a shared branch, after waiting for any teammate editing the same file. Add lanes mcp to Codex so its agent can read the team brief and check a file before touching it.
Codex on a team
Codex edits through patches, often several files at once, which makes a silent overwrite of a teammate's change harder to spot in review. When two people's agents work in the same repository, one can overwrite the other's change in a shared file, or write new code against a function the other is renaming. Git shows the damage later, at merge time, after both agents have finished.
Lanes connects every agent on the team to one coordination server. Codex gets a team brief with each prompt, heads-ups about teammates' changes, and the rest of the team's agents see what Codex is changing.
What Lanes installs for Codex
Lanes writes .codex/hooks.json in the repository. Codex reports every file edit as apply_patch, so the hook reads the files from the patch's *** Update File: lines, takes a lease on each and queues behind a teammate's agent when needed, then commits and publishes after the patch is applied. The prompt hook adds the team brief.
The file is committed with lanes init, so every teammate gets it when they pull. lanes off removes only the Lanes entries and leaves your own settings alone.
| What | Codex with Lanes |
|---|---|
| Edits wait for a teammate's edit of the same file | Yes |
Each edit committed as you and published to lanes/main | Yes |
| Team brief added to each prompt | Yes |
| Heads-up before reading a teammate's file | No |
| Check at the end of a turn | No |
| MCP team tools | Yes |
Set it up
- Get Lanes:
git clone https://github.com/mfmatozza/lanes && cd lanes && npm ci && npm run build. The commands below writelanesfornode /path/to/lanes/dist/lanes.cjs. - In your repository, run
lanes init --agents codexand push the commit it makes. - Turn on shared context once per repository:
lanes team on, then commit.lanes/team.json. - Add the MCP server to Codex:
codex mcp add lanes -- node "/path/to/lanes.cjs" mcp- Check the machine with
lanes doctor.
Working alone, the first session starts a local Lanes server. For a team, one person runs lanes server --host 0.0.0.0 and invites the others with lanes invite <name>.
Things to know about Codex
- Codex runs repository hooks only after each person trusts them: run
/hooksin Codex once and approve the Lanes entries. - Codex loads
.codex/hooks.jsononce the project's.codex/layer is trusted. lanes approve <id> --run --agent codexruns an approved request with your own Codex, in its read-only sandbox for read-only requests.
Status
Built from Codex's published documentation and covered by Lanes' automated tests. It has not yet been run against the real Codex. Issues and reports are welcome.
Mixed teams work: one person can use Codex while teammates use Claude Code, Codex or Cursor. Every agent reports to the same server, so the brief and the heads-up name each teammate's task whatever agent they run.
Questions
Does Lanes handle Codex patches that touch several files?
Yes. The hook reads every file named in the patch and takes a lease on each before the patch is applied.
Why do I have to approve the hooks in Codex?
Codex asks each person to trust repository hooks before running them. Approve them once with /hooks.
Can I use the MCP tools instead of hooks?
You can use both. The hooks queue edits and publish them; the MCP tools let the agent ask for the brief, check a file and send requests.