Skip to content

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:

Fourteen chapters is a lot of doors. If you already know the problem you’re trying to solve, start from the problem:

Step 1 of 2: pick the kind of problem.
Where’s it going wrong?

Say the problem, get the primitive. Pick the complaint that sounds like yours.

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 CodeCodexOpenCodeCursorCopilotPi
RulesCLAUDE.md, .claude/rules/AGENTS.mdAGENTS.md.cursor/rules/*.mdc or AGENTS.md.github/copilot-instructions.md or AGENTS.mdAGENTS.md / CLAUDE.md + ~/.pi/agent/
SubagentsSubagents, Agent teams (exp.)Subagentsgeneral / explore / scout + customAuto-delegation, /name, or mentionCustom agents, spawned via runSubagent- (extension/package, or a second pi process)
Model selection/model (Anthropic only)/model, --model (OpenAI)Per-agent, multi-providerPer-chat picker, multi-providerPer-chat picker, plan-gated roster/model, 15+ providers via models.json
Slash commandsBundled + skill-invocableBuilt-in + ~/.codex/prompts/ (deprecated → skills)commands/.cursor/commands/.github/prompts/*.prompt.mdBuilt-ins + /skill:name + prompt templates
SkillsSkills (SKILL.md)Skills (SKILL.md).opencode/skills/.cursor/skills/.github/skills/SKILL.md in .pi/skills/ + .agents/skills/
MCP servers.mcp.json, /mcpconfig.toml, can also be an MCP serverConfigurable.cursor/mcp.json.vscode/mcp.json- (no native MCP, by design)
HooksLifecycle hooks in settings.jsonLifecycle scriptsPlugin hooks (JS/TS)hooks.json, 21+ eventsPer-surface hook filesTypeScript extensions (ExtensionAPI)
Permissions & sandboxingAllow/ask/deny + managed policySandbox tiers + approval policyPer-tool, per-agentAuto-run mode + allow/denylistPer-call approval + auto-approveNo prompts (YOLO default); container/extension gates
Plan modeShift-Tab cycle (4 modes)Permission/sandbox posture (untrusted + read-only)plan primary agentFirst-class IDE modeMode dropdown (Plan agent)- (file a plan, or extension/package)
Configurationsettings.json (layered)config.toml + named profilesopencode.jsonVS 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, /newAuto-compaction on overflow, --continue/summarize, New Chat/compact, chat context controlAuto-compaction + /tree session tree
Headless / CIclaude -pcodex execopencode runcursor-agent -pcopilot --promptpi -p, --mode json, RPC, SDK
Plugins & marketplacesPlugins + marketplacesPlugins (skills + apps + MCP + hooks)JS/TS plugins- (VS Code extensions + MCP Marketplace)Extensions + plugins (preview)Pi packages (pi install npm:… / git:…)

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.

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.yml is not a runtime hook - it’s a one-time sandbox-prep GitHub Actions workflow.
  • AGENTS.md is a real shared standard. Codex, OpenCode, Cursor, Copilot, and Pi all read it natively (Pi and Copilot also read CLAUDE.md directly). Claude Code reads CLAUDE.md, but you can import @AGENTS.md for one source of truth across every tool in scope.