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 Cursor, Copilot, and Pi were folded in later, since the same concepts apply there (with real gaps, called out honestly where a tool has no equivalent). Each chapter has a comparison table; interactive examples and tool-specific depth vary where a product has no equivalent or the facts need separate verification.

The six tools anchoring the translation table:

Sixteen 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.

Across all five paths, keep one distinction in view: instructions influence model behavior; approvals and hooks gate runtime actions; sandboxes and repository/server-side controls are stronger enforcement boundaries. A tool’s “plan mode” or “auto” label is not itself a security guarantee.

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
Context window management/context, /compact, /clear/status, /compact, /newAuto-compaction on overflow, --continue/summarize, New Chat/compact, chat context controlAuto-compaction + /tree session tree
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/
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, agent/shell/MCP/file/prompt eventsPer-surface hook filesTypeScript extensions (ExtensionAPI)
SubagentsSubagents, Agent teams (exp.)Subagentsgeneral / explore / scout + customAuto-delegation, /name, or mentionCustom agents, spawned via runSubagent- (extension/package, or a second pi process)
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 (3 base modes, more conditionally)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)
Keyboard shortcutskeybindings.jsonTUI keymaptui.jsonVS Code keybindingsVS Code keybindingskeybindings.json
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)Plugins + MCPPi packages (pi install npm:… / git:…)
Trust, security & evaluationThreat model + regression loopSandbox/approval + traceable runsTool policy + external containmentClassifier caveats + sandboxSurface-specific policy + hosted controlsExtension/container boundaries + custom tests

Most concept chapters use the same four landmarks, so you can navigate by shape. The introductory How agents work chapter is intentionally a single shared model rather than a six-tool comparison.

  • 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 widely adopted open convention, not a promise of identical behavior. Codex, OpenCode, Cursor, Copilot, and Pi all read it natively, but discovery, inheritance, precedence, and enforcement remain tool-specific. Claude Code reads CLAUDE.md; you can import @AGENTS.md where that fits your setup.