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 / Syntax | What it does | Notes |
|---|---|---|
| /permissions | Relax or tighten approval requirements mid-session, such as switching between Auto and Read | Relax or tighten approval requirements mid-session, such as switching between Auto and Read. |
| /ide | Pull editor context into the next prompt without re-explaining what's open in your IDE | Pull editor context into the next prompt without re-explaining what's open in your IDE. |
| /keymap | Inspect and persist custom shortcut bindings in config.toml | Inspect and persist custom shortcut bindings in config.toml. |
| /vim | Switch between Vim normal/insert behavior and the default composer editing mode | Switch between Vim normal/insert behavior and the default composer editing mode. |
| /setup-default-sandbox | Replace the degraded Windows sandbox after Codex offers the elevated setup | Replace the degraded Windows sandbox after Codex offers the elevated setup. |
| /sandbox-add-read-dir | Unblock commands that need to read an absolute directory path outside the current readable | Unblock commands that need to read an absolute directory path outside the current readable. |
| /agent, /subagents | Inspect or continue work in a spawned subagent thread | Inspect or continue work in a spawned subagent thread. |
| /apps | Attach an app as $app-slug before asking Codex to use it | Attach an app as $app-slug before asking Codex to use it. |
| /plugins | Inspect plugin tools, install suggested plugins, or manage plugin availability | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
| /hooks | Inspect configured hooks, trust new or changed hooks, or disable non-managed hooks before they | Inspect configured hooks, trust new or changed hooks, or disable non-managed hooks before they. |
| /clear | Reset the visible UI and chat context together when you want a fresh start | Reset the visible UI and chat context together when you want a fresh start. |
| /rename | Give a saved session a recognizable name without leaving the TUI | Give a saved session a recognizable name without leaving the TUI. |
| /archive | Remove the current session from active session lists without deleting its transcript | Remove the current session from active session lists without deleting its transcript. |
| /delete | Remove the transcript and descendant sessions when archiving isn't enough | Remove the transcript and descendant sessions when archiving isn't enough. |
| /compact | Use after long runs so Codex retains key points without blowing the context window | Use after long runs so Codex retains key points without blowing the context window. |
| /copy | Grab the latest finished response or plan text without manually selecting it. You can also | Grab the latest finished response or plan text without manually selecting it. You can also. |
| /diff | Review Codex's edits before you commit or run tests | Review Codex's edits before you commit or run tests. |
| /exit | Alternative spelling; both commands exit the session | Alternative spelling; both commands exit the session. |
| /experimental | Enable options such as Network proxy or Prevent sleep while running | Enable options such as Network proxy or Prevent sleep while running. |
| /approve | Retry a command or action that the auto reviewer denied | Retry a command or action that the auto reviewer denied. |
| /memories | Turn memory injection or memory generation on or off without leaving the TUI | Turn memory injection or memory generation on or off without leaving the TUI. |
| /skills | Improve task-specific behavior by selecting a relevant local skill | Improve task-specific behavior by selecting a relevant local skill. |
| /import | Migrate supported external-agent artifacts into Codex configuration and local files | Migrate supported external-agent artifacts into Codex configuration and local files. |
| /feedback | Report issues or share diagnostics with support | Report issues or share diagnostics with support. |
| /init | Capture persistent instructions for the repository or subdirectory you're working | Capture persistent instructions for the repository or subdirectory you're working. |
| /logout | Clear local credentials when using a shared machine | Clear local credentials when using a shared machine. |
| /mcp | Check which external tools Codex can call during the session; add verbose for server details | Check which external tools Codex can call during the session; add verbose for server details. |
| /mention | Point Codex at specific files or folders you want it to inspect next | Point Codex at specific files or folders you want it to inspect next. |
| /model | Switch between models such as gpt-5.4-mini and gpt-5.5 before running a task | Switch between models such as gpt-5.4-mini and gpt-5.5 before running a task. |
| /fast | Turn the current model's Fast tier on or off and persist the selection | Turn the current model's Fast tier on or off and persist the selection. |
| /plan | Ask Codex to propose an execution plan before implementation work starts | Ask Codex to propose an execution plan before implementation work starts. |
| /goal | Give Codex a persistent target to track while a larger task runs | Give Codex a persistent target to track while a larger task runs. |
| /personality | Make Codex more concise, more explanatory, or more collaborative without changing your | Make Codex more concise, more explanatory, or more collaborative without changing your. |
| /ps | Check long-running commands without leaving the main transcript | Check long-running commands without leaving the main transcript. |
| /stop | Cancel background terminal work started by the current session | Cancel background terminal work started by the current session. |
| /fork | Branch the active session to explore a new approach without losing the current transcript | Branch the active session to explore a new approach without losing the current transcript. |
| /app | Move from the TUI to the desktop app on macOS or Windows | Move from the TUI to the desktop app on macOS or Windows. |
| /side, /btw | Ask a focused follow-up without disrupting the main chat's transcript | Ask a focused follow-up without disrupting the main chat's transcript. |
| /raw | Make terminal selection and copying less formatted while reviewing long output | Make terminal selection and copying less formatted while reviewing long output. |
| /resume | Continue work from a previous CLI session without starting over | Continue work from a previous CLI session without starting over. |
| /new | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo. |
| /quit | Leave the session immediately | Leave the session immediately. |
| /review | Run after Codex completes work or when you want a second set of eyes on local changes | Run after Codex completes work or when you want a second set of eyes on local changes. |
| /status | Confirm the active model, approval policy, writable roots, and remaining context capacity | Confirm the active model, approval policy, writable roots, and remaining context capacity. |
| /usage | Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI | Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI. |
| /debug-config | Debug precedence and policy requirements, including experimental network constraints | Debug precedence and policy requirements, including experimental network constraints. |
| /statusline | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist. |
| /title | Pick and reorder title items such as project, status, thread, branch, model, and task progress | Pick and reorder title items such as project, status, thread, branch, model, and task progress. |
| /theme | Preview and persist a terminal syntax-highlighting theme | Preview and persist a terminal syntax-highlighting theme. |
| /pets, /pet | Personalize the TUI with a built-in or custom ambient pet | Personalize the TUI with a built-in or custom ambient pet. |
| /cloud | Run the chat in the cloud, when cloud execution is available | Run the chat in the cloud, when cloud execution is available. |
| /cloud-environment | Choose the cloud environment for the chat | Choose the cloud environment for the chat. |
| /ide-context | Turn automatic IDE context on or off | Turn automatic IDE context on or off. |
| /local | Run the chat in your local workspace | Run the chat in your local workspace. |
| /project | Choose a project for new chats | Choose a project for new chats. |
| /reasoning | Choose the reasoning effort for the current chat | Choose the reasoning effort for the current chat. |
| /side | Start a temporary side chat without interrupting the main chat | Start a temporary side chat without interrupting the main chat. |
| /worktree | Run the chat in a new Git worktree | Run 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.