Overview
These guides compare 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 translation table below now runs six tools wide. This section started with three terminal CLIs - Claude Code, Codex, and OpenCode - and every chapter still goes deepest on those three; Cursor, Copilot, and Pi have since been folded into the comparison too, since the same concepts apply there (with real gaps, called out honestly where a tool has no equivalent).
The six tools anchoring the translation table:
- Claude Code - Anthropic
- Codex CLI - OpenAI
- OpenCode - SST (open source)
- Cursor - Cursor, IDE + CLI
- Copilot - GitHub, primarily via VS Code
- Pi - Earendil / minimal harness
Find the right primitive
Section titled “Find the right primitive”Fourteen chapters is a lot of doors. If you already know the problem you’re trying to solve, start from the problem:
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 | Cursor | Copilot | Pi |
|---|---|---|---|---|---|---|
| Rules | CLAUDE.md, .claude/rules/ | AGENTS.md | AGENTS.md | .cursor/rules/*.mdc or AGENTS.md | .github/copilot-instructions.md or AGENTS.md | AGENTS.md / CLAUDE.md + ~/.pi/agent/ |
| Subagents | Subagents, Agent teams (exp.) | Subagents | general / explore / scout + custom | Auto-delegation, /name, or mention | Custom agents, spawned via runSubagent | - (extension/package, or a second pi process) |
| Model selection | /model (Anthropic only) | /model, --model (OpenAI) | Per-agent, multi-provider | Per-chat picker, multi-provider | Per-chat picker, plan-gated roster | /model, 15+ providers via models.json |
| Slash commands | Bundled + skill-invocable | Built-in + ~/.codex/prompts/ (deprecated → skills) | commands/ | .cursor/commands/ | .github/prompts/*.prompt.md | Built-ins + /skill:name + prompt templates |
| Skills | Skills (SKILL.md) | Skills (SKILL.md) | .opencode/skills/ | .cursor/skills/ | .github/skills/ | SKILL.md in .pi/skills/ + .agents/skills/ |
| MCP servers | .mcp.json, /mcp | config.toml, can also be an MCP server | Configurable | .cursor/mcp.json | .vscode/mcp.json | - (no native MCP, by design) |
| Hooks | Lifecycle hooks in settings.json | Lifecycle scripts | Plugin hooks (JS/TS) | hooks.json, 21+ events | Per-surface hook files | TypeScript extensions (ExtensionAPI) |
| Permissions & sandboxing | Allow/ask/deny + managed policy | Sandbox tiers + approval policy | Per-tool, per-agent | Auto-run mode + allow/denylist | Per-call approval + auto-approve | No prompts (YOLO default); container/extension gates |
| Plan mode | Shift-Tab cycle (4 modes) | Permission/sandbox posture (untrusted + read-only) | plan primary agent | First-class IDE mode | Mode dropdown (Plan agent) | - (file a plan, or extension/package) |
| Configuration | settings.json (layered) | config.toml + named profiles | opencode.json | VS Code settings.json + .cursor/ | VS Code settings.json + .github/ | ~/.pi/agent/settings.json + .pi/settings.json (deep-merge) |
| Context window management | /context, /compact, /clear | /status, /compact, /new | Auto-compaction on overflow, --continue | /summarize, New Chat | /compact, chat context control | Auto-compaction + /tree session tree |
| Headless / CI | claude -p | codex exec | opencode run | cursor-agent -p | copilot --prompt | pi -p, --mode json, RPC, SDK |
| Plugins & marketplaces | Plugins + marketplaces | Plugins (skills + apps + MCP + hooks) | JS/TS plugins | - (VS Code extensions + MCP Marketplace) | Extensions + plugins (preview) | Pi packages (pi install npm:… / git:…) |
How to read these guides
Section titled “How to read these guides”Four things are in the same place on every chapter, so you can navigate by landmark:
- A scenario up top - the concrete problem the primitive exists to solve, before any definition.
- How it works in each tool - a tabbed block with one tab per tool: real paths, real syntax, the gotchas that bite.
- Comparison - a table summarising where the tools actually diverge.
- Upstream references - a link to each tool’s canonical doc, because these ship fast and this page doesn’t.
Everything between the scenario and the tabs is chosen per concept, not per template. Structural ideas get a diagram; ones that only make sense in sequence get a worked example; ones where the tools diverge on capability get a decision table. If a chapter skips a device, that’s a judgement about the concept, not an omission.
Most chapters also carry an interactive widget near the top - something to poke at rather than read. They’re built to make one decision concrete, not to decorate the page.
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); Copilot has custom agents (.agent.md, both a chat persona and a delegable subagent). Most tools also have in-session subagents - Pi doesn’t, by design. Separately, Cursor Cloud Agents and the Copilot Coding Agent are async remote sandboxes that return a PR, closer to a hand-off than an in-session subagent. Always qualify which kind. - “Plan mode” - a Claude Code Shift-Tab mode cycle, an OpenCode primary agent, a Codex sandbox + approval combo, and a first-class IDE mode with its own picker entry in Cursor and Copilot. Pi has none (you file a plan or reach for an extension). Same posture, many implementations.
- “Hooks” - first-class lifecycle handlers in Claude Code, Codex, and Cursor; in OpenCode they’re registered from inside JS/TS plugins; Pi has no declarative hooks (you write TypeScript extensions instead). Copilot’s
copilot-setup-steps.ymlis not a runtime hook - it’s a one-time sandbox-prep GitHub Actions workflow. AGENTS.mdis a real shared standard. Codex, OpenCode, Cursor, Copilot, and Pi all read it natively (Pi and Copilot also readCLAUDE.mddirectly). Claude Code readsCLAUDE.md, but you can import@AGENTS.mdfor one source of truth across every tool in scope.