close
Skip to content

valpere/chorus

Repository files navigation

Chorus

Cross-agent plugin collection for AI coding CLIs. Delegate tasks between Claude Code, OpenCode, Gemini CLI, Codex, Cursor, and Kilo.

chorus delegation mesh

Overview

Chorus connects six AI coding agents through a full delegation mesh. Every agent can delegate to every other agent (see Known Limitations for OpenCode output capture constraints).

From \ To Claude OpenCode Gemini Codex Cursor Kilo
Claude Code self ✅
OpenCode self
Gemini CLI self
Codex self
Cursor self
Kilo self

Installation

Claude Code

claude plugin install https://github.com/valpere/chorus

Adds slash commands:

  • /opencode:run, /opencode:review
  • /gemini:run, /gemini:review
  • /codex:run, /codex:review
  • /claude:setup, /claude:run, /claude:review (second Claude instance)
  • /cursor:run, /cursor:review, /cursor:setup
  • /kilo:run, /kilo:review, /kilo:setup

Workflow patterns (orchestrate multiple agents at once):

  • /chorus:council — LLM council: five agents, different roles, you synthesize
  • /chorus:review — parallel code review from all five agents
  • /chorus:debug — parallel root-cause hypotheses for a bug symptom
  • /chorus:second-opinion — quick independent check from one agent (--agent cursor|kilo supported)
  • /chorus:vote — YES / NO / ABSTAIN poll from all five agents, tally returned

OpenCode

opencode plugin @valpere/chorus-opencode

Adds MCP tools:

  • delegate_claude(task: string) → string
  • delegate_gemini(task: string) → string
  • delegate_codex(task: string) → string
  • delegate_cursor(task: string) → string
  • delegate_kilo(task: string) → string
  • check_agents() → string — report availability of all five CLIs
  • council(task: string, strict?: boolean) → string — parallel council, all five agents
  • parallel_review(strict?: boolean) → string — parallel review of current git diff
  • parallel_debug(symptom: string, strict?: boolean) → string — parallel root-cause hypotheses
  • second_opinion(approach: string, agent?: 'claude'|'gemini'|'codex'|'cursor'|'kilo') → string — fallback-enabled single-agent opinion
  • vote(proposition: string) → string — YES/NO/ABSTAIN tally from all five agents

Gemini CLI

# Delegation skills
gemini skills install https://github.com/valpere/chorus --path for-gemini/claude
gemini skills install https://github.com/valpere/chorus --path for-gemini/opencode
gemini skills install https://github.com/valpere/chorus --path for-gemini/codex
gemini skills install https://github.com/valpere/chorus --path for-gemini/cursor
gemini skills install https://github.com/valpere/chorus --path for-gemini/kilo

# Workflow pattern skills
gemini skills install https://github.com/valpere/chorus --path for-gemini/council
gemini skills install https://github.com/valpere/chorus --path for-gemini/parallel-review
gemini skills install https://github.com/valpere/chorus --path for-gemini/parallel-debug
gemini skills install https://github.com/valpere/chorus --path for-gemini/second-opinion
gemini skills install https://github.com/valpere/chorus --path for-gemini/vote

Adds skills:

  • chorus-claude - Delegate to Claude Code
  • chorus-opencode - Delegate to OpenCode
  • chorus-codex - Delegate to Codex
  • chorus-cursor - Delegate to Cursor Agent CLI
  • chorus-kilo - Delegate to Kilo Code CLI
  • chorus-council - LLM council with all five agents
  • chorus-parallel-review - Parallel code review
  • chorus-parallel-debug - Parallel root-cause hypotheses
  • chorus-second-opinion - Quick independent second opinion
  • chorus-vote - YES/NO/ABSTAIN parallel vote

Codex

git clone https://github.com/valpere/chorus /tmp/chorus

# Delegation skills
mkdir -p ~/.codex/skills/chorus-claude ~/.codex/skills/chorus-opencode \
         ~/.codex/skills/chorus-gemini ~/.codex/skills/chorus-cursor ~/.codex/skills/chorus-kilo
cp /tmp/chorus/for-codex/claude/SKILL.md ~/.codex/skills/chorus-claude/
cp /tmp/chorus/for-codex/opencode/SKILL.md ~/.codex/skills/chorus-opencode/
cp /tmp/chorus/for-codex/gemini/SKILL.md ~/.codex/skills/chorus-gemini/
cp /tmp/chorus/for-codex/cursor/SKILL.md ~/.codex/skills/chorus-cursor/
cp /tmp/chorus/for-codex/kilo/SKILL.md ~/.codex/skills/chorus-kilo/

# Workflow pattern skills
mkdir -p ~/.codex/skills/chorus-council ~/.codex/skills/chorus-parallel-review \
         ~/.codex/skills/chorus-parallel-debug ~/.codex/skills/chorus-second-opinion \
         ~/.codex/skills/chorus-vote
cp /tmp/chorus/for-codex/council/SKILL.md ~/.codex/skills/chorus-council/
cp /tmp/chorus/for-codex/parallel-review/SKILL.md ~/.codex/skills/chorus-parallel-review/
cp /tmp/chorus/for-codex/parallel-debug/SKILL.md ~/.codex/skills/chorus-parallel-debug/
cp /tmp/chorus/for-codex/second-opinion/SKILL.md ~/.codex/skills/chorus-second-opinion/
cp /tmp/chorus/for-codex/vote/SKILL.md ~/.codex/skills/chorus-vote/

Adds skills:

  • chorus-claude - Delegate to Claude Code
  • chorus-opencode - Delegate to OpenCode
  • chorus-gemini - Delegate to Gemini CLI
  • chorus-cursor - Delegate to Cursor Agent CLI
  • chorus-kilo - Delegate to Kilo Code CLI
  • chorus-council - LLM council with all five agents
  • chorus-parallel-review - Parallel code review
  • chorus-parallel-debug - Parallel root-cause hypotheses
  • chorus-second-opinion - Quick independent second opinion
  • chorus-vote - YES/NO/ABSTAIN parallel vote

Cursor

git clone https://github.com/valpere/chorus /tmp/chorus

mkdir -p .cursor/rules

# Delegation rules
cp /tmp/chorus/for-cursor/claude/RULE.mdc .cursor/rules/chorus-claude.mdc
cp /tmp/chorus/for-cursor/opencode/RULE.mdc .cursor/rules/chorus-opencode.mdc
cp /tmp/chorus/for-cursor/gemini/RULE.mdc .cursor/rules/chorus-gemini.mdc
cp /tmp/chorus/for-cursor/codex/RULE.mdc .cursor/rules/chorus-codex.mdc
cp /tmp/chorus/for-cursor/kilo/RULE.mdc .cursor/rules/chorus-kilo.mdc

# Workflow pattern rules
cp /tmp/chorus/for-cursor/council/RULE.mdc .cursor/rules/chorus-council.mdc
cp /tmp/chorus/for-cursor/parallel-review/RULE.mdc .cursor/rules/chorus-parallel-review.mdc
cp /tmp/chorus/for-cursor/parallel-debug/RULE.mdc .cursor/rules/chorus-parallel-debug.mdc
cp /tmp/chorus/for-cursor/second-opinion/RULE.mdc .cursor/rules/chorus-second-opinion.mdc
cp /tmp/chorus/for-cursor/vote/RULE.mdc .cursor/rules/chorus-vote.mdc

Adds rules (activate via natural language in Cursor):

  • chorus-claude - Delegate to Claude Code
  • chorus-opencode - Delegate to OpenCode
  • chorus-gemini - Delegate to Gemini CLI
  • chorus-codex - Delegate to Codex
  • chorus-kilo - Delegate to Kilo Code CLI
  • chorus-council - LLM council with all five agents
  • chorus-parallel-review - Parallel code review
  • chorus-parallel-debug - Parallel root-cause hypotheses
  • chorus-second-opinion - Quick independent second opinion
  • chorus-vote - YES/NO/ABSTAIN parallel vote

Kilo

git clone https://github.com/valpere/chorus /tmp/chorus

# Delegation skills
mkdir -p ~/.kilo/skills/chorus-claude ~/.kilo/skills/chorus-opencode \
         ~/.kilo/skills/chorus-gemini ~/.kilo/skills/chorus-codex ~/.kilo/skills/chorus-cursor
cp /tmp/chorus/for-kilo/claude/SKILL.md ~/.kilo/skills/chorus-claude/
cp /tmp/chorus/for-kilo/opencode/SKILL.md ~/.kilo/skills/chorus-opencode/
cp /tmp/chorus/for-kilo/gemini/SKILL.md ~/.kilo/skills/chorus-gemini/
cp /tmp/chorus/for-kilo/codex/SKILL.md ~/.kilo/skills/chorus-codex/
cp /tmp/chorus/for-kilo/cursor/SKILL.md ~/.kilo/skills/chorus-cursor/

# Workflow pattern skills
mkdir -p ~/.kilo/skills/chorus-council ~/.kilo/skills/chorus-parallel-review \
         ~/.kilo/skills/chorus-parallel-debug ~/.kilo/skills/chorus-second-opinion \
         ~/.kilo/skills/chorus-vote
cp /tmp/chorus/for-kilo/council/SKILL.md ~/.kilo/skills/chorus-council/
cp /tmp/chorus/for-kilo/parallel-review/SKILL.md ~/.kilo/skills/chorus-parallel-review/
cp /tmp/chorus/for-kilo/parallel-debug/SKILL.md ~/.kilo/skills/chorus-parallel-debug/
cp /tmp/chorus/for-kilo/second-opinion/SKILL.md ~/.kilo/skills/chorus-second-opinion/
cp /tmp/chorus/for-kilo/vote/SKILL.md ~/.kilo/skills/chorus-vote/

Adds skills:

  • chorus-claude - Delegate to Claude Code
  • chorus-opencode - Delegate to OpenCode
  • chorus-gemini - Delegate to Gemini CLI
  • chorus-codex - Delegate to Codex
  • chorus-cursor - Delegate to Cursor Agent CLI
  • chorus-council - LLM council with all five agents
  • chorus-parallel-review - Parallel code review
  • chorus-parallel-debug - Parallel root-cause hypotheses
  • chorus-second-opinion - Quick independent second opinion
  • chorus-vote - YES/NO/ABSTAIN parallel vote

Usage Examples

Claude Code

# Run a task in the foreground
/opencode:run --wait "What's the purpose of this codebase?"

# Run a task in the background
/gemini:run --background "Summarize the architecture in 3 sentences."

# Get code reviews from all agents
/codex:review --wait
/opencode:review --wait
/gemini:review --wait
/claude:review --wait

# Get a security-focused review
/claude:run --wait "List potential security issues in this code."

OpenCode

Once the plugin is installed, OpenCode will automatically discover the MCP tools. Use natural language:

"Ask Claude to review this function for edge cases"
"Get Gemini's opinion on this architecture"
"Delegate this refactoring task to Codex"

Gemini CLI

Once skills are installed, Gemini will activate them based on context:

gemini --prompt "Get a second opinion from Claude on my current approach"

Codex

Once skills are installed, Codex will activate them when you mention delegating:

codex "Ask Gemini to analyze this file for performance issues"

Cursor

Once rules are installed in .cursor/rules/, Cursor will activate them based on context:

# In a Cursor Agent session:
"Get a second opinion from Claude on this approach"
"Run a parallel review with all agents"
"Ask Kilo if this naming is clear enough"

Kilo

Once skills are installed, Kilo will activate them when you mention delegating:

kilo run --auto "Ask Gemini to review this for edge cases"
kilo run --auto "Run a council on whether to use Redis or Postgres for this queue"

Workflow Patterns

Chorus ships five workflow pattern commands. The multi-agent workflows (/chorus:council, /chorus:review, /chorus:debug, /chorus:vote) orchestrate multiple agents in parallel; /chorus:second-opinion runs with a single agent and falls back automatically if the requested agent is unavailable. Install the chorus plugin once to access all five.

Graceful degradation: All workflows check agent availability at runtime. Missing agents are reported in the output with install instructions. For council, review, and debug, the command proceeds with the available subset — a minimum of 2 agents is required. /chorus:second-opinion requires only 1 available agent.

LLM Council

Five agents tackle the same task with different roles; the host synthesizes as chairman.

/chorus:council "Should we use optimistic locking or a distributed lock for this feature?"
/chorus:council --background "Review the architecture of the new auth service"

Parallel Review

All five agents review the current git diff HEAD simultaneously, each with a different focus (correctness, edge cases, scope, integration, maintainability).

/chorus:review --wait
/chorus:review --background

Parallel Debug

All five agents propose root-cause hypotheses for a symptom; the host synthesizes an investigation plan.

/chorus:debug "Checkout fails intermittently with a 500 — only in production, never in staging"

Second Opinion

Quick independent check from one agent. Default: Gemini. Override with --agent.

/chorus:second-opinion "Use a ULID instead of UUID for the new events table primary key"
/chorus:second-opinion --agent claude "Cache the auth token in localStorage vs sessionStorage"
/chorus:second-opinion --agent codex "Extract this 30-line block into a shared utility"
/chorus:second-opinion --agent cursor "Does this change fit the existing patterns in this repo?"
/chorus:second-opinion --agent kilo "Is this function name clear enough for future maintainers?"

Parallel Vote

YES / NO / ABSTAIN poll from all five agents. Use when you want a decision signal rather than discussion.

/chorus:vote "Adopt TypeScript for new files in this repo?"
/chorus:vote "Add Redis as a dependency for session caching?"
/chorus:vote --json "Use optimistic locking for this resource?"

The output is a tally table plus one-sentence rationale per agent. Use /chorus:council when you want reasoning and trade-offs; use /chorus:vote when you want a thumbs-up/thumbs-down count.

Using chorus in Claude Code Plan mode

Claude Code's Plan mode is a good entry point for chorus workflows. When you enter Plan mode before a complex feature, call /chorus:council to get multi-agent input before committing to an approach, or /chorus:second-opinion for a quick sanity check on a specific decision.

# During architecture planning — get five perspectives before writing code
/chorus:council "We need to add distributed rate limiting. Redis vs in-memory vs a dedicated proxy?"

# Quick check on a specific design choice
/chorus:second-opinion --agent codex "Is a factory function better than a class here?"

The council output feeds directly into your plan: consensus points become confirmed requirements, disagreements surface trade-offs worth deciding before implementation starts. Use /chorus:vote for quick yes/no decisions ("should we add Redis?", "adopt TypeScript?") where a tally is more useful than a discussion.


Execution Modes

All run and review commands support two execution modes:

  • --wait (or no flag with user confirmation) - Run in foreground and return results immediately
  • --background - Run as a background task and notify when complete

The five chorus workflow commands (council, review, debug, second-opinion, vote) also support:

  • --json - Emit structured JSON on stdout instead of delimited text. Warnings about unavailable agents still go to stderr. Useful for scripting or programmatic consumption of agent output.
    • council / review / debug / second-opinion: {"command":"<cmd>","results":[{"name":"...","output":"...","error":"...","exitCode":0}]}
    • vote: {"command":"vote","tally":{"yes":N,"no":N,"abstain":N,"invalid":N},"results":[{"name":"...","vote":"YES|NO|ABSTAIN|INVALID","rationale":"...","output":"...","error":"...","exitCode":0}]}

Requirements

  • Node.js >= 18.18.0
  • Claude Code (for delegation from OpenCode/Gemini/Codex)
  • OpenCode (for delegation to/from OpenCode)
  • Gemini CLI (for delegation to/from Gemini)
  • Codex (for delegation to/from Codex)
  • Cursor Agent CLI (agent binary, optional — for Cursor delegation)
  • Kilo Code CLI (kilo binary, optional — for Kilo delegation)

Not all agents need to be installed. /chorus:second-opinion works with at least 1 available agent; the other multi-agent workflows (council, review, debug) require at least 2.

Project Structure

chorus/
├── .claude-plugin/
│   └── marketplace.json       # Claude Code plugin marketplace
├── plugins/                   # Claude Code plugins
│   ├── claude/                # Claude Code self-delegation
│   ├── opencode/              # OpenCode plugin
│   ├── gemini/                # Gemini CLI plugin
│   ├── codex/                 # Codex plugin
│   ├── cursor/                # Cursor Agent CLI plugin
│   ├── kilo/                  # Kilo Code CLI plugin
│   └── chorus/                # Workflow patterns (council, review, debug, second-opinion, vote)
├── for-gemini/                # Gemini CLI skills
│   ├── claude/SKILL.md
│   ├── opencode/SKILL.md
│   ├── codex/SKILL.md
│   ├── cursor/SKILL.md
│   ├── kilo/SKILL.md
│   ├── council/SKILL.md
│   ├── parallel-review/SKILL.md
│   ├── parallel-debug/SKILL.md
│   ├── second-opinion/SKILL.md
│   └── vote/SKILL.md
├── for-codex/                 # Codex skills
│   ├── claude/SKILL.md
│   ├── opencode/SKILL.md
│   ├── gemini/SKILL.md
│   ├── cursor/SKILL.md
│   ├── kilo/SKILL.md
│   ├── council/SKILL.md
│   ├── parallel-review/SKILL.md
│   ├── parallel-debug/SKILL.md
│   ├── second-opinion/SKILL.md
│   └── vote/SKILL.md
├── for-cursor/                # Cursor Agent CLI rules
│   ├── claude/RULE.mdc
│   ├── opencode/RULE.mdc
│   ├── gemini/RULE.mdc
│   ├── codex/RULE.mdc
│   ├── kilo/RULE.mdc
│   ├── council/RULE.mdc
│   ├── parallel-review/RULE.mdc
│   ├── parallel-debug/RULE.mdc
│   ├── second-opinion/RULE.mdc
│   └── vote/RULE.mdc
├── for-kilo/                  # Kilo Code CLI skills
│   ├── claude/SKILL.md
│   ├── opencode/SKILL.md
│   ├── gemini/SKILL.md
│   ├── codex/SKILL.md
│   ├── cursor/SKILL.md
│   ├── council/SKILL.md
│   ├── parallel-review/SKILL.md
│   ├── parallel-debug/SKILL.md
│   ├── second-opinion/SKILL.md
│   └── vote/SKILL.md
├── for-opencode/              # OpenCode MCP package
│   ├── package.json
│   └── src/
│       └── index.js
├── package.json
└── README.md

Known Limitations

Codex sandbox restricts file access

Codex runs inside a bubblewrap sandbox that limits filesystem access to the current working directory. When you delegate a task to Codex from another agent, Codex can only read files within the directory where it was launched — not arbitrary paths on the system.

Practical impact: If you invoke /codex:run or chorus-codex from a project outside Codex's working directory (e.g. running Claude Code in ~/wrk/projectA but Codex is launched in ~/wrk/common), Codex will produce metadata-only output (file sizes, directory structure) instead of content-based analysis.

Workaround: Run Codex from the same project root as the other agents, or use codex --no-sandbox if your environment supports it.

OpenCode stdout is not capturable

opencode run is a TUI application — it writes ANSI output to the terminal but does not expose stdout for programmatic capture. Chorus uses claude --print as a proxy when a third council voice is needed from within Claude Code.

Practical impact: The delegate_claude MCP tool in the OpenCode plugin works correctly. The reverse path (using OpenCode as a council member from Claude Code) requires the TUI to be visible.


License

MIT

About

Cross-agent plugin collection for AI coding CLIs. Delegate tasks and run workflow patterns (council, parallel review, debug) across Claude Code, OpenCode, Gemini CLI, and Codex.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors