Overview
These guides compare three AI coding CLIs along concept lines, not tool lines. Pick a concept, see how it works in each tool side by side. Tab selections sync across pages — pick “Claude Code” once and every chapter opens to that tab.
If you’re new to how AI coding agents actually work — the loop, the context window, why sessions are independent — start with How agents work. It’s the shared substrate every chapter below assumes.
The three tools in scope:
- Claude Code — Anthropic
- Codex CLI — OpenAI
- opencode — SST (open source)
The translation table
Section titled “The translation table”Every row links to the chapter for that concept. Cells show the tool’s term for the same idea — or — if it has no equivalent.
| Concept | Claude Code | Codex | opencode |
|---|---|---|---|
| Rules | CLAUDE.md, .claude/rules/ | AGENTS.md | AGENTS.md |
| Subagents | Subagents, Agent teams (exp.) | Subagents | general / explore / scout + custom |
| Model selection | /model (Anthropic only) | /model, --model (OpenAI) | Per-agent, multi-provider |
| Slash commands | Bundled + skill-invocable | Built-in + ~/.codex/prompts/ | commands/ |
| Skills | Skills (SKILL.md) | Skills (SKILL.md) | skills/ |
| MCP servers | .mcp.json, /mcp | config.toml, can also be an MCP server | Configurable |
| Hooks | Lifecycle hooks in settings.json | Lifecycle scripts | Plugin hooks (JS/TS) |
| Permissions & sandboxing | Allow/ask/deny + managed policy | Sandbox tiers + approval policy | Per-tool, per-agent |
| Plan mode | Shift-Tab toggle | Emergent (untrusted + read-only) | plan primary agent |
| Configuration | settings.json (layered) | config.toml + named profiles | opencode.json |
| Headless / CI | claude -p | codex exec | opencode run |
| Plugins & marketplaces | Plugins + marketplaces | — | JS/TS plugins |
How to read these guides
Section titled “How to read these guides”Each chapter has the same shape:
- What the concept is — tool-agnostic explanation, one or two paragraphs.
- How it works — a tabbed block with one tab per tool, showing real paths, syntax, and gotchas.
- Comparison — a small table summarising the differences.
- Name collisions — where the same word means different things across tools, and how to keep it straight.
A note on name collisions
Section titled “A note on name collisions”The same word can mean different things across these tools. The chapters call these out individually, but a few are worth flagging up front:
- “Agents” — opencode has primary agents (
build,plan); Claude Code has Agent teams (independent peer sessions, experimental); all three have subagents. Always qualify which kind. - “Plan mode” — a Claude Code UI toggle, an opencode primary agent, and a Codex sandbox + approval combo. Same posture, three implementations.
- “Hooks” — first-class lifecycle handlers in Claude Code and Codex; in opencode they’re registered from inside JS/TS plugins.
AGENTS.mdis a real shared standard. Codex and opencode read it natively. Claude Code readsCLAUDE.md, but you can import@AGENTS.mdfor one source of truth across all three tools.