Choosing Your Coding Agent
When to use Claude Code, OpenAI Codex, or OpenCode, and how to route different task categories to different agents in CodeMantis.
CodeMantis supports three coding agents as first-class options: Claude Code, OpenAI Codex, and OpenCode. You only need one installed to use the app, but having more than one unlocks per-task routing and lets you split workloads across agents — mixing the vendor-subscription agents (Claude, Codex) with open or local models (OpenCode).
This page is a short decision guide.
The Short Version
Claude Code and Codex are the two subscription-based agents:
| Use Claude Code if... | Use OpenAI Codex if... |
|---|---|
| You already pay for Claude Pro / Max | You already pay for ChatGPT Plus / Pro / Business |
| You want the Mode Selector (Normal, Auto-Accept, Plan) | You prefer the sandbox × approval-policy model |
| You rely on the MCP server ecosystem | You want a different verification sandbox model |
| You want long-form spec reasoning out of the box | You want headroom on a separate vendor pool |
More than one, ideally. When several agents are installed and signed in, CodeMantis grows an Agent Picker in the Project Picker and a per-task routing table in Settings › Agents. You don't have to pick a side — you can split your work.
Where OpenCode Fits
OpenCode is the third first-class agent, wrapped through the Agent Client Protocol (ACP). Unlike Claude Code and Codex, it isn't tied to a single vendor subscription — it runs open models through providers you configure:
- OpenRouter — paste an API key
- A local endpoint like Ollama or LM Studio — no key needed
- The free OpenCode Zen gateway, or any custom OpenAI-compatible URL
Pick OpenCode when you want to run open or local models, keep work off a metered vendor pool, or use a model that Claude and Codex don't offer. Like the others it's chosen per session (marked with an ACP badge in the agent picker) and supports tool approvals, history, SpecWriter, the Assistant panel, and Self-Drive. See Installing OpenCode and the OpenCode feature guide.
How They Differ Inside CodeMantis
The chat panel, activity feed, file viewer, terminals, SpecWriter, Implementation Guide, Self-Drive, MCP management, project templates, preview browser, and Multi-AI Assistants all work the same way regardless of which agent powers your session. Two things change:
- The input toolbar. Claude Code sessions show the Mode Selector (Normal, Auto-Accept, Plan, Auto, Don't Ask, Bypass). Codex sessions show the Codex Policy Pill (sandbox: read-only / workspace-write / danger × approval-policy: untrusted / on-request / on-failure / never). OpenCode sessions show a Mode pill whose Plan option drives OpenCode's native plan mode. Different controls, same goal: control how much autonomy your agent has.
- Authentication. Claude Code uses
claude login(OAuth against your Anthropic account). Codex usescodex login(OAuth against your OpenAI account, credentials in~/.codex/auth.json). OpenCode has no interactive login — it reaches models through the provider keys or local endpoints you configure in Settings › Agents. All are persisted between launches.
Per-Task Routing
Settings › Agents shows a Per-task Defaults table when more than one agent is installed and signed in. Categories:
main_chat— the agent your main project sessions default tospec_writer— the agent SpecWriter hands off to when you click Implementassistant— the agent powering local-CLI assistant tabs in the right panelhelp— the agent powering the in-app Help assistant
Each row is a dropdown listing every installed agent — Claude Code, Codex, and OpenCode — plus "Use primary" to follow whichever agent you've made the default. The setting is persisted as a sparse map (defaultAgentByTask in settings).
A 7-day usage-split card at the bottom of the tab breaks down tokens and estimated cost per agent so you can see where your subscription pool actually goes.
Self-Drive is not a task category. Self-Drive always inherits the agent of the session it attaches to. If
main_chatis routed to Codex, Self-Drive runs on Codex too. This is deliberate — Self-Drive's evidence vocabulary is calibrated per agent and mixing agents inside a single autonomous run would mean reasoning across two grammars.
A Worked Example
A common configuration:
main_chat→ Codex (cheaper subscription headroom for hot iterations on ChatGPT Pro)spec_writer→ Claude Code (strong long-form spec reasoning)assistant→ Use primary (follows your default)help→ Use primary
You write a spec with SpecWriter; it routes to Claude; the spec is excellent. You click Implement and the resulting sessions land back on your main_chat agent, Codex, where you have plenty of headroom for the actual coding work. Self-Drive picks up Codex from the session and runs autonomously. The 7-day usage card shows the split so you can rebalance if either pool drains faster than expected.
Prefer open or local models for some of that work? Route a category to OpenCode and it runs against your configured provider instead of a vendor subscription.
Why CodeMantis Supports Multiple Agents
Short version: CodeMantis is the interface, not the agent. The agent you bring is yours. We built the AgentAdapter abstraction in v1.2.0 so new CLIs are a config away, not a rewrite. v1.3.0 added Codex; v1.5.0 added per-task routing; and OpenCode joined through the Agent Client Protocol (ACP), bringing open and local models into the same interface.
For the long version — including the Anthropic June 15, 2026 licensing change that made vendor optionality non-negotiable — see the blog post: Why CodeMantis Now Supports Two Coding Agents (and Soon More).
Next Steps
- Installing Claude Code — Set up the Anthropic CLI.
- Installing Codex — Set up the OpenAI CLI.
- Installing OpenCode — Set up the ACP adapter for open and local models.
- Per-task agent routing — Full reference for the Settings › Agents tab.
- Session Modes Explained — Claude Code's mode model and Codex's policy model side by side.