OpenAI Codex CLI Commands & Prompt Reference
Slash commands for the terminal interface of OpenAI Codex CLI 0.162.1, checked on 2026-10-10 against OpenAI's CLI slash-command reference and the rust-v0.162.1 source. Left out: the codex shell subcommands, newer commands the reference does not describe yet, and /cloud, /local and /reasoning, which appear in neither source. Type / to open the popup, or press Tab while Codex works to queue a command for the next turn; some entries show only when your model, platform or account supports them.
Also see: Codex CLI commands & flags.
All Commands
Session settings (7)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /model | Pick model and reasoning effort | Lists only models your account and workspace can use; /status afterwards confirms which one is active. |
| /fast | Toggle the Fast tier | Shown only when the current model's catalog offers a Fast tier; the choice is saved, and /statusline can display it. |
| /permissions | Change the approval preset | Choose a preset such as Auto or Read Only; configured permission profiles also appear in the picker. |
| /approve | Retry an auto-review denial | After you confirm, Codex reruns the denied action once under the current session policy. |
| /experimental | Toggle experimental features | Choices are saved to config and take effect once Codex restarts. |
| /memories | Configure memories | Decide whether Codex uses existing memories, writes new ones, or keeps memory off for future sessions. |
| /setup-default-sandbox | Set up elevated Windows sandbox | Appears only on Windows while the degraded restricted-token sandbox is in use, and walks through an administrator setup. |
Planning and review (6)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /plan | Enter plan mode | Text after the command becomes the first planning request; not available while Codex is already working. |
| /goal | Show or manage the goal | Without arguments it shows the current goal; edit, pause, resume and clear change or remove it. |
| /goal <objective> | Set a goal for the task | The objective must be non-empty and at most 4,000 characters; for more detail, point it at a file. |
| /diff | Show the Git diff | Includes staged and unstaged changes plus untracked files, so edits can be checked before a commit. |
| /review | Review the working tree | Findings focus on behavior changes and missing tests; set review_model in config.toml to use another model. |
| /init | Create an AGENTS.md scaffold | Run it in the directory where Codex should find persistent instructions, then edit the file to match your conventions. |
Chats and sessions (12)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /new | Start a new chat | Unlike /clear it leaves the terminal view as is; words after the command name the new chat. |
| /clear | Clear screen and start fresh | Ctrl + L only clears the view and keeps the chat; both are blocked while a task runs. |
| /rename | Rename this chat | Type the name inline, or run it alone to get a naming prompt; the transcript stays unchanged. |
| /resume | Resume a saved chat | Opens the saved-session picker and reloads the chosen transcript with its history intact. |
| /fork | Fork the current chat | The copy gets a fresh ID and the original stays untouched; codex fork in the shell forks a saved session instead. |
| /side | Open a side chat | Also typed as /btw; inline text seeds the side chat, and the command is unavailable inside another side chat or in review mode. |
| /subagents | Switch to a subagent thread | Lists the subagents spawned in this session and makes the chosen one the active thread. |
| /app | Hand off to the desktop app | Works on macOS and Windows only and shows an error when the ChatGPT app is not installed or running. |
| /archive | Archive this session | Exits Codex but keeps the transcript stored locally; codex unarchive brings it back later. |
| /delete | Delete this session permanently | Also removes spawned descendant sessions; refused while a chat is running or inside a side chat. |
| /quit | Quit Codex | Ctrl + C also closes the session; save or commit important work first. |
| /exit | Leave Codex | Behaves exactly like /quit; the docs advise saving or committing important work before either. |
Context and background work (7)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /compact | Summarize the chat to free context | Codex asks before summarizing, then swaps earlier turns for a concise summary that keeps the key details. |
| /mention | Mention a file | Type a path after it, such as src/lib/api.ts, and choose the match so later turns reference that file. |
| /ide | Add IDE context | Brings in open files and the current selection; optional inline text says what to do with them. |
| /skills | Use a skill | Pick a skill and Codex inserts its context so the next request follows its instructions. |
| /copy | Copy the latest output | Ctrl + O does the same from the main view; during a running turn it takes the last finished output. |
| /ps | List background terminals | Each entry shows its command and up to three recent output lines; without unified_exec the list may stay empty. |
| /stop | Stop background terminals | Ends every background terminal of this session, and /clean still works as an alias. |
Tools and integrations (5)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /mcp | List MCP tools | Append verbose for per-server diagnostics as well as the tools Codex can call. |
| /apps | Browse apps | The chosen app is inserted into the composer as a $app-slug mention, ready for your request. |
| /plugins | Browse plugins | Shows installed and discoverable plugins by marketplace tab; Space toggles an installed plugin on or off. |
| /hooks | Manage lifecycle hooks | Trust, disable or re-enable non-managed hooks per event; managed hooks are listed but cannot be disabled here. |
| /import | Import another agent's setup | Chat discovery covers up to 50 chats from the last 30 days; unavailable during a task or in remote sessions. |
Terminal interface (7)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /keymap | Remap TUI shortcuts | Bindings use names like ctrl-a and are saved under tui.keymap; an empty binding list unbinds the action. |
| /vim | Toggle Vim mode | Applies to the current session; set tui.vim_mode_default = true to start new sessions in Vim mode. |
| /raw | Toggle raw scrollback | Accepts on or off; Alt + R does the same, and tui.raw_output_mode = true makes it the default. |
| /statusline | Configure the footer | Toggle and reorder footer items such as model, rate limits or git branch; saved to tui.status_line. |
| /title | Configure the terminal title | Updates the window or tab title at once and saves the chosen items to tui.terminal_title. |
| /theme | Choose a syntax theme | Preview themes in the picker; the confirmed choice is stored as tui.theme in config.toml. |
| /pets | Choose a terminal pet | Also typed as /pet; pets show only in supported terminals, the choice is saved, and /pets off hides it. |
Account and diagnostics (5)
| Command / Syntax | What it does | Notes |
|---|---|---|
| /status | Show session status | Lists approval policy, model, writable roots and token use; remote sessions add the server address and version. |
| /usage | View account usage | Add daily, weekly or cumulative to open that token-activity view directly; it can also redeem an earned reset. |
| /debug-config | Inspect config layers | Prints layers from lowest precedence up plus policy sources, explaining why a setting differs from config.toml. |
| /feedback | Send feedback logs | Walks through including logs or diagnostics and submits them to the Codex maintainers. |
| /logout | Sign out | Clears the stored local credentials, which matters on a shared machine. |
Recipes
Codex CLI command chains for lean sessions, side experiments, moving to the desktop app and importing a Claude Code or Cursor setup.
Keep a long session lean
/ps → /stop → /compact
/ps lists background terminals with their latest output; /stop ends all of them at once, so run it only when none is still needed. /compact is refused while a task is running, so run it between turns: it swaps earlier turns for a summary and frees context.
Branch an experiment without losing the main thread
/fork → /diff → /review
/fork clones the chat with a fresh ID and leaves the original transcript untouched, so an alternative approach can run beside it. /diff then shows staged, unstaged and untracked changes, and /review asks Codex to check the working tree before you commit.
Take a terminal session into the desktop app
/rename → /app
Give the chat a recognizable name first, then /app opens the same saved chat in the ChatGPT desktop app on macOS or Windows. Codex shows an error when the app is not installed or not running.
Bring over a Claude Code or Cursor setup
/import → /debug-config → /status
/import copies the setup, project files or recent chats you select into Codex configuration and local files; run it from a local session with no task running. /debug-config then shows the config layers in precedence order, and /status confirms the model, approval policy and writable roots now in effect.
Frequently Asked Questions
Are these the same as the codex shell subcommands?
No. These are in-session slash commands you type inside a running Codex conversation. Shell subcommands and flags (codex exec, codex login, --color and so on) are on the Codex CLI shortcuts page.
How do I change approval behavior mid-session?
Use /permissions to relax or tighten approval requirements without restarting, for example switching between Auto and Read Only.
How do I check what my build supports?
Type / in the composer. The autocomplete list shows the commands your installed version actually provides.
Where are /cloud, /local and /reasoning?
They are not in the CLI reference or the 0.162.1 command list. In the terminal, /model sets the reasoning effort along with the model when the model offers it, and cloud chats are handled by the codex cloud shell command.
Why are /personality and /sandbox-add-read-dir missing?
OpenAI's reference still describes both, but the rust-v0.162.1 source no longer registers either command, so this page leaves them out until the reference and the release agree.
Sources and checks
- OpenAI Codex docs — Slash commands in Codex CLI (Markdown, fetched 2026-10-10) Command table and per-command sections (redirects to learn.chatgpt.com/docs/developer-commands?surface=cli)
- openai/codex rust-v0.162.1 — codex-rs/tui/src/slash_command.rs Built-in slash command list of Codex CLI 0.162.1 (release check of every row; /mcp description)
Every row on this page was matched to a line in the documentation above on . A command or parameter that could not be found there is not listed.
11 rows from the earlier version of this page were removed in that check: duplicates, and entries the documentation does not list or lists differently.
AI tools change their commands, parameters and model names between releases: the vendor's current documentation and the version you run have the last word. Found a wrong or missing entry? Tell us and it gets checked against the source. How we verify describes the process and its limits.
Related prompt references
Claude Code (157) · Aider (46) · Cursor (72) · All AI prompt references