Cheat sheet
Coding agents side by side: Claude Code, Codex and Cursor
The same task in Claude Code, Codex CLI and Cursor, in one table per topic: start, commands, instruction files, skill folders, MCP setup and permissions.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
The three coding agents most of our readers use, side by side: each table puts the same task in Claude Code, Codex CLI and Cursor next to each other, which helps when a team uses more than one or is moving between them. Everything here was checked against each tool’s documentation or --help output on 19 November 2026 (Claude Code 2.1, Codex CLI 0.170). These tools release often, so if a command does not behave as described, check --help or the docs for your version.
For every command and flag of one agent, use the per-agent pages instead: the Claude Code commands cheat sheet, the Codex CLI commands cheat sheet and the Claude Code hooks reference.
Install and start
| Claude Code | Codex CLI | Cursor | |
|---|---|---|---|
| Install | curl -fsSL https://claude.ai/install.sh | bash (macOS, Linux, WSL); irm https://claude.ai/install.ps1 | iex (PowerShell); or brew install --cask claude-code |
curl -fsSL https://chatgpt.com/codex/install.sh | sh or npm install -g @openai/codex |
Download the app from cursor.com |
| Start | claude in the project folder |
codex in the project folder |
Open the folder; Cmd/Ctrl+I opens the agent |
| Sign in | Prompted on first run; /login to switch |
codex login (ChatGPT) or codex login --with-api-key |
In the app |
| One-shot, scriptable | claude -p "prompt" |
codex exec "prompt" |
Cursor also ships a CLI; see its docs |
| Continue last session | claude -c |
codex resume --last |
Chat history in the panel |
In-session commands
| Task | Claude Code | Codex CLI |
|---|---|---|
| Create instruction file | /init (writes CLAUDE.md) |
/init (writes AGENTS.md) |
| Plan before editing | Shift+Tab to plan mode, or /plan <task> |
Ask for a plan in the prompt |
| Review changes | /diff, /review |
/review |
| Undo agent changes | /rewind (code and/or conversation) |
Use Git |
| Permissions | /permissions; Shift+Tab cycles modes |
/permissions |
| Switch model | /model |
/model |
| Show settings | /status, /config |
/status |
| Context usage | /context |
/status |
| Free up context | /compact, or /clear for a new conversation |
Start a new session |
| Cost and limits | /usage |
/status, or your ChatGPT or API usage page |
| MCP servers | /mcp |
codex mcp list |
| Skills | /skills; invoke with /skill-name |
/skills; invoke with $skill-name |
In Cursor, Shift+Tab in the agent input rotates between modes (including Plan), checkpoints in the chat timeline restore files, and typing / lists skills and commands.
Instruction files
| Reads | Notes | |
|---|---|---|
| Claude Code | CLAUDE.md or .claude/CLAUDE.md, CLAUDE.local.md (personal, git-ignored), ~/.claude/CLAUDE.md, .claude/rules/*.md |
Reads AGENTS.md when no CLAUDE.md/CLAUDE.local.md exists. @path imports, e.g. @AGENTS.md. Keep each file under about 200 lines. |
| Codex | AGENTS.md in ~/.codex and from repo root down to the working directory |
Concatenated root first. Default combined limit 32 KiB. |
| Cursor | AGENTS.md (root and subfolders), .cursor/rules/*.mdc |
Rule frontmatter: description, globs, alwaysApply. Plain .md files in .cursor/rules are ignored. |
One file for all three: write AGENTS.md, and if you also need a CLAUDE.md, start it with @AGENTS.md.
Agent Skills folders
| Project | Personal | |
|---|---|---|
| Claude Code | .claude/skills/<name>/SKILL.md |
~/.claude/skills/<name>/SKILL.md |
| Codex | .agents/skills/<name>/SKILL.md (from the working directory up to the repo root) |
~/.agents/skills/<name>/SKILL.md |
| Cursor | .cursor/skills/ or .agents/skills/ (also reads .claude/skills/, .codex/skills/) |
~/.cursor/skills/ or ~/.agents/skills/ |
Minimal SKILL.md:
---
name: release-notes
description: Draft release notes from merged pull requests since the last tag. Use when asked to prepare a release or write a changelog.
---
1. Find the last tag with `git describe --tags --abbrev=0`.
2. List merged PRs since then with `gh pr list --state merged --search "merged:>=DATE"`.
3. Group changes into Added, Changed, Fixed. One line each, user-facing language.
The name must match the folder name: lower-case letters, digits and hyphens. Browse ready-made skills with per-agent install commands in the Agent Skills directory.
MCP servers
# Claude Code: local stdio server (everything after -- is the command)
claude mcp add notes -e NOTES_DIR=/abs/path/notes -- npx tsx /abs/path/server.ts
# Claude Code: remote server over HTTP
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# Claude Code: share with the team (writes .mcp.json in the project)
claude mcp add --scope project notes -- node /abs/path/server.js
# Codex: stdio and remote
codex mcp add notes -- npx tsx /abs/path/server.ts
codex mcp add sentry --url https://mcp.sentry.dev/mcp
Cursor reads MCP servers from .cursor/mcp.json in the project (and a global file in your home directory):
{
"mcpServers": {
"notes": { "command": "npx", "args": ["tsx", "/abs/path/server.ts"] }
}
}
Test a server without an agent: npx @modelcontextprotocol/inspector.
Permissions and safety settings
| Safest everyday setting | Hands-off setting (use in isolation only) | |
|---|---|---|
| Claude Code | Default mode (asks for anything beyond reads); pre-approve your test command in /permissions |
--permission-mode bypassPermissions or --dangerously-skip-permissions, only in containers or VMs |
| Codex | --sandbox workspace-write --ask-for-approval on-request |
--dangerously-bypass-approvals-and-sandbox, only in an externally sandboxed environment |
| Cursor | Review terminal commands before they run; commit before large changes | Auto-run for commands, only in a disposable environment |
Claude Code permission modes: default (manual), acceptEdits, plan, auto (background safety checks, where available), dontAsk (deny anything not pre-approved, for CI), bypassPermissions.
Codex sandbox modes: read-only, workspace-write, danger-full-access. Approval policies include on-request and never.
Habits that matter more than any flag
- One task per conversation. Clear or start fresh between tasks.
- Plan first for anything touching more than a couple of files.
- Run the tests yourself before accepting “all tests pass”.
- Review every diff as if a new colleague wrote it.
- Keep secrets out of the working tree, and deny access to the files that must stay there.
More: Claude Code first session, Codex CLI first session, Cursor agent basics.
Next steps
- Look up every command, flag and key for one agent in the Claude Code commands or Codex CLI commands cheat sheet.
- Compare the three agents in depth in Claude Code vs Codex vs Cursor.
- Work in GitHub Copilot’s terminal agent instead? The GitHub Copilot CLI cheat sheet covers its commands, flags and keys.
- Copy server configs from the mcp.json cheat sheet.
- Write the instruction file each agent reads with how to write CLAUDE.md and AGENTS.md.
- Lock down what an agent may run with permissions and sandboxing for coding agents.
Covers
Related
- Your first session with Claude Code
Install it, run it in a real repository, approve its first changes, commit a reviewed edit and learn the commands you will use daily.
- Your first session with the Codex CLI
Install it, choose a sandbox and approval mode, give it a well-scoped task in a repository and review its changes before you accept.
- Cursor agent basics: tasks, rules and skills
Use Cursor's agent on a real task: scope it, plan first, use checkpoints, add project rules, AGENTS.md and skills, and review every change before you keep it.
- Claude Code vs Codex vs Cursor
One task walked through in Claude Code, Codex and Cursor, plus where each runs, how it is priced, its skills and MCP support, and who each one suits.
- Claude Code hooks: run checks around every tool call
Write Claude Code PreToolUse and PostToolUse hooks that block destructive shell commands, format every file Claude edits and log each command for later audit.