Skip to content

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:

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.

ConceptClaude CodeCodexopencode
RulesCLAUDE.md, .claude/rules/AGENTS.mdAGENTS.md
SubagentsSubagents, Agent teams (exp.)Subagentsgeneral / explore / scout + custom
Model selection/model (Anthropic only)/model, --model (OpenAI)Per-agent, multi-provider
Slash commandsBundled + skill-invocableBuilt-in + ~/.codex/prompts/commands/
SkillsSkills (SKILL.md)Skills (SKILL.md)skills/
MCP servers.mcp.json, /mcpconfig.toml, can also be an MCP serverConfigurable
HooksLifecycle hooks in settings.jsonLifecycle scriptsPlugin hooks (JS/TS)
Permissions & sandboxingAllow/ask/deny + managed policySandbox tiers + approval policyPer-tool, per-agent
Plan modeShift-Tab toggleEmergent (untrusted + read-only)plan primary agent
Configurationsettings.json (layered)config.toml + named profilesopencode.json
Headless / CIclaude -pcodex execopencode run
Plugins & marketplacesPlugins + marketplacesJS/TS plugins

Each chapter has the same shape:

  1. What the concept is — tool-agnostic explanation, one or two paragraphs.
  2. How it works — a tabbed block with one tab per tool, showing real paths, syntax, and gotchas.
  3. Comparison — a small table summarising the differences.
  4. Name collisions — where the same word means different things across tools, and how to keep it straight.

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.md is a real shared standard. Codex and opencode read it natively. Claude Code reads CLAUDE.md, but you can import @AGENTS.md for one source of truth across all three tools.