OpenAI Codex
OpenAI Codex cheat sheet covering CLI startup, built-in slash commands, session control, permissions, tools, and troubleshooting.
Other AI Sheets
Installation & Setup
Choose the desktop app or CLI, sign in, and start using Codex.
Install ChatGPT for desktop and open Codex for local software work.
Download: https://chatgpt.com/download/
1. Install ChatGPT for macOS or Windows.
2. Open the app and sign in.
3. Select Codex from the top-left menu.
4. Open a local folder or project.
# Continue a CLI session on desktop
/appInstall with the standalone installer, verify the CLI, and sign in.
# Standalone installer: macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Standalone installer: Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
# Verify the installed release
codex --version
# Start Codex and choose Sign in with ChatGPT
codexStart a session and discover commands from the composer.
# Start the interactive terminal UI
codex
# Start with an initial task
codex "Explain this repository structure"
# Inside the composer
/ # Open the slash command popup
/status # Inspect the active session
/model # Change the active model
/permissions # Change approval behaviorEssential Slash Commands
Control sessions, context, files, and code review.
Create, resume, organize, archive, or exit sessions.
/new Start a fresh chat
/clear Clear the terminal and start fresh
/resume Resume a saved chat
/fork Fork the current chat
/rename NAME Rename the current chat
/archive Archive the session and exit
/delete Permanently delete the session
/logout Clear local credentials
/quit Exit the CLI
/exit Exit the CLIManage the context window and inspect session usage.
/compact Summarize the chat to free context
/copy Copy the latest completed response
/raw Toggle raw scrollback mode
/raw on Enable raw scrollback
/raw off Disable raw scrollback
/status Show session configuration and tokens
/usage Open account usage actions
/usage daily Show daily token activity
/usage weekly Show weekly token activity
/usage cumulative Show cumulative token activityAttach project context and inspect code changes.
/mention src/lib/api.ts
/ide Review the selected function
/diff
/reviewModels, Modes & Permissions
Change model behavior, planning state, goals, and access.
Switch models, speed tiers, personality, and memory.
/model Choose model and reasoning effort
/fast Toggle the Fast service tier
/personality Choose a communication style
/memories Configure memory use and generationPlan before editing and track a persistent objective.
/plan
/plan Propose a migration plan for this service
/goal Finish the migration and keep tests green
/goal
/goal edit
/goal pause
/goal resume
/goal clearAdjust approvals and platform sandbox access.
/permissions
/approve
/experimental
# Windows-only commands
/setup-default-sandbox
/sandbox-add-read-dir C:\absolute\directoryTools & Integrations
Use skills, custom commands, apps, plugins, MCP, and hooks.
Invoke reusable workflows from the slash menu.
/skills
$focused-review Review the current change
# Deprecated custom prompt command
/prompts:draftpr FILES="src/app/page.tsx"Browse connected apps and installable capability bundles.
/apps
/pluginsInspect external tools and lifecycle handlers.
/mcp
/mcp verbose
/hooksAgents & Background Work
Switch agent threads and manage long-running terminals.
Inspect delegated work without losing the main conversation.
/agent
/subagents
/side Check whether this plan has an obvious risk
/btw Explain the last commandInspect and stop terminals launched by the active session.
/ps
/stop
/cleanCustomization & Migration
Customize the terminal UI and move work between surfaces.
Customize visible session information and terminal styling.
/statusline
/title
/theme
/pets
/pet
/pets offRemap TUI shortcuts and change composer editing mode.
/keymap
/vimContinue in the app, create project guidance, or import setup.
/app
/init
/importTroubleshooting
Inspect configuration, report problems, and recover context.
Inspect active state, configuration layers, and tool health.
/status
/debug-config
/mcp verbose
/feedbackChoose the least disruptive way to recover a long session.
# Preserve the current chat but free context
/compact
# Start a new chat and keep the terminal view
/new
# Clear the terminal and start a new chat
/clear
# Continue a saved chat
/resume
# Branch the current approach
/fork