OpenAI Codex CLI Commands & Prompt Reference

49 commands & parameters · 7 categories · Sources: OpenAI Codex docs — Slash commands in Codex CLI (Markdown, fetched 2026-10-10) and 1 more · Checked

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 / SyntaxWhat it doesNotes
/modelPick model and reasoning effortLists only models your account and workspace can use; /status afterwards confirms which one is active.
/fastToggle the Fast tierShown only when the current model's catalog offers a Fast tier; the choice is saved, and /statusline can display it.
/permissionsChange the approval presetChoose a preset such as Auto or Read Only; configured permission profiles also appear in the picker.
/approveRetry an auto-review denialAfter you confirm, Codex reruns the denied action once under the current session policy.
/experimentalToggle experimental featuresChoices are saved to config and take effect once Codex restarts.
/memoriesConfigure memoriesDecide whether Codex uses existing memories, writes new ones, or keeps memory off for future sessions.
/setup-default-sandboxSet up elevated Windows sandboxAppears only on Windows while the degraded restricted-token sandbox is in use, and walks through an administrator setup.

Planning and review (6)

Command / SyntaxWhat it doesNotes
/planEnter plan modeText after the command becomes the first planning request; not available while Codex is already working.
/goalShow or manage the goalWithout arguments it shows the current goal; edit, pause, resume and clear change or remove it.
/goal <objective>Set a goal for the taskThe objective must be non-empty and at most 4,000 characters; for more detail, point it at a file.
/diffShow the Git diffIncludes staged and unstaged changes plus untracked files, so edits can be checked before a commit.
/reviewReview the working treeFindings focus on behavior changes and missing tests; set review_model in config.toml to use another model.
/initCreate an AGENTS.md scaffoldRun it in the directory where Codex should find persistent instructions, then edit the file to match your conventions.

Chats and sessions (12)

Command / SyntaxWhat it doesNotes
/newStart a new chatUnlike /clear it leaves the terminal view as is; words after the command name the new chat.
/clearClear screen and start freshCtrl + L only clears the view and keeps the chat; both are blocked while a task runs.
/renameRename this chatType the name inline, or run it alone to get a naming prompt; the transcript stays unchanged.
/resumeResume a saved chatOpens the saved-session picker and reloads the chosen transcript with its history intact.
/forkFork the current chatThe copy gets a fresh ID and the original stays untouched; codex fork in the shell forks a saved session instead.
/sideOpen a side chatAlso typed as /btw; inline text seeds the side chat, and the command is unavailable inside another side chat or in review mode.
/subagentsSwitch to a subagent threadLists the subagents spawned in this session and makes the chosen one the active thread.
/appHand off to the desktop appWorks on macOS and Windows only and shows an error when the ChatGPT app is not installed or running.
/archiveArchive this sessionExits Codex but keeps the transcript stored locally; codex unarchive brings it back later.
/deleteDelete this session permanentlyAlso removes spawned descendant sessions; refused while a chat is running or inside a side chat.
/quitQuit CodexCtrl + C also closes the session; save or commit important work first.
/exitLeave CodexBehaves exactly like /quit; the docs advise saving or committing important work before either.

Context and background work (7)

Command / SyntaxWhat it doesNotes
/compactSummarize the chat to free contextCodex asks before summarizing, then swaps earlier turns for a concise summary that keeps the key details.
/mentionMention a fileType a path after it, such as src/lib/api.ts, and choose the match so later turns reference that file.
/ideAdd IDE contextBrings in open files and the current selection; optional inline text says what to do with them.
/skillsUse a skillPick a skill and Codex inserts its context so the next request follows its instructions.
/copyCopy the latest outputCtrl + O does the same from the main view; during a running turn it takes the last finished output.
/psList background terminalsEach entry shows its command and up to three recent output lines; without unified_exec the list may stay empty.
/stopStop background terminalsEnds every background terminal of this session, and /clean still works as an alias.

Tools and integrations (5)

Command / SyntaxWhat it doesNotes
/mcpList MCP toolsAppend verbose for per-server diagnostics as well as the tools Codex can call.
/appsBrowse appsThe chosen app is inserted into the composer as a $app-slug mention, ready for your request.
/pluginsBrowse pluginsShows installed and discoverable plugins by marketplace tab; Space toggles an installed plugin on or off.
/hooksManage lifecycle hooksTrust, disable or re-enable non-managed hooks per event; managed hooks are listed but cannot be disabled here.
/importImport another agent's setupChat discovery covers up to 50 chats from the last 30 days; unavailable during a task or in remote sessions.

Terminal interface (7)

Command / SyntaxWhat it doesNotes
/keymapRemap TUI shortcutsBindings use names like ctrl-a and are saved under tui.keymap; an empty binding list unbinds the action.
/vimToggle Vim modeApplies to the current session; set tui.vim_mode_default = true to start new sessions in Vim mode.
/rawToggle raw scrollbackAccepts on or off; Alt + R does the same, and tui.raw_output_mode = true makes it the default.
/statuslineConfigure the footerToggle and reorder footer items such as model, rate limits or git branch; saved to tui.status_line.
/titleConfigure the terminal titleUpdates the window or tab title at once and saves the chosen items to tui.terminal_title.
/themeChoose a syntax themePreview themes in the picker; the confirmed choice is stored as tui.theme in config.toml.
/petsChoose a terminal petAlso typed as /pet; pets show only in supported terminals, the choice is saved, and /pets off hides it.

Account and diagnostics (5)

Command / SyntaxWhat it doesNotes
/statusShow session statusLists approval policy, model, writable roots and token use; remote sessions add the server address and version.
/usageView account usageAdd daily, weekly or cumulative to open that token-activity view directly; it can also redeem an earned reset.
/debug-configInspect config layersPrints layers from lowest precedence up plus policy sources, explaining why a setting differs from config.toml.
/feedbackSend feedback logsWalks through including logs or diagnostics and submits them to the Codex maintainers.
/logoutSign outClears 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

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