Skip to content

Command Reference Cheatsheet

Command reference for Cursor, Claude Code, and Codex collects the CLI flags, slash commands, and context symbols of all three tools in one page. Cursor uses @ references and a command palette, Claude Code exposes built-in slash commands plus claude CLI flags, and Codex combines slash commands with approval and sandbox flags.

This is the reference you keep open in a second tab. Every command, flag, and symbol across all three tools in one place.

  • @ — Reference symbols, files, folders, URLs
  • # — Quick file reference
  • / — Slash commands
  • Cmd/Ctrl+Shift+P — Command palette
  • cursor — CLI command
SymbolDescriptionExample
@filesReference specific files@main.js explain this file
@foldersInclude entire directories@src/components analyze structure
@codeReference code blocks@calculateTotal how does this work?
@symbolsReference functions/classes@UserAuth explain implementation
@definitionsGo to symbol definitions@getPriceDefinition show me
@docsReference documentation@ReactDocs useState hook
@gitGit history and changes@git recent commits
@linkReference URLs@link https://api.docs.com
@linter-errorsCurrent linting issues@linter-errors fix all
@past-chatsPrevious conversations@past-chats auth discussion
@recent-changesRecent file modifications@recent-changes last hour
@webWeb search results@web React 19 features
@cursor-rulesProject rules@cursor-rules show current
@codebaseSearch entire project@codebase authentication flow
CommandDescription
/Reset ContextReset to default state
/Generate Cursor RulesAuto-generate project rules from codebase
/Disable Iterate on LintsPrevent auto-fixing lint errors
/Add Open Files to ContextInclude all open tabs
/Add Active Files to ContextInclude only visible tabs
/loopBundled skill (Cursor 3.5+): re-run a prompt on a local schedule until an outcome is reached or you stop it. Omit the interval and the agent picks when to wake
CommandDescription
Cursor SettingsOpen Cursor-specific settings
Cursor: New RuleCreate new project rule
Cursor: Toggle Privacy ModeEnable/disable privacy
Cursor: Export ChatSave conversation
Cursor: Import SettingsImport from VS Code
Cursor: Toggle Max ModeEnable advanced features
Cursor: Generate Commit MessageAI commit message
Cursor: Resolve ConflictsAI merge conflict resolution
Terminal window
# Basic usage
cursor [options] [paths...] # Open files/folders
cursor . # Open current directory
cursor file.js # Open specific file
cursor folder/ # Open folder
cat file.txt | cursor - # Read from stdin
# File operations
cursor -d --diff <file1> <file2> # Compare two files
cursor -m --merge <p1> <p2> <b> <r> # Three-way merge
cursor -g --goto file.js:10:5 # Go to line:column
cursor -a --add folder # Add folder to window
cursor --remove folder # Remove folder from window
# Window management
cursor -n --new-window # Force new window
cursor -r --reuse-window # Force reuse window
cursor -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)
# Configuration
cursor --locale <locale> # Set locale (e.g., en-US)
cursor --user-data-dir <dir> # Custom data directory
cursor --profile <name> # Use/create profile
cursor --add-mcp <json> # Add MCP server
# Extensions
cursor --list-extensions # List installed
cursor --install-extension <id> # Install
cursor --uninstall-extension <id> # Uninstall
cursor --update-extensions # Update all
# Troubleshooting
cursor -v --version # Show version
cursor -h --help # Show help
cursor -s --status # Show diagnostics
cursor --disable-extensions # Safe mode
cursor --verbose # Verbose output
CommandPurposeExample
/add-dirAdd working directories/add-dir ../backend
/bugReport bugs to Anthropic/bug unexpected behavior with...
/cdMove the session to a new working directory without breaking the prompt cache (v2.1.169)/cd ../backend
/clearClear conversation history/clear
/code-reviewRun the dedicated code-review workflow; add --fix when supported to apply findings/code-review high
/compactSummarize conversation/compact focus on auth logic
/configView/modify configuration/config
/costShow token usage stats/cost
/doctorCheck installation health/doctor
/effortSet reasoning effort for the selected model/effort high
/goalSet a completion condition and keep working across turns until an evaluator confirms it (v2.1.139+); /goal clear ends it early/goal all tests in tests/auth pass
/helpGet usage help/help
/initInitialize CLAUDE.md/init
/loginSwitch accounts/login
/logoutSign out/logout
/loopBundled skill: re-run a prompt on an interval, at a self-paced delay, or as a maintenance routine. Alias /proactive/loop 5m check the deploy
/mcpManage MCP servers/mcp
/memoryEdit CLAUDE.md files/memory
/modelSelect AI model; /model fable switches to Claude Fable 5 (v2.1.170+)/model fable
/permissionsUpdate permissions/permissions
/reviewRequest code review/review
/simplifyReview changed code for reuse, quality, and efficiency; distinct from /code-review/simplify
/statusView system status/status
/terminal-setupConfigure terminal/terminal-setup
/usageDetailed token metrics/usage
/workflowsWatch and manage dynamic workflow runs/workflows
Terminal window
# Interactive mode
claude # Start REPL
claude "explain this project" # Start with prompt
# One-off queries (non-interactive)
claude -p "explain this function" # Query and exit
cat logs.txt | claude -p "analyze" # Process piped content
# Session management
claude -c # Continue last conversation
claude -c -p "add tests" # Continue non-interactively
claude -r # Choose session to resume
claude -r "abc123" # Resume specific session
# Utility
claude update # Update to latest
claude mcp # Configure MCP servers
FlagDescriptionExample
-p, --printNon-interactive modeclaude -p "fix this bug"
-c, --continueContinue last conversationclaude -c
-r, --resumeResume specific sessionclaude -r "session-id"
--modelSpecify modelclaude --model opus
--dangerously-skip-permissionsSkip all permission promptsFor CI/CD only
--output-formatOutput format (text/json/stream-json)claude -p "query" --output-format json
--input-formatInput format (text/stream-json)claude -p --input-format stream-json
--verboseVerbose outputclaude --verbose
--debugEnable debug mode (includes MCP)claude --debug
--safe-modeStart 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-dirAdd additional directoriesclaude --add-dir ../shared
--max-turnsLimit agentic turnsclaude -p "task" --max-turns 3
--permission-modeSet permission modeclaude --permission-mode plan
--session-idUse specific session IDclaude --session-id "uuid"
--from-prStart with PR contextclaude --from-pr 123
-v, --versionShow versionclaude --version
-h, --helpShow helpclaude --help

Create in .claude/commands/ as markdown files:

---
allowed-tools: [Edit, Read, Bash]
description: Fix GitHub issue
argument-hint: issue-number
---
Fix GitHub issue #$ARGUMENTS:
1. Fetch details: !gh issue view $ARGUMENTS
2. Analyze the problem
3. Implement solution
4. Add tests
5. Create PR with fix

Features:

  • $ARGUMENTS — Pass parameters from the slash command
  • allowed-tools — Restrict which tools the command can use
  • argument-hint — Show hint text for the argument
  • @file.js — Reference files inline
  • !command — Execute bash commands inline
Terminal window
# Configure MCP servers
claude 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 tool
Terminal window
# Interactive mode
codex # Start interactive REPL
codex "explain this project" # Start with initial prompt
# Configuration
codex --model <model> # Specify model
codex -a <mode> # untrusted | on-request | never
codex --full-auto # Deprecated compatibility shortcut
codex --dangerously-bypass-approvals-and-sandbox # alias --yolo; no approvals, no sandbox
# Utility
codex --version # Show version
codex --help # Show help
FlagDescriptionExample
--modelSpecify modelcodex --model gpt-5.6-sol
-a, --ask-for-approvalApproval policy; sandbox is configured separatelycodex -a on-request
--full-autoDeprecated compatibility shortcut; configure approval and sandbox explicitlycodex -a on-request --sandbox workspace-write
--dangerously-bypass-approvals-and-sandboxAlias --yolo. No approvals, no sandbox — isolated runners onlycodex --yolo
--sandboxSandbox modecodex --sandbox workspace-write
--versionShow versioncodex --version
--helpShow helpcodex --help
ModeDescriptionUse When
untrustedPrompts for commands outside the trusted set; sandbox remains separate.Cautious exploration
on-requestLets the agent request an elevated action when needed.Interactive development
neverNever prompts; disallowed sandbox operations fail.Trusted unattended jobs in a deliberately chosen sandbox
--full-autoDeprecated compatibility shortcut.Migrate to explicit approval + sandbox settings
--dangerously-bypass-approvals-and-sandbox (--yolo)Truly approves everything — no approvals, no sandbox.Hardened/isolated runners only
CommandDescription
/modelSwitch model
/newStart new conversation
/compactSummarize conversation
/goalSet a persistent objective Codex works toward across turns and sessions. Stable and enabled by default since CLI 0.133.0
/goal edit / pause / resume / clearRevise, suspend, continue, or drop the active goal (edit added in 0.131.0)

Combine multiple @ references for comprehensive context:

@UserAuth @DatabaseSchema @recent-changes
explain how authentication works with the database
@src/api/*.js @tests/*.test.js
ensure all API endpoints have corresponding tests
Terminal window
# Analyze logs
tail -f app.log | claude -p "monitor for errors"
# Automated code review
git diff | claude -p "review these changes for bugs"
# CI/CD integration
claude -p "fix linting errors" --dangerously-skip-permissions
# JSON output for scripts
claude -p "list all TODO comments" --output-format json
# Scheduled tasks
0 * * * * claude -p "generate status report" > report.md
Terminal window
# GitHub issue automation
# (configured through ChatGPT/Codex integrations)
# Assign issue to @codex to trigger cloud agent
# Local interactive
codex "implement the feature described in issue #42"
# Trusted unattended job with explicit controls
codex -a never --sandbox workspace-write "add input validation to all API endpoints"
# Quick review
codex "what would break if I remove this function?"
  1. @codebase — Search entire project
  2. @web — Web search for docs
  3. /Generate Cursor Rules — Auto-generate rules
  4. Cmd/Ctrl+K — Inline edit
  5. cursor . — Open project
  1. claude — Start session
  2. /clear — Fresh context
  3. /compact — Summarize conversation
  4. claude -p "task" — Quick one-off task
  5. /cost — Check usage
  1. codex — Start session
  2. codex "prompt" — Start with task
  3. /model — Switch model
  4. codex -a on-request — Interactive approval policy
  5. codex --sandbox workspace-write — Set sandbox separately

Frequently asked questions

How do you start Claude Code and Codex from the command line?

claude starts interactive mode and claude -p runs a one-off, non-interactive query. codex starts an interactive REPL, and codex "prompt" starts with an initial prompt. Both accept --model to select the model.

Which Cursor context references get used most?

@codebase searches the entire project and @web returns web search results — the top two of the Cursor list. @files, @folders, @symbols, and @git scope context to specific files, directories, functions, or Git history.

Which Codex approval mode should be used?

untrusted prompts for commands outside the trusted set, on-request lets the agent request an elevated action, and never never prompts while disallowed sandbox operations fail. --full-auto is a deprecated compatibility shortcut, and --dangerously-bypass-approvals-and-sandbox (--yolo) is for hardened, isolated runners only.

How are custom slash commands created in Claude Code?

Custom commands are markdown files in .claude/commands/. $ARGUMENTS passes parameters from the slash command, allowed-tools restricts which tools it can use, argument-hint shows hint text for the argument, @file.js references files inline, and !command executes bash commands inline.

What replaced the Claude Code thinking-budget ladder?

The think / think harder / ultrathink budget ladder is gone. think, think hard, and think more are ordinary text, while ultrathink is a one-turn hint that adds a deeper-reasoning instruction without changing API effort. Durable depth is controlled with the thinking toggle and /effort.