Command Reference Cheatsheet
This is the reference you keep open in a second tab. Every command, flag, and symbol across all three tools in one place.
Quick Command Overview
Section titled “Quick Command Overview”@— Reference symbols, files, folders, URLs#— Quick file reference/— Slash commandsCmd/Ctrl+Shift+P— Command palettecursor— CLI command
/— Built-in slash commands@— Reference files in prompts#— Quick CLAUDE.md updateclaude— Start interactive modeclaude -p— One-off query (non-interactive)
/— Slash commandscodex— Start interactive modecodex "prompt"— Start with initial promptcodex --ask-for-approvalor-a— Set trust levelcodex --model— Select model
Cursor Commands
Section titled “Cursor Commands”@ Symbol References
Section titled “@ Symbol References”| Symbol | Description | Example |
|---|---|---|
@files | Reference specific files | @main.js explain this file |
@folders | Include entire directories | @src/components analyze structure |
@code | Reference code blocks | @calculateTotal how does this work? |
@symbols | Reference functions/classes | @UserAuth explain implementation |
@definitions | Go to symbol definitions | @getPriceDefinition show me |
@docs | Reference documentation | @ReactDocs useState hook |
@git | Git history and changes | @git recent commits |
@link | Reference URLs | @link https://api.docs.com |
@linter-errors | Current linting issues | @linter-errors fix all |
@past-chats | Previous conversations | @past-chats auth discussion |
@recent-changes | Recent file modifications | @recent-changes last hour |
@web | Web search results | @web React 19 features |
@cursor-rules | Project rules | @cursor-rules show current |
@codebase | Search entire project | @codebase authentication flow |
Slash Commands
Section titled “Slash Commands”| Command | Description |
|---|---|
/Reset Context | Reset to default state |
/Generate Cursor Rules | Auto-generate project rules from codebase |
/Disable Iterate on Lints | Prevent auto-fixing lint errors |
/Add Open Files to Context | Include all open tabs |
/Add Active Files to Context | Include only visible tabs |
Command Palette (Cmd/Ctrl+Shift+P)
Section titled “Command Palette (Cmd/Ctrl+Shift+P)”| Command | Description |
|---|---|
Cursor Settings | Open Cursor-specific settings |
Cursor: New Rule | Create new project rule |
Cursor: Toggle Privacy Mode | Enable/disable privacy |
Cursor: Export Chat | Save conversation |
Cursor: Import Settings | Import from VS Code |
Cursor: Toggle Max Mode | Enable advanced features |
Cursor: Generate Commit Message | AI commit message |
Cursor: Resolve Conflicts | AI merge conflict resolution |
Cursor CLI
Section titled “Cursor CLI”# Basic usagecursor [options] [paths...] # Open files/folderscursor . # Open current directorycursor file.js # Open specific filecursor folder/ # Open foldercat file.txt | cursor - # Read from stdin
# File operationscursor -d --diff <file1> <file2> # Compare two filescursor -m --merge <p1> <p2> <b> <r> # Three-way mergecursor -g --goto file.js:10:5 # Go to line:columncursor -a --add folder # Add folder to windowcursor --remove folder # Remove folder from window
# Window managementcursor -n --new-window # Force new windowcursor -r --reuse-window # Force reuse windowcursor -w --wait # Wait for files to close
# Agent modes (v2.4+)cursor --plan "describe task" # Plan mode (read-only)cursor --ask "question" # Ask mode (read-only)
# Configurationcursor --locale <locale> # Set locale (e.g., en-US)cursor --user-data-dir <dir> # Custom data directorycursor --profile <name> # Use/create profilecursor --add-mcp <json> # Add MCP server
# Extensionscursor --list-extensions # List installedcursor --install-extension <id> # Installcursor --uninstall-extension <id> # Uninstallcursor --update-extensions # Update all
# Troubleshootingcursor -v --version # Show versioncursor -h --help # Show helpcursor -s --status # Show diagnosticscursor --disable-extensions # Safe modecursor --verbose # Verbose outputClaude Code Commands
Section titled “Claude Code Commands”Built-in Slash Commands
Section titled “Built-in Slash Commands”| Command | Purpose | Example |
|---|---|---|
/add-dir | Add working directories | /add-dir ../backend |
/bug | Report bugs to Anthropic | /bug unexpected behavior with... |
/cd | Move the session to a new working directory without breaking the prompt cache (v2.1.169) | /cd ../backend |
/clear | Clear conversation history | /clear |
/code-review | Review the diff (formerly /simplify); add --fix to apply findings | /code-review high |
/compact | Summarize conversation | /compact focus on auth logic |
/config | View/modify configuration | /config |
/cost | Show token usage stats | /cost |
/doctor | Check installation health | /doctor |
/effort | Set reasoning effort, including ultracode | /effort ultracode |
/help | Get usage help | /help |
/init | Initialize CLAUDE.md | /init |
/login | Switch accounts | /login |
/logout | Sign out | /logout |
/mcp | Manage MCP servers | /mcp |
/memory | Edit CLAUDE.md files | /memory |
/model | Select AI model; /model fable switches to Claude Fable 5 (v2.1.170+) | /model fable |
/permissions | Update permissions | /permissions |
/pr_comments | View PR comments | /pr_comments |
/review | Request code review | /review |
/status | View system status | /status |
/terminal-setup | Configure terminal | /terminal-setup |
/usage | Detailed token metrics | /usage |
/workflows | Watch and manage dynamic workflow runs | /workflows |
/vim | Enter vim mode | /vim |
Claude CLI Flags
Section titled “Claude CLI Flags”# Interactive modeclaude # Start REPLclaude "explain this project" # Start with prompt
# One-off queries (non-interactive)claude -p "explain this function" # Query and exitcat logs.txt | claude -p "analyze" # Process piped content
# Session managementclaude -c # Continue last conversationclaude -c -p "add tests" # Continue non-interactivelyclaude -r # Choose session to resumeclaude -r "abc123" # Resume specific session
# Utilityclaude update # Update to latestclaude mcp # Configure MCP servers| Flag | Description | Example |
|---|---|---|
-p, --print | Non-interactive mode | claude -p "fix this bug" |
-c, --continue | Continue last conversation | claude -c |
-r, --resume | Resume specific session | claude -r "session-id" |
--model | Specify model | claude --model opus |
--dangerously-skip-permissions | Skip all permission prompts | For CI/CD only |
--output-format | Output format (text/json/stream-json) | claude -p "query" --output-format json |
--input-format | Input format (text/stream-json) | claude -p --input-format stream-json |
--verbose | Verbose output | claude --verbose |
--debug | Enable debug mode (includes MCP) | claude --debug |
--safe-mode | Start with all customizations (CLAUDE.md, plugins, skills, hooks, MCP servers) disabled, for troubleshooting (v2.1.169; also via the CLAUDE_CODE_SAFE_MODE env var) | claude --safe-mode |
--add-dir | Add additional directories | claude --add-dir ../shared |
--max-turns | Limit agentic turns | claude -p "task" --max-turns 3 |
--permission-mode | Set permission mode | claude --permission-mode plan |
--session-id | Use specific session ID | claude --session-id "uuid" |
--from-pr | Start with PR context | claude --from-pr 123 |
-v, --version | Show version | claude --version |
-h, --help | Show help | claude --help |
Custom Slash Commands
Section titled “Custom Slash Commands”Create in .claude/commands/ as markdown files:
---allowed-tools: [Edit, Read, Bash]description: Fix GitHub issueargument-hint: issue-number---
Fix GitHub issue #$ARGUMENTS:
1. Fetch details: !gh issue view $ARGUMENTS2. Analyze the problem3. Implement solution4. Add tests5. Create PR with fixFeatures:
$ARGUMENTS— Pass parameters from the slash commandallowed-tools— Restrict which tools the command can useargument-hint— Show hint text for the argument@file.js— Reference files inline!command— Execute bash commands inline
MCP Commands
Section titled “MCP Commands”# Configure MCP serversclaude mcp add <name> -s <scope> -- <command> [args]claude mcp remove <name>claude mcp list
# In-session MCP/mcp # List available MCP tools/mcp__github__create-pr # Use a specific MCP toolCodex Commands
Section titled “Codex Commands”Codex CLI
Section titled “Codex CLI”# Interactive modecodex # Start interactive REPLcodex "explain this project" # Start with initial prompt
# Configurationcodex --model <model> # Specify modelcodex -a <mode> # untrusted | on-failure | on-request | nevercodex --full-auto # = -a on-request + --sandbox workspace-writecodex --dangerously-bypass-approvals-and-sandbox # alias --yolo; no approvals, no sandbox
# Utilitycodex --version # Show versioncodex --help # Show helpCodex CLI Flags
Section titled “Codex CLI Flags”| Flag | Description | Example |
|---|---|---|
--model | Specify model | codex --model gpt-5.5 |
-a, --ask-for-approval | Approval policy | codex -a on-failure |
--full-auto | Low-friction preset: -a on-request + --sandbox workspace-write | codex --full-auto |
--dangerously-bypass-approvals-and-sandbox | Alias --yolo. No approvals, no sandbox — isolated runners only | codex --yolo |
--sandbox | Sandbox mode | codex --sandbox workspace-write |
--version | Show version | codex --version |
--help | Show help | codex --help |
Codex Approval Modes
Section titled “Codex Approval Modes”| Mode | Description | Use When |
|---|---|---|
untrusted | Read-only. Asks before any action. | Exploring, learning, reviewing |
on-failure | Auto-approves writes, asks on failures. | Normal development work |
on-request | Auto-approves unless tool asks for escalation. | Trusted development tasks |
never | Never asks for approval. | Fully trusted automation |
--full-auto | Preset: auto-approves workspace writes but still escalates on request (-a on-request + workspace-write). | Low-friction local work |
--dangerously-bypass-approvals-and-sandbox (--yolo) | Truly approves everything — no approvals, no sandbox. | Hardened/isolated runners only |
Codex Slash Commands
Section titled “Codex Slash Commands”| Command | Description |
|---|---|
/model | Switch model |
/new | Start new conversation |
/compact | Summarize conversation |
Advanced Patterns
Section titled “Advanced Patterns”Cursor: Context Chaining
Section titled “Cursor: Context Chaining”Combine multiple @ references for comprehensive context:
@UserAuth @DatabaseSchema @recent-changesexplain how authentication works with the database@src/api/*.js @tests/*.test.jsensure all API endpoints have corresponding testsClaude Code: Piping and Automation
Section titled “Claude Code: Piping and Automation”# Analyze logstail -f app.log | claude -p "monitor for errors"
# Automated code reviewgit diff | claude -p "review these changes for bugs"
# CI/CD integrationclaude -p "fix linting errors" --dangerously-skip-permissions
# JSON output for scriptsclaude -p "list all TODO comments" --output-format json
# Scheduled tasks0 * * * * claude -p "generate status report" > report.mdCodex: Automation Patterns
Section titled “Codex: Automation Patterns”# GitHub issue automation# (configured through Codex App settings)# Assign issue to @codex to trigger cloud agent
# Local interactivecodex "implement the feature described in issue #42"
# Full auto with sandboxcodex --full-auto "add input validation to all API endpoints"
# Quick reviewcodex "what would break if I remove this function?"Most Used Commands
Section titled “Most Used Commands”Cursor Top 5
Section titled “Cursor Top 5”@codebase— Search entire project@web— Web search for docs/Generate Cursor Rules— Auto-generate rulesCmd/Ctrl+K— Inline editcursor .— Open project
Claude Code Top 5
Section titled “Claude Code Top 5”claude— Start session/clear— Fresh context/compact— Summarize conversationclaude -p "task"— Quick one-off task/cost— Check usage
Codex Top 5
Section titled “Codex Top 5”codex— Start sessioncodex "prompt"— Start with task/model— Switch modelcodex -a on-failure— Set approval policycodex --full-auto— Full auto mode