Skip to main content

How to run OpenCode and Claude Code together on the same project?

Summary

  • Run both agents under one orchestrator and give each its own role and git worktree, so one implements while the other reviews instead of both editing one checkout.
  • Omnigent, an open-source meta-harness, lets you mix Claude Code, OpenCode, Codex, Cursor, Hermes, Pi and custom agents in the same session.
  • Its built-in Polly orchestrator includes Claude Code and OpenCode sub-agents, runs each in its own git worktree, and sends every diff to a reviewer from a different vendor.
  • The open-source project lists "Status: alpha"; on Databricks, "Omnigent is in Beta".

How to run OpenCode and Claude Code together on the same project?

Run them under one orchestrator, give each agent a distinct job, and keep their edits in separate git worktrees. Omnigent, an open-source meta-harness, lets you mix Claude Code and OpenCode in the same session: one can implement while the other reviews, or each can take a different slice of the task. Its built-in Polly orchestrator already includes both as sub-agents and leaves the merge to you.

What are OpenCode, Claude Code and Omnigent?

  • OpenCode is "an open source AI coding agent", available as a terminal interface, desktop app or IDE extension.
  • Claude Code is "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools", available in the terminal, IDE, desktop app and browser.
  • Omnigent (Apache 2.0) gives you a common orchestration layer over Claude Code, Codex, Cursor, OpenCode, Hermes, Pi and your own agents.

In Omnigent each agent runs as a harness: Claude Code as claude-sdk (alias claude) or claude-native, and OpenCode as opencode-native (alias opencode), which boots OpenCode's own terminal UI in a pane wrapped with Omnigent's collaboration and policy layer. Omnigent lists Claude Code as fully supported and OpenCode as maintained.

How do you set up both agents?

  1. Install Omnigent with curl -fsSL https://raw.githubusercontent.com/omnigent-ai/omnigent/main/scripts/install_oss.sh | sh. It needs Python 3.12 or newer and Node.js 22 LTS or newer with npm.
  2. Install OpenCode (curl -fsSL https://opencode.ai/install | bash) and Claude Code, and sign in to both. Each agent's CLI must be on your PATH.
  3. Try each one alone with omnigent opencode and omnigent claude.
  4. Run them together through Polly (omni polly) or your own agent file:
name: pair
prompt: Plan the change, delegate the implementation to the coder, then review its diff.
executor:
  harness: claude-sdk
tools:
  coder:
    type: agent
    description: Implement one scoped task.
    executor:
      harness: opencode

Start it with omnigent run pair.yaml. Each sub-agent picks its own executor.harness, so a Claude Code lead can plan and review while OpenCode writes the code.

How do you keep the two agents from colliding?

Give each agent its own workspace and role. Polly runs every sub-agent in its own git worktree, has each implementer open its own pull request, and never merges. The builtin worktree_guard policy blocks file writes outside a worker's worktree. Polly's /fanout skill runs independent tasks in parallel, and /cross-review sends each diff to a different-vendor reviewer.
To hand a conversation to the other agent, clone the session and pick the new agent for the fork; a session's bound agent can't be changed in place.

How do you control what each agent can do?

Policies allow, block or pause each action. Session policies are checked first, then the agent's YAML, then server-wide policies, and all three levels are enforced at once. Policies in an agent's YAML apply to that agent; for a review-only agent, the builtin read_only_os policy denies every file-mutating tool.

Key capabilities to evaluate

Capability Why it matters How Omnigent addresses it
Mixed agents in one session Each agent does what it's best at Claude Code, OpenCode and other agents can run in the same session
Isolated workspaces Two agents in one checkout can overwrite each other Polly gives each sub-agent its own git worktree; worktree_guard blocks writes outside it
Cross-agent review A second agent catches what the author missed /cross-review routes each diff to a reviewer from a different vendor
Per-agent policies You may trust one agent more Policies in an agent's YAML apply to that agent
Spend tracking Every extra agent adds model calls cost_budget per session, subagent_cost_budget per sub-agent
Live visibility You need to see what each agent is doing The Subagents panel opens each CLI worker's terminal to watch or take over

How Databricks approaches multi-agent coordination

Omnigent on Databricks is a Databricks-operated server tied to your workspace identity provider, with model access through the Foundation Model APIs and Unity Gateway and optional Databricks Sandbox hosts (Beta, select AWS regions). Sessions can be shared with workspace users at Read or Edit permission. Built-in policies and custom policies written in Common Expression Language (CEL) are supported; custom Python policies aren't. The Databricks page names Claude Code, Codex, Cursor and Pi, and OpenCode is listed in the open-source README. Agents on a machine you register as the host can use your local files, tools and network.

FAQs

Can more than two agents work on the same project?

Yes. You can mix Claude Code, Codex, Cursor, OpenCode, Hermes, Pi and custom agents in one session, and Polly's roster has seven sub-agents.

Do the agents need version control to share work?

With Polly, yes. Each implementer works in its own git worktree, pushes a task branch and opens a pull request for you to review and merge.

Can teammates watch the two agents work?

Yes. Hit Share in the web UI to grant Read or Edit access, or have a teammate co-attach with omnigent attach <session_id>. Edit lets them drive the agent on your machine, so share it only with people you trust.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.