Skip to content

About

🌈 Make Claude Code, OpenAI Codex, Antigravity (Gemini) and Grok collaborate on one shared project β€” a turn-taking multi-agent relay plus an MCP bridge to drive any AI from inside another.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌈 rAInbow-Code

Make several AI coding CLIs collaborate on one shared project β€” and drive any of them from inside another.

rainbow does two things:

  1. Relay β€” runs two or more headless coding agents (Claude Code, OpenAI Codex, Antigravity/Gemini, Grok) as a turn-taking team in one working directory. Each keeps its own memory across turns (session resume), sees the others' real file edits, and passes a message to the next. They act as peers, an adversarial red-team, or a builder + reviewers.
  2. Bridge (MCP) β€” a rainbow mcp server exposes every installed AI as a tool (ask_codex, ask_grok, ask_agy, ask_claude, rainbow_relay), so from inside Claude Code / Codex / Grok you can consult, delegate to, or launch a collaboration with the others.
you ──▢ Claude ──▢ Codex ──▢ Grok ──▢ Claude ──▢ …   (all editing the same repo)
        (red)      (orange)   (blue)    (red)

  … or, from inside one client:   Claude ──ask_codex──▢ Codex  ──▢ answer

Each agent gets its own rainbow color in the console and the markdown transcript.

Requirements

  • Go β‰₯ 1.24 to build (developed on 1.26).
  • Whichever agent CLIs you want, on your PATH, each already logged in:
kind CLI headless mode used
claude claude claude -p … --output-format json
codex codex codex exec … --json -o
agy agy agy -p … (Antigravity/Gemini)
grok grok grok -p …

You only need the CLIs for the agents you actually use. rainbow checks and tells you if one is missing.

Build & install

Grab a prebuilt binary for your platform from the Releases page (macOS & Linux, arm64/amd64) β€” verify it against SHA256SUMS.txt, chmod +x, and drop it on your PATH. Or build from source:

cd rAInbow-Code
go build -o rainbow .
cp rainbow ~/.local/bin/       # put it on your PATH
rainbow install                # wire the MCP server + skill into your clients

rainbow install registers the MCP server in Claude Code, Codex, and Grok; installs a Claude Code skill + @codex/@grok/@antigravity bridge subagents; and adds collaboration guidance to ~/.codex/AGENTS.md. It's idempotent β€” re-run any time. Undo with claude mcp remove rainbow, codex mcp remove rainbow, grok mcp remove rainbow.

Commands

rainbow [relay] [flags] "goal"    run a multi-agent relay (default)
rainbow ask <kind> "prompt" …     delegate one turn to a single AI
rainbow mcp                       run the MCP stdio server (used by clients)
rainbow install [--scope …]       wire everything into your clients

rainbow relay β€” the collaboration

# Two agents, adversarial mode, current directory:
rainbow --agents claude,codex --mode force "Fix the failing tests in ./api and prove it"

# Three agents, builder + reviewers, a specific project:
rainbow -a claude,codex,grok -m review -C ~/proj "Design and build a rate limiter with tests"

# Safer autonomy, fewer rounds:
rainbow -a codex,agy --safe -n 6 "Refactor utils.py for readability"

# See the exact command without spending a token:
rainbow --dry-run -a claude,codex "…"

Relay flags:

flag meaning default
-a, --agents LIST comma list, in turn order claude,codex
-C, --dir DIR shared working directory .
-m, --mode MODE pair Β· force Β· review pair
-n, --rounds N max total turns 12
--agree N stop after N consecutive sign-offs 2
--auto LEVEL full Β· safe full
--safe alias for --auto safe
--timeout SEC per-turn timeout 900
--model K=M model override per kind (repeatable)
--pass K=TOKEN extra raw CLI flag per kind (repeatable)
--transcript F transcript path <dir>/rainbow-transcript-*.md
--goal-file F read goal from a file
--dry-run / --no-color

Flags support both --flag value and --flag=value; use -- to end flags (so a goal can start with a dash).

Modes: pair = peers who build + push back Β· force = adversarial, hunt bugs and force fixes Β· review = the first agent builds, the rest review hard.

Stops when: --agree consecutive agents emit <<RAINBOW_DONE>>; or --rounds; or Ctrl-C; or a turn errors.

rainbow ask β€” delegate one turn

rainbow ask codex "Review the diff in ./ and list correctness bugs" -C ~/proj
rainbow ask grok  "Implement a LRU cache in cache.go with tests" -C ~/proj
rainbow ask agy   "Explain what auth.go does" --safe

Prints the model's reply to stdout and the resumable session id to stderr. Continue with --session <id> (claude/codex/grok) or --continue (agy).

Use one AI inside another (MCP)

After rainbow install, these tools appear inside Claude Code / Codex / Grok:

tool what it does
ask_claude / ask_codex / ask_agy / ask_grok delegate one turn to that model; returns its answer + a session id to continue
rainbow_relay run a full multi-agent collaboration (goal, agents, mode, rounds, cwd) and get the transcript
list_ais which models are installed

So you can tell Claude Code "ask Codex to review this and cross-check with Grok" and it will call ask_codex + ask_grok (in parallel), then synthesize. The installed rainbow-code skill teaches Claude Code the good patterns (parallel consult, cross-model adversarial review, when to use rainbow_relay), including how to fan out with Workflows. The @codex / @grok / @antigravity subagents let you hand a subtask to a specific model via the Task tool.

Antigravity (agy) has no MCP client, so it bridges by shelling out β€” its guidance (~/.rainbow-code/ANTIGRAVITY.md) tells it to run rainbow ask … / rainbow relay ….

How continuity works

Each agent keeps its own conversation across turns while sharing files on disk:

agent memory carried by reply read from
claude capture session_id β†’ --resume JSON .result
codex capture thread_id β†’ exec resume -o last-message file
grok preset a UUID via --session-id β†’ --resume stdout
agy --continue (most recent for the dir) stdout

Select at most one agy agent per relay β€” it resumes by "most recent session", so two would cross-talk.

Autonomy & safety

--auto full / auto:"full" (default) lets agents edit files and run shell commands without asking (--dangerously-skip-permissions, --dangerously-bypass-approvals-and-sandbox, --always-approve). It's what makes real collaboration work β€” run it in a directory you can git reset. --auto safe keeps edits auto-applied but sandboxes execution.

By default rainbow refuses to run full-autonomy agents directly in your home directory or / β€” those are where scattered files and runaway context (agents ingesting node_modules, caches, and every other project) do the most damage. Point -C at a real project, use --safe, or pass --force to override.

Delegated turns cost tokens on the other provider's account. On timeout/Ctrl-C, each agent's whole process group is killed, so dev servers / test runners it spawned don't leak.

Architecture

runner/      shared engine: headless invocation, session resume, parsers, relay loop
main.go      CLI: relay + ask + dispatch
mcp.go       MCP stdio server (JSON-RPC 2.0, dependency-free)
install.go   `rainbow install` (embeds assets/, wires clients)
assets/      Claude skill, bridge subagents, AGENTS.md guidance (embedded in the binary)

Adding a new agent CLI is a label + a BuildArgs case + (if not plain-stdout) a small parser in runner/. Everything else β€” relay, roles, colors, transcript, MCP tools β€” is agent-agnostic.

License

Copyright Β© 2026 Cycl0o0.

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) β€” see LICENSE. In short: you may use, modify, and redistribute this software, but derivative works β€” including software you offer to others over a network β€” must be released under the same license with source available.

About

🌈 Make Claude Code, OpenAI Codex, Antigravity (Gemini) and Grok collaborate on one shared project β€” a turn-taking multi-agent relay plus an MCP bridge to drive any AI from inside another.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages