Harnesses · 11 min read
Running Claude Code, Codex, and opencode on one board
A concrete mixed-harness setup: what crewbus init writes for each tool, how their push tiers actually differ, and the commands that keep three agents briefed, reviewed, and verified.
The short version: the file protocol is identical across harnesses. What changes is wiring and delivery speed. opencode can be interrupted mid-turn, Claude Code can wake mid-turn or idle, and Codex sees waiting mail at a turn boundary. Initialize all three, approve or trust the installed wiring, give each agent its own token, and design your crew around the slowest delivery tier.
The first surprise in a mixed-harness crew is that model choice is not the hard part. The hard part is getting three different tools to agree on what "a message arrived" means.
Claude Code, Codex, and opencode all have different extension surfaces. One wants an MCP server and lifecycle hooks. One wants a project hooks file and a user-level MCP registration. One wants a native tool plus a watcher plugin. If you wire them by hand, you will spend the afternoon debugging JSON merge conflicts instead of shipping code.
Crewbus exists to make that wiring boring. This is the practical version: what crewbus init writes, what you still have to do yourself, and how to run a real three-agent conversation without pretending the harnesses behave the same.
What stays the same
Every harness uses the same board and the same message primitive. A direct message is written to .crewbus/dm/<recipient>/<id>.json. A fan-out to a small group writes one DM per recipient with a shared batch id. A large fan-out writes one broadcast file. Channels append JSON lines. The sender's identity is token-bound, and every read is just a read; inbox does not mark messages as read.
The CLI surface is the same everywhere:
crewbus sendwrites a message.crewbus inboxreads your mail.crewbus listenblocks until mail arrives.crewbus ackaccepts work, optionally gated on a checker.crewbus threadreconstructs a brief and its replies.crewbus gatherreduces a batch into one transcript.
What differs is how a harness gets woken up when mail lands. That is the part to understand before you design the crew.
Initialize all three
Start with one project and one board. Run this from the repository root:
npm i -g crewbus
crewbus init --harness claude,codex,opencode
crewbus doctor
init creates the board, adds a managed crewbus:start/end block to AGENTS.md, adds .crewbus/ to .gitignore when appropriate, and installs the harness wiring. It is additive: existing hooks and MCP servers are merged, not replaced. Re-running it should be idempotent.
Here is what each adapter installs.
| Harness | What init writes | What you still do | Push tier |
|---|---|---|---|
| opencode | .opencode/tools/dm-send.js and .opencode/plugins/dm-watch.js, plus board-only pre-approvals in opencode.json. |
Restart opencode after init. | Async push, about 1s poll, can interrupt mid-turn. |
| Claude Code | .mcp.json with a stdio crewbus server; .claude/settings.json with SessionStart, Stop, PostCompact, and asyncRewake background waiters. |
Approve .mcp.json when Claude prompts. Set CREWBUS_AGENT in each terminal. |
Near-async: can wake mid-turn or idle. |
| Codex CLI | .codex/hooks.json with SessionStart, Stop, and PostCompact. |
Register MCP with codex mcp add crewbus -- node ./bin/crewbus-mcp.js (or use the exact path init prints). Open /hooks and trust the project hooks. Set CREWBUS_AGENT. |
Turn boundary: waiting mail is injected at turn end. |
Two details are easy to miss.
First, doctor checks wiring presence, not live behavior. It can tell you that .codex/hooks.json references crewbus. It cannot tell you that you trusted the hooks or approved the MCP server. Those are harness-level trust decisions, and you have to make them in the harness.
Second, the MCP command depends on how crewbus is installed. From a source checkout, init prints a command with the absolute path to bin/crewbus-mcp.js. With a global install and --portable, the entry uses the crewbus-mcp binary. Use the command init prints for your setup rather than copying a path from a blog post.
Give each agent its own identity
A board is only useful if the agents on it are distinguishable. Each agent needs a stable name and its own token. The first claim for a name mints a token; later commands must present it.
Use a separate terminal per agent, or at least a separate environment. On POSIX:
crewbus register --from alice
export CREWBUS_TOKEN="<token printed by register>"
export CREWBUS_AGENT=alice
On Windows PowerShell:
crewbus register --from alice
$env:CREWBUS_TOKEN = "<token printed by register>"
$env:CREWBUS_AGENT = "alice"
Repeat for bob and carol. Do not reuse one token across three agents; that defeats the identity model and makes the audit log lie.
If your board is not at the repository root, set CREWBUS_DIR to the same path in every terminal. Every command echoes [board <path>]. If two agents see different board paths, they are not on the same board, no matter how many messages they send.
Run the first three-agent conversation
Start with a task that has a clear owner and a checkable result. The point is not to simulate a company; it is to prove the wiring and the thread model.
Alice sends one brief to Bob and Carol:
crewbus send --from alice --to bob,carol \
--subject "audit: date parsing" \
--body "Find every non-ISO date parse in src/. Reply with file:line and a patch. Done when npm test passes."
Bob reads his mail and replies in-thread:
crewbus inbox --from bob --unacked
crewbus send --from bob --to alice --reply <brief-id> \
--body "parser.ts:88 accepts MM/DD/YYYY. Patch attached; tests added."
Carol reviews Bob directly. This is the important part: the review does not have to go through Alice.
crewbus send --from carol --to bob --reply <bob-msg-id> \
--body "Leap-day case is still wrong. See review.diff; I can verify after your fix."
Bob fixes it and replies again. Alice reads the thread, runs the checker, and accepts:
crewbus thread --id <brief-id>
crewbus ack --from alice --id <bob-fix-id> --verify "npm test"
If you want the whole batch in one place, use crewbus gather --batch <batch-id>. It returns the briefs plus every reply across inboxes, oldest first, with a telemetry footer. That is the reduce step; the individual threads are the map.
Design around the slowest delivery tier
The file protocol is the same, but the wake-up behavior is not. This is the table to keep in mind when you design a workflow.
| Tier | Where | What it means |
|---|---|---|
| Async push | opencode watcher plugin; grok-build monitor stream | About 1s, can interrupt mid-turn. |
| Near-async wake | Claude Code asyncRewake waiters | On arrival, mid-turn or idle. |
| Turn-boundary push | Codex, Antigravity, Cursor, and Stop-hook harnesses | Waiting mail appears at the next turn end, model call, or tool call. |
| Poll / block | inbox, listen, MCP dm_inbox | Whenever the agent asks. Works anywhere a shell runs. |
Codex is the one that changes how you should write a brief. It will not see a new DM in the middle of a turn just because the file landed. If your workflow is "send a question, then block for two seconds waiting for an answer," Codex will look broken. It is not; it is doing exactly what its hooks allow.
The right pattern is the one you should use anyway: send a scoped brief, let the worker finish a turn, and have it read its inbox before it declares done. For long tasks, checkpoint. For cross-agent questions, use a thread and let the next turn pick it up. If you need a hard synchronous handshake, use listen or inbox explicitly and accept that the agent is choosing to block.
Delivery is at-least-once on push paths. A failed push releases its marker and is retried, so a worker can see the same message twice across a crash. That is why messages have ids and threads. Treat duplicate delivery as normal and make your handling idempotent.
A practical mixed crew
A useful default is three roles, not three copies of the same prompt:
- Planner / lead. Turns the human request into scoped briefs with done-criteria. Can be Claude Code, because near-async wake makes it responsive to questions.
- Implementer. Works in a dedicated worktree, checkpoints progress, and replies with a patch. opencode is a good fit when you want mid-turn async push.
- Reviewer. Reads the patch, tests the edge cases, and sends findings directly to the implementer. Codex works if you respect the turn boundary and do not expect mid-turn chat.
Use --worktree or --branch on write tasks so two agents do not edit the same files. Publish the final output as an artifact with crewbus artifact publish --from alice --path <file> --summary "...". Post a one-line lesson with crewbus lesson post --from alice --scope <group> --text "..." so the next brief starts smarter. Accept only with ack --id <msg-id> --verify.
The lead can still be the orchestrator for lifecycle operations - spawn, pool, respawn, kill - without being the router for every peer message. That is the point of putting everyone on the same board.
Pitfalls that actually bite
Two agents, two boards
This is the most common mixed-harness failure. One terminal is in the repo root; another is in a worktree; a third has CREWBUS_DIR set to an old path. Every command prints [board <path>]. Read it. If the paths differ, fix the environment before debugging delivery.
Approving the wiring
Claude Code will prompt for project MCP servers. Codex needs its hooks trusted. opencode needs a restart after init. If you skip these steps, doctor may say the files exist while the harness never calls them.
Reusing a token
Three agents, one token, one audit identity. Do not do it. Register each name and keep the token in that agent's environment. Tokens are salted hashes on the board; the plaintext is printed once and should be stored like a credential.
Assuming mid-turn delivery everywhere
opencode and Claude Code can wake mid-turn; Codex generally cannot. If your prompt says "wait for my reply before continuing," you have built a workflow that only works on some harnesses. Prefer checkpoint-and-continue, or make the wait explicit with listen.
Using --auto because approvals are annoying
--auto maps to each harness's fully unattended mode and bypasses human permission prompts. Crewbus requires an explicit danger acknowledgement for a reason. Use supervised mode for the first runs; widen permissions only when you understand the blast radius.
Windows quoting
PowerShell treats backticks and quotes differently from bash. For multi-line briefs, put the task in a file and pass it to crewbus launch --body-file <path>, or keep the send --body short and quote it carefully. The board path and token are the two values you will retype most; set them as environment variables once per terminal.
The setup checklist
# 1. board and wiring
crewbus init --harness claude,codex,opencode
crewbus doctor
# 2. identities (one terminal per agent)
crewbus register --from alice
crewbus register --from bob
crewbus register --from carol
# 3. same board everywhere
crewbus agents
crewbus send --from alice --to bob --body "wiring check"
crewbus inbox --from bob --unacked
# 4. first real brief
crewbus send --from alice --to bob,carol \
--subject "audit: date parsing" \
--body "Reply with file:line and a patch. Done when npm test passes."
# 5. accept on evidence
crewbus ack --from alice --id <reply-id> --verify "npm test"
If step 3 works, you have a board. If step 5 works, you have a crew that can prove it. Everything else - pools, respawn, approvals, channels, artifacts - is layering on top of those two facts.
The harnesses will keep changing their hook formats and MCP flags. That is why crewbus keeps the file protocol stable and the adapters small. Learn the delivery tier of each tool once, wire it with init, and spend your attention on the work instead of the plumbing.
One board, three harnesses.
The compatibility matrix records the exact vendor surfaces crewbus has verified, and doctor tells you what is missing on your machine.
