skip to content

codex and claude code together on one team.

published

a team can run Codex and Claude Code on one repository with agentmash: each developer’s agent reports its edits to the room, and before either edits a file a teammate’s agent just changed (in Codex, before an apply_patch, once its hooks are approved), it’s told who changed it, when, and how. your own agents aren’t warned about each other.

what reaches the room from codex

Codex runs the same hook scripts as Claude Code, registered in ~/.codex/hooks.json (or under $CODEX_HOME) with --client codex, and the room records each edit as Codex’s: codex:apply_patch or codex:Bash.

what the codex agent is told before an edit

before an apply_patch, a PreToolUse hook asks the room about the patch’s files, up to eight, with what each one imports and exports. Codex hands a hook’s additionalContext to the model, so the advisory arrives as a note and, by default, the edit goes ahead. it isn’t repeated for that file within ten minutes, except to name a teammate or a claim new to it.

the words are Claude Code’s, from the same script. a teammate’s change on their own machine, or on another branch, comes as a PARALLEL EDIT, which asks the agent to keep its edit additive and name any divergence in its reply. the loudest of the five advisory levels is for two people in one checkout, after a write in the last five minutes by a teammate still around, or for a confirmed symbol overlap there:

[AgentMash: ACTIVE COLLISION] alice's agent is working in src/models/user.ts — last write 2 min ago on your branch (main), while working on 'add soft deletes to the user model' (+12/-3 lines, touching deletedAt). Their write is already in your working tree, so whatever you read from this file earlier is out of date. Re-read src/models/user.ts now and rebuild this edit against what is actually there: a stale old_string either fails to match or quietly reverts their change. Leave deletedAt named and shaped as alice left it — that is what they just changed. If your task genuinely needs those same lines, change them and say so in your reply, so the overlap is visible.

claude code and codex, side by side

what happensClaude CodeCodex
where the login puts it~/.claude/settings.json~/.codex/hooks.json, and the MCP server in ~/.codex/config.toml
before the hooks runa restarta new session, an approval in the Codex CLI’s /hooks, once, and a restart
the warning before an edita note in the agent’s context; by default the edit goes aheadthe same note, before an apply_patch
a shell commandreported afterwards, never warned beforereported afterwards, never warned before
what an edit reportsthe file, its line counts and the names it touches: +12/-3 lines, touching deletedAteach file in the patch, with its line counts
claims and the MCP toolswhere the repository registers the MCP server; the login adds hooks onlywith the login

what Codex does with a hook’s output, and where it keeps its MCP servers, is from OpenAI’s docs, checked on . how each coding agent was checked, as of : the warning before an edit and the reports were tested live in Claude Code, Codex, Cursor, GitHub Copilot (its CLI), Kilo Code and OpenCode, and the MCP tools in Claude Code and Codex; Amp, Cline, Crush, Factory Droid, Gemini CLI, goose, Kiro, OpenHands and Qwen Code are held by our tests against payloads recorded from each tool, not run live yet; Devin, Antigravity, Junie, Continue and Zed rest on their own docs (Devin and Junie partly on our tests too), not tested live yet.

claims and the mcp tools

the login also adds agentmash’s MCP server to ~/.codex/config.toml, which the ChatGPT desktop app, the Codex CLI and the IDE extension share, so a Codex teammate gets claims and the MCP tools, like who_is_working_on_what and claim_work, from the login alone, unless it says it skipped config.toml, and why. a Claude Code teammate gets them only where the repository registers agentmash’s MCP server: the login adds hooks, not the server. either way, an agent about to edit a file a teammate claimed gets an [AgentMash: CLAIMED] note from the hooks (in Codex, before an apply_patch). a claim is advisory, never a lock; how long a claim lasts is in the docs.

agents.md and claude.md: one file for both

Codex reads AGENTS.md, per OpenAI’s AGENTS.md guide. Claude Code 2.1.277 or later reads AGENTS.md when there’s no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the working directory or above it, per Anthropic’s memory docs, both checked on . CLAUDE.local.md is personal and uncommitted, so one teammate’s turns AGENTS.md off for that teammate alone, and in a session that can’t read AGENTS.md, such as the first after an upgrade from 2.1.276 or earlier, a CLAUDE.md pulls it in with @AGENTS.md. on Codex’s side, an AGENTS.override.md in a directory is read instead of its AGENTS.md. so one AGENTS.md can carry the rules for both, with an @AGENTS.md line at the top of any CLAUDE.md. agentmash writes to neither file.

what one study found about mixing agents

in one study of 33,596 agent-written pull requests in 2,807 open-source repositories, from December 2024 to July 2025, mostly OpenAI Codex’s (21,799, against 459 from Claude Code), the authors replayed one pair per repository of pull requests open at the same time: pairs from two different agents hit a textual conflict 41.7% of the time (48 of 115), against 19.8% (119 of 601) for pairs from the same agent (Xu, Subramanian and Karthik). most overlapping pairs had one agent on both sides, and the cross-agent ones were mostly Codex with Cursor, Devin or GitHub Copilot; the paper gives no figure for Codex with Claude Code. the same authors’ follow-up wrote “We therefore do not claim a cross-vendor penalty” (arXiv 2610.04779, section 3.1). whether agentmash’s warnings lower a rate like this is not measured; how often AI coding agents cause merge conflicts puts it beside the other studies.

can codex and claude code talk to each other?

on one machine, Claude Code can hand Codex work: OpenAI’s Codex plugin for Claude Code passes Codex a review or a task through the local Codex CLI and app server (checked on ). across a team, the two don’t talk directly. each hears about the other through the room: a short heads-up when a teammate’s agent is at work on its branch or in a file it changed (when a session starts, and at a prompt when that’s news, at most once every ten minutes), the warning before an edit (in Codex, before an apply_patch), and the MCP tools where it has them. in Codex, the hooks behind the first two run once they’re approved in /hooks.

a person can also ask a teammate’s agent for something, when both can push to the repository and have run npx agentmash login: npx agentmash ask @dana "check why ci is red on main" sends dana a read-only suggestion, and her agent, Codex or Claude Code, is told in one line that it’s waiting, when her next session starts or at a prompt, unless the room turned that off. nothing runs on its own: npx agentmash inbox accept <id> prints it for her to paste into her own agent.

what it doesn’t do with codex

set up codex and claude code together

  1. someone who can push to the repository connects it once, at agentmash.dev/install.
  2. each developer runs npx agentmash login once on each machine (Node.js 18.12 or newer). it writes the hooks for Codex and Claude Code, and Codex’s MCP server, into the home directory, so nothing is committed.
  3. open a new session of the Codex CLI, 0.129 or newer. when it warns that hooks need review, type /hooks and approve agentmash, once; an upgrade of agentmash doesn’t ask again.
  4. restart Codex and Claude Code.

step by step, with a prompt to paste into Codex: setting up Codex.

the codex adapter →