relayline

Coding agents as each other's lead and sub-agent

Shared memory, work split by difficulty, every piece checked, and a receipt for what it cost. Claude Code, Codex and DeepSeek can each lead or take work. The command is ccx; Python standard library only.

pipx install git+https://github.com/SUPERD6/relayline

Then run ccx setup — it explains each step and asks before changing anything.

Claude Code Codex DeepSeek Gemini CLI (sub-agent adapter, not run for real)
a real run on Windows (trimmed; the repo was still called claude-codex-bridge)
$ ccx route --to codex --b 2
  codex:gpt-6-luna:low   p 0.65 · with escalation 0.95

$ ccx run --to codex --mode read "Read README.md and report its first line"
  claude → codex   luna/low · 1 attempt · 5.5 s
  status   done
  summary  "# claude-codex-bridge (`ccx`)"
  tokens   22.8k in · 65 out · $0.0023

$ ccx verify 20261023-150840-aa6c --ok 1
  ✓ recorded — routing learns from it

Work in progress. Runs for real on one Windows machine (macOS and Linux: CI only). On 10 hold-out tasks × 3 rounds, none used while building ccx, a Claude Code (Sonnet) lead handing the coding to Codex through ccx was not seen to be less right than doing it itself (29/30 vs 29/30) and cost about 30 % less per success (about 15 % on the 5 external-repository tasks), but took about 3× as long. Details and limits: Measured · STATUS.

Seven things it does

1 · Each other's lead and sub-agent

Claude Code, Codex or DeepSeek (as dsh, or through Claude Code) leads; any of the three takes work. Gemini CLI has a sub-agent adapter that has not run for real. One adapter per CLI; ccx agents lists what each can do.

2 · Two models talking

ccx ask for the other vendor's second opinion, ccx resume to follow up in the same sub-session, ccx send into a live Codex session. ccx discuss: 2–3 vendors talk a costly decision through (ran for real with two and with three vendors).

3 · Shared memory

A personal layer (your hub) and a project layer (.ccx/); only the other side's new lines arrive at start; ccx handoff passes the baton, ccx fresh starts a fresh conversation.

4 · Splitting the work

Five questions → agent, model, effort and the odds; it says so when doing it yourself is cheaper or the task should be split. ccx batch, ccx q, resumable.

5 · Cheap and fast

Slim sub-agent start-up; ccx lead (--breakdown / --cache / --suggest) shows what the lead re-reads each turn; ccx sum trims big outputs.

6 · No drop in quality

ccx reruns the check (--check); another vendor reviews the diff (--review); every run gets a verdict (--reason), unjudged ones a probable one; ccx trial for a week-long comparison.

7 · You stay in control

Dry run and backups before config changes; ccx undo; --mode read, --worktree; sub-agents can't delegate further; ccx ui shows everything, read-only.

Receipts

Tokens and cost of every run; ccx report builds a dashboard. See a sample (stand-in data).

How it fits together

Claude Code, Codex and Gemini CLI connect to ccx; a lead hands a brief to another, which runs headless and returns JSON; ccx routes, reruns the check, asks another vendor to review, records verdicts and costs; below: the personal layer (hub), the project layer (.ccx) and ccx ui, a local read-only page
  1. ScoreFiles touched, modules crossed, how clear the goal is, risk, new design → difficulty 0–10.
  2. PickThe cheapest rung likely enough to finish; if it isn't worth delegating, it says so.
  3. RunThe other tool works in your folder, headless; ccx reruns the check, another vendor may review.
  4. VerifyYou glance at the diff and ccx verify; routing calibrates on the result.

Measured (2026-10-24)

Real runs on a real machine, the unfavourable results included. Method and limits: measurement report.

QuestionResultHow sure
Does handing small tasks to Codex save the lead anything?It depends on whether the lead trusts ccx's check. sonnet as lead: one request fewer per task (6/6, p = 0.031), total about even; haiku as lead: reruns the tests itself, higher total (median $0.0024 → $0.0056, p = 0.008). Both about 16–18 s slower; 14/14 correct on both sides.Sure for small tasks; small samples
With a real, long-conversation lead?About $0.04 saved and 16 s more waiting per small task (one fewer re-read of about 220k tokens)Extrapolated, not measured
Where does the money go? (7 days, this machine)The lead re-reads a median 352k tokens, $0.11 per request, 99% cache reads; all sub-tasks that week: $0.42A reading
Do Codex's own sub-agents get used?0 of 5 runs on gpt-6-luna low started one, even when askedluna low only
Can the next agent pick up from a handoff alone?3/3 in controlled runs; a real long session failed at first, right after the fixOne real session
Slim start of a Claude sub-agentFixed context per request 46k → 13.6k tokensSingle run
Accounting vs. Codex's weekly quota$2.8–4.4 per 1%, stable across 4 windows4 windows

The live page: ccx ui

Read-only, on 127.0.0.1 only, never calls a model: what waits for your call (red) or review (amber), what each agent is doing, and whether the quota lasts at this pace. Screenshots use demo data (scripts/ui_demo.py).

ccx ui task page in Chinese: a task as an org chart, one column per worker, the side panel showing why a piece needs your call (demo data) ccx ui task page in English, dark theme (demo data)
ccx ui overview in Chinese: what waits for you, the current lead, projects and the quota forecast (demo data)

See the dashboard. A ccx report built from stand-in data: who spent which tokens, quota, cost per success, and the estimated saving.

Open the sample dashboard

Questions

Doesn't a second agent cost more tokens?

It can. In the measurements, a small task saved something only when the lead answered as soon as ccx's check passed; a lead that reran the tests itself paid for the sub-task on top and waited longer. Most of the money goes on the lead re-reading its own conversation, which is what ccx lead, ccx sum and ccx fresh are for.

I'm on a subscription, not the API. Does this apply?

Yes. Costs are shown at API prices so runs can be compared; the dashboard also shows how much of each tool's quota went where. When one tool runs out, the work moves to the other (tested with stand-ins only so far).

Is it safe to let a sub-agent edit files?

Edits stay in the task's folder, every write run is snapshotted for ccx undo, and --mode read or --worktree keep your tree untouched. Details in SECURITY.md.

Which tools work?

Claude Code, Codex and DeepSeek (as dsh, or through Claude Code) can lead or work, tested for real. Gemini CLI is adapted from its docs but hasn't run for real, and only as a sub-agent; Kimi, GLM, Qwen and OpenRouter through Claude Code are configured, not tested.

Why the new name?

The old name, claude-codex-bridge, was nearly the same as another project's (SeemSeam/claude_codex_bridge), and it's no longer just two tools. The command is still ccx; the old address redirects.