Two CLIs agents share a repo, syncing Claude Code with Codex without conflict
agents claude openai
| Source: Mastodon | Original article
Developers can run two agent CLIs in one repo, enabling Claude Code and Codex to share context without interfering with each other.
A developer who works daily with Anthropic’s Claude Code and OpenAI’s Codex on macOS discovered that the two agents quickly began overwriting each other’s edits when they were pointed at the same repository. After a month of “horse‑racing” the tools, the author spent more time shuttling context between them than actually writing code.
The breakthrough came from treating the two command‑line interfaces as a single collaborative team rather than competing bots. By consolidating the agents under one shared instruction file—rather than maintaining separate files that drift apart—the workflow gained a stable reference point. Adding a Git worktree for each agent gave them independent checkouts, preventing direct file collisions. A lightweight “handoff” document then carries the repository state and instruction set when the developer switches from Claude Code to Codex, while the session history stays local to each tool.
The recipe, now documented across several community posts, shows that the only artifacts that need to move between agents are the repo snapshot and the instruction files; the conversational context does not transfer. This approach also clarifies the limits of Codex’s integration inside Claude Code, where only a defined set of eight commands are permitted.
Why it matters is twofold. First, it demonstrates a practical method for developers to harness the strengths of multiple AI coding assistants without the chaos of duplicated edits—a pain point highlighted in our recent coverage of AI coding agents and the human‑review bottleneck. Second, it points to a broader shift toward multi‑agent pipelines, where shared metadata and isolated workspaces become the glue that lets different models cooperate.
What to watch next are emerging tools that automate the shared‑instruction and handoff steps, and any moves by Anthropic or OpenAI to formalise multi‑agent standards. If the community adopts these patterns, the productivity gains from AI‑augmented development could become more predictable and scalable.
Sources
Back to AIPULSEN