OpenAI Codex CLI Commands & Prompt Reference

58 commands & parameters · 1 categories · Source: OpenAI Codex Docs

OpenAI Codex runs as a terminal agent, and its in-session slash commands are how you steer it without leaving the conversation: permissions, model selection, MCP servers, review flows, and session state are all one / away. This page lists the in-chat slash commands; the codex CLI subcommands and flags you type in your shell remain on our Codex CLI shortcuts page.

Commands like /permissions and /model change how the agent behaves mid-session, while /review drives the code-review workflow and /mcp manages tool servers. If a command is missing from your build, typing / in the composer shows the set your version actually supports.

Also see: Codex CLI commands & flags.

All Commands

Slash Commands (58)

Command / SyntaxWhat it doesNotes
/permissionsRelax or tighten approval requirements mid-session, such as switching between Auto and ReadRelax or tighten approval requirements mid-session, such as switching between Auto and Read.
/idePull editor context into the next prompt without re-explaining what's open in your IDEPull editor context into the next prompt without re-explaining what's open in your IDE.
/keymapInspect and persist custom shortcut bindings in config.tomlInspect and persist custom shortcut bindings in config.toml.
/vimSwitch between Vim normal/insert behavior and the default composer editing modeSwitch between Vim normal/insert behavior and the default composer editing mode.
/setup-default-sandboxReplace the degraded Windows sandbox after Codex offers the elevated setupReplace the degraded Windows sandbox after Codex offers the elevated setup.
/sandbox-add-read-dirUnblock commands that need to read an absolute directory path outside the current readableUnblock commands that need to read an absolute directory path outside the current readable.
/agent, /subagentsInspect or continue work in a spawned subagent threadInspect or continue work in a spawned subagent thread.
/appsAttach an app as $app-slug before asking Codex to use itAttach an app as $app-slug before asking Codex to use it.
/pluginsInspect plugin tools, install suggested plugins, or manage plugin availabilityInspect plugin tools, install suggested plugins, or manage plugin availability.
/hooksInspect configured hooks, trust new or changed hooks, or disable non-managed hooks before theyInspect configured hooks, trust new or changed hooks, or disable non-managed hooks before they.
/clearReset the visible UI and chat context together when you want a fresh startReset the visible UI and chat context together when you want a fresh start.
/renameGive a saved session a recognizable name without leaving the TUIGive a saved session a recognizable name without leaving the TUI.
/archiveRemove the current session from active session lists without deleting its transcriptRemove the current session from active session lists without deleting its transcript.
/deleteRemove the transcript and descendant sessions when archiving isn't enoughRemove the transcript and descendant sessions when archiving isn't enough.
/compactUse after long runs so Codex retains key points without blowing the context windowUse after long runs so Codex retains key points without blowing the context window.
/copyGrab the latest finished response or plan text without manually selecting it. You can alsoGrab the latest finished response or plan text without manually selecting it. You can also.
/diffReview Codex's edits before you commit or run testsReview Codex's edits before you commit or run tests.
/exitAlternative spelling; both commands exit the sessionAlternative spelling; both commands exit the session.
/experimentalEnable options such as Network proxy or Prevent sleep while runningEnable options such as Network proxy or Prevent sleep while running.
/approveRetry a command or action that the auto reviewer deniedRetry a command or action that the auto reviewer denied.
/memoriesTurn memory injection or memory generation on or off without leaving the TUITurn memory injection or memory generation on or off without leaving the TUI.
/skillsImprove task-specific behavior by selecting a relevant local skillImprove task-specific behavior by selecting a relevant local skill.
/importMigrate supported external-agent artifacts into Codex configuration and local filesMigrate supported external-agent artifacts into Codex configuration and local files.
/feedbackReport issues or share diagnostics with supportReport issues or share diagnostics with support.
/initCapture persistent instructions for the repository or subdirectory you're workingCapture persistent instructions for the repository or subdirectory you're working.
/logoutClear local credentials when using a shared machineClear local credentials when using a shared machine.
/mcpCheck which external tools Codex can call during the session; add verbose for server detailsCheck which external tools Codex can call during the session; add verbose for server details.
/mentionPoint Codex at specific files or folders you want it to inspect nextPoint Codex at specific files or folders you want it to inspect next.
/modelSwitch between models such as gpt-5.4-mini and gpt-5.5 before running a taskSwitch between models such as gpt-5.4-mini and gpt-5.5 before running a task.
/fastTurn the current model's Fast tier on or off and persist the selectionTurn the current model's Fast tier on or off and persist the selection.
/planAsk Codex to propose an execution plan before implementation work startsAsk Codex to propose an execution plan before implementation work starts.
/goalGive Codex a persistent target to track while a larger task runsGive Codex a persistent target to track while a larger task runs.
/personalityMake Codex more concise, more explanatory, or more collaborative without changing yourMake Codex more concise, more explanatory, or more collaborative without changing your.
/psCheck long-running commands without leaving the main transcriptCheck long-running commands without leaving the main transcript.
/stopCancel background terminal work started by the current sessionCancel background terminal work started by the current session.
/forkBranch the active session to explore a new approach without losing the current transcriptBranch the active session to explore a new approach without losing the current transcript.
/appMove from the TUI to the desktop app on macOS or WindowsMove from the TUI to the desktop app on macOS or Windows.
/side, /btwAsk a focused follow-up without disrupting the main chat's transcriptAsk a focused follow-up without disrupting the main chat's transcript.
/rawMake terminal selection and copying less formatted while reviewing long outputMake terminal selection and copying less formatted while reviewing long output.
/resumeContinue work from a previous CLI session without starting overContinue work from a previous CLI session without starting over.
/newReset the chat context without leaving the CLI when you want a fresh prompt in the same repoReset the chat context without leaving the CLI when you want a fresh prompt in the same repo.
/quitLeave the session immediatelyLeave the session immediately.
/reviewRun after Codex completes work or when you want a second set of eyes on local changesRun after Codex completes work or when you want a second set of eyes on local changes.
/statusConfirm the active model, approval policy, writable roots, and remaining context capacityConfirm the active model, approval policy, writable roots, and remaining context capacity.
/usageInspect daily, weekly, or cumulative ChatGPT token activity from inside the TUIInspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI.
/debug-configDebug precedence and policy requirements, including experimental network constraintsDebug precedence and policy requirements, including experimental network constraints.
/statuslinePick and reorder footer items (model/context/limits/git/tokens/session) and persistPick and reorder footer items (model/context/limits/git/tokens/session) and persist.
/titlePick and reorder title items such as project, status, thread, branch, model, and task progressPick and reorder title items such as project, status, thread, branch, model, and task progress.
/themePreview and persist a terminal syntax-highlighting themePreview and persist a terminal syntax-highlighting theme.
/pets, /petPersonalize the TUI with a built-in or custom ambient petPersonalize the TUI with a built-in or custom ambient pet.
/cloudRun the chat in the cloud, when cloud execution is availableRun the chat in the cloud, when cloud execution is available.
/cloud-environmentChoose the cloud environment for the chatChoose the cloud environment for the chat.
/ide-contextTurn automatic IDE context on or offTurn automatic IDE context on or off.
/localRun the chat in your local workspaceRun the chat in your local workspace.
/projectChoose a project for new chatsChoose a project for new chats.
/reasoningChoose the reasoning effort for the current chatChoose the reasoning effort for the current chat.
/sideStart a temporary side chat without interrupting the main chatStart a temporary side chat without interrupting the main chat.
/worktreeRun the chat in a new Git worktreeRun the chat in a new Git worktree.

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.

Every entry on this page is a literal, typeable token taken from the official documentation linked above. Command sets in AI tools change quickly - the in-product command menu is always authoritative for your installed version.