OpenRig: Putting Claude Code and Codex on the Same Team
How do you manage multiple AI coding agents each doing their own thing in the terminal? OpenRig uses YAML to define agent teams, building a persistent collaboration system with shared context, recoverability, and observability for Claude Code and Codex. This article covers its core design, getting-started path, and security trade-offs.
How many agent sessions do you have open in your terminal? Three? Five? Do you remember what each one is working on—which one is writing code, which one is reviewing, and which one has been stuck for ten minutes? That's exactly what OpenRig is for: orchestrating that pile of terminal sessions—Claude Code and Codex—into a persistent agent team.
A bit of background first. Claude Code is Anthropic's command-line AI coding tool; Codex is OpenAI's. Both can modify code in the terminal based on instructions. tmux is a terminal multiplexer that lets you run multiple sessions in a single window. OpenRig is an open-source multi-agent orchestration system that defines team topology in YAML and launches with a single command. The author says this is the system behind their "AI civilization experiment." The repo is approaching 5,000 stars at the moment.
One core concept: A harness wraps a model. A rig wraps your harnesses. An individual agent is a harness; a rig wraps your multiple harnesses. So Claude Code and Codex can appear in the same rig: one as owner, one as checker, sharing context, each with a clearly defined role.
What can it do? Define the topology in YAML (RigSpec), group seats into pods, and set continuity policies. Then `rig up` starts all the tmux sessions, harnesses, and startup files. The TUI shows the topology as both graphs and tables, with each seat showing runtime, model, context, and state. It can also auto-discover Claude Code and Codex sessions you already have running in tmux and adopt them into the rig. You can snapshot the entire topology (`rig down --snapshot`) and restore it by name later. Agents communicate via `rig send`, `rig broadcast`, and `rig chatroom`. If you're manually typing code on a seat, you can enable typing guard; the agent's automatic messages will be held until you're done, so they won't interfere while you're typing. You can even resize the team at runtime with `rig grow` and `rig shrink`, without restarting the entire rig.
What it manages is the system the agents form—it doesn't wrap the models themselves. Each agent still runs in a native tmux session, so you can attach at any time to watch it work.
Getting started is easy. Requirements: Node.js 22 or 24, tmux, macOS or Linux. Native Windows isn't supported yet, and WSL2 hasn't been tested either. Note: Mac Apple Silicon users should use Node.js 22. Installation:
```
npm install -g @openrig/cli
rig setup --dry-run
```
`--dry-run` previews what setup is going to do. The README goes to great lengths to explain which files OpenRig writes on your machine: ~/.tmux.conf, ~/.claude.json, CODEX_HOME/config.toml, .claude/settings.local.json, and so on. It also injects some permission and hook configuration at startup.
Security deserves extra attention here. In an era when AI agents routinely demand full permissions, OpenRig turns YOLO off by default. It requires your explicit consent before an agent can run rig commands without showing a permission prompt. Also, permission mode and working posture are separate: you can let agents work boldly on code while system-level permissions follow your settings. It even lets you check, at any time, the permission mode a seat is set to and the parameters it was last actually started with.
Launch a two-agent team:
```
cd /path/to/your/repository
starter=first-project # 或者 first-project-claude / first-project-mixed
rig up "$starter" --cwd .
rig tui
```
There are three starters: first-project runs two Codex agents, first-project-claude runs two Claude agents, and first-project-mixed has Claude as owner and Codex as checker.
The image below is a real TUI recording: the build rig is shown as a graph first, then a seat table where each seat has runtime, model, context, and state; clicking in shows a seat's details. The whole recording is 10 seconds.

Then send a task to the owner:
```
rig send "dev-owner@$starter" 'Implement
```
You don't need to coordinate each agent. Tell the owner the outcome you want, and it will have the checker review it, then bring back the result along with any decisions that need your sign-off.
Architecturally, OpenRig is a local daemon + CLI + TUI + MCP server, built on tmux. Data is stored in SQLite. MCP tools let agents manage the topology themselves: rig_up, rig_ps, rig_send, and so on. It also supports discovering and adopting existing tmux sessions; snapshot restore reports each node as resumed, fresh, or failed.
The TUI's topology graph looks like this:

The screenshot is from the interactive TUI demo, using fictional project data.
Compared with Claude's hosted Managed Agents, OpenRig is open-source and self-hosted, and Claude Code and Codex can be mixed together. You decide where it runs and whose models you use; the cost is simply the model API fees of the provider you choose. If you want to stay in your own terminal without being locked into a vendor, this is one option.
A few technical details. 0.6.0 only supports Node.js 22 and 24; Node 20 is rejected because better-sqlite3 13 requires Node 22+. If your environment is on Node 20, you'll need to switch Node versions with nvm or fnm first, then reinstall the CLI. Also, upgrading from 0.5.9 has a dedicated migration script: it requires a backup first, runs in stages, outputs JSON at each step, and only does the final switch after verification passes. That kind of migration design is worth referencing for other projects.
If your agent terminals have multiplied to the point where you can't remember who's who, this project is worth a look. It may not fit every scenario, but it at least offers a way to organize an AI team: tmux as workstations, YAML as the org structure, and Claude and Codex working in the same office.
发布时间: 2026-10-04 19:38