cli/slash-commands.md +56 −7
16Codex ships with the following commands. Open the slash popup and start typing16Codex ships with the following commands. Open the slash popup and start typing
17the command name to filter the list.17the command name to filter the list.
18 18
19When a task is already running, you can type a slash command and press `Tab` to
20queue it for the next turn. Codex parses queued slash commands when they run, so
21command menus and errors appear after the current turn finishes. Slash
22completion still works before you queue the command.
23
19| Command | Purpose | When to use it |24| Command | Purpose | When to use it |
20| ------------------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |25| ------------------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
21| [`/permissions`](#update-permissions-with-permissions) | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |26| [`/permissions`](#update-permissions-with-permissions) | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |
25| [`/plugins`](#browse-plugins-with-plugins) | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |30| [`/plugins`](#browse-plugins-with-plugins) | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
26| [`/clear`](#clear-the-terminal-and-start-a-new-chat-with-clear) | Clear the terminal and start a fresh chat. | Reset the visible UI and conversation together when you want a fresh start. |31| [`/clear`](#clear-the-terminal-and-start-a-new-chat-with-clear) | Clear the terminal and start a fresh chat. | Reset the visible UI and conversation together when you want a fresh start. |
27| [`/compact`](#keep-transcripts-lean-with-compact) | Summarize the visible conversation to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |32| [`/compact`](#keep-transcripts-lean-with-compact) | Summarize the visible conversation to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |
2833| [`/copy`](#copy-the-latest-response-with-copy) | Copy the latest completed Codex output. | Grab the latest finished response or plan text without manually selecting it. || [`/copy`](#copy-the-latest-response-with-copy) | Copy the latest completed Codex output. | Grab the latest finished response or plan text without manually selecting it. You can also press `Ctrl+O`. |
29| [`/diff`](#review-changes-with-diff) | Show the Git diff, including files Git isn't tracking yet. | Review Codex's edits before you commit or run tests. |34| [`/diff`](#review-changes-with-diff) | Show the Git diff, including files Git isn't tracking yet. | Review Codex's edits before you commit or run tests. |
30| [`/exit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |35| [`/exit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |
31| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as subagents from the CLI. |36| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as subagents from the CLI. |
32| [`/feedback`](#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |37| [`/feedback`](#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |
33| [`/init`](#generate-agentsmd-with-init) | Generate an `AGENTS.md` scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you're working in. |38| [`/init`](#generate-agentsmd-with-init) | Generate an `AGENTS.md` scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you're working in. |
34| [`/logout`](#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |39| [`/logout`](#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |
3540| [`/mcp`](#list-mcp-tools-with-mcp) | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session. || [`/mcp`](#list-mcp-tools-with-mcp) | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session; add `verbose` for server details. |
36| [`/mention`](#highlight-files-with-mention) | Attach a file to the conversation. | Point Codex at specific files or folders you want it to inspect next. |41| [`/mention`](#highlight-files-with-mention) | Attach a file to the conversation. | Point Codex at specific files or folders you want it to inspect next. |
37| [`/model`](#set-the-active-model-with-model) | Choose the active model (and reasoning effort, when available). | Switch between general-purpose models (`gpt-4.1-mini`) and deeper reasoning models before running a task. |42| [`/model`](#set-the-active-model-with-model) | Choose the active model (and reasoning effort, when available). | Switch between general-purpose models (`gpt-4.1-mini`) and deeper reasoning models before running a task. |
3843| [`/fast`](#toggle-fast-mode-with-fast) | Toggle Fast mode for GPT-5.4. | Turn Fast mode on or off, or check whether the current thread is using it. || [`/fast`](#toggle-fast-mode-with-fast) | Toggle Fast mode for supported models. | Turn Fast mode on or off, or check whether the current thread is using it. |
39| [`/plan`](#switch-to-plan-mode-with-plan) | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |44| [`/plan`](#switch-to-plan-mode-with-plan) | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |
45| [`/goal`](#set-or-view-an-experimental-task-goal-with-goal) | Set or view an experimental goal for a long-running task. | Give Codex a persistent target to track while a larger task runs. Requires `features.goals`. |
40| [`/personality`](#set-a-communication-style-with-personality) | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |46| [`/personality`](#set-a-communication-style-with-personality) | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |
41| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |47| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |
42| [`/stop`](#stop-background-terminals-with-stop) | Stop all background terminals. | Cancel background terminal work started by the current session. |48| [`/stop`](#stop-background-terminals-with-stop) | Stop all background terminals. | Cancel background terminal work started by the current session. |
43| [`/fork`](#fork-the-current-conversation-with-fork) | Fork the current conversation into a new thread. | Branch the active session to explore a new approach without losing the current transcript. |49| [`/fork`](#fork-the-current-conversation-with-fork) | Fork the current conversation into a new thread. | Branch the active session to explore a new approach without losing the current transcript. |
50| [`/side`](#start-a-side-conversation-with-side) | Start an ephemeral side conversation. | Ask a focused follow-up without disrupting the main thread's transcript. |
44| [`/resume`](#resume-a-saved-conversation-with-resume) | Resume a saved conversation from your session list. | Continue work from a previous CLI session without starting over. |51| [`/resume`](#resume-a-saved-conversation-with-resume) | Resume a saved conversation from your session list. | Continue work from a previous CLI session without starting over. |
45| [`/new`](#start-a-new-conversation-with-new) | Start a new conversation inside the same CLI session. | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo. |52| [`/new`](#start-a-new-conversation-with-new) | Start a new conversation inside the same CLI session. | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo. |
46| [`/quit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |53| [`/quit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |
49| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |56| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |
50| [`/statusline`](#configure-footer-items-with-statusline) | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |57| [`/statusline`](#configure-footer-items-with-statusline) | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |
51| [`/title`](#configure-terminal-title-items-with-title) | Configure terminal window or tab title fields interactively. | Pick and reorder title items such as project, status, thread, branch, model, and task progress. |58| [`/title`](#configure-terminal-title-items-with-title) | Configure terminal window or tab title fields interactively. | Pick and reorder title items such as project, status, thread, branch, model, and task progress. |
59| [`/keymap`](#remap-tui-shortcuts-with-keymap) | Remap TUI keyboard shortcuts. | Inspect and persist custom shortcut bindings in `config.toml`. |
52 60
53`/quit` and `/exit` both exit the CLI. Use them only after you have saved or61`/quit` and `/exit` both exit the CLI. Use them only after you have saved or
54committed any important work.62committed any important work.
93 101
941. Type `/plan` and press Enter to switch the active conversation into plan1021. Type `/plan` and press Enter to switch the active conversation into plan
95 mode.103 mode.
961042. Optional: provide inline prompt text (for example, `/plan Propose a migration plan for this service`).2. Optional: provide inline prompt text (for example, `/plan Propose a
105migration plan for this service`).
973. You can paste content or attach images while using inline `/plan` arguments.1063. You can paste content or attach images while using inline `/plan` arguments.
98 107
99Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.108Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.
100 109
101While a task is already running, `/plan` is temporarily unavailable.110While a task is already running, `/plan` is temporarily unavailable.
102 111
112### Set an experimental goal with `/goal`
113
114`/goal` is experimental and only available when `features.goals` is enabled. To enable it, open `/experimental` or add `goals = true` under `[features]` in `config.toml`.
115
1161. Type `/goal <objective>` to set the goal, for example `/goal Finish the migration and keep tests green`.
1172. Type `/goal` to view the current goal.
1183. Use `/goal pause`, `/goal resume`, or `/goal clear` to pause, resume, or remove it.
119
120Expected: Codex keeps the goal attached to the active thread while work continues.
121
103### Toggle experimental features with `/experimental`122### Toggle experimental features with `/experimental`
104 123
1051. Type `/experimental` and press Enter.1241. Type `/experimental` and press Enter.
138the in-progress response. The command is unavailable before the first completed157the in-progress response. The command is unavailable before the first completed
139Codex output and immediately after a rollback.158Codex output and immediately after a rollback.
140 159
160You can also press <kbd>Ctrl</kbd>+<kbd>O</kbd> from the main TUI to copy the
161latest completed response without opening the slash command menu.
162
141### Grant sandbox read access with `/sandbox-add-read-dir`163### Grant sandbox read access with `/sandbox-add-read-dir`
142 164
143This command is available only when running the CLI natively on Windows.165This command is available only when running the CLI natively on Windows.
191Available title items include app name, project, spinner, status, thread, git213Available title items include app name, project, spinner, status, thread, git
192branch, model, and task progress.214branch, model, and task progress.
193 215
216### Remap TUI shortcuts with `/keymap`
217
218Use `/keymap` to inspect, update, and persist keyboard shortcut bindings for the TUI.
219
2201. Type `/keymap`.
2212. Pick the shortcut context and action you want to change.
2223. Enter the new binding or remove the existing one.
223
224Expected: Codex updates the active keymap and writes the custom binding to `tui.keymap` in `config.toml`.
225
226Key bindings use names such as `ctrl-a`, `shift-enter`, and `page-down`. Context-specific bindings override `tui.keymap.global`; an empty binding list unbinds the action.
227
194### Check background terminals with `/ps`228### Check background terminals with `/ps`
195 229
1961. Type `/ps`.2301. Type `/ps`.
260If you need to fork a saved session instead of the current one, run294If you need to fork a saved session instead of the current one, run
261`codex fork` in your terminal to open the session picker.295`codex fork` in your terminal to open the session picker.
262 296
297### Start a side conversation with `/side`
298
299Use `/side` to start an ephemeral fork from the current conversation without switching away from the main task.
300
3011. Type `/side` to open a side conversation.
3022. Optionally add inline text, for example `/side Check whether this plan has an obvious risk`.
3033. Return to the parent thread after the focused detour finishes.
304
305Expected: Codex opens a side conversation whose transcript is separate from the parent thread. While you are in side mode, the TUI continues to show parent-thread status so you can see whether the main task is still running.
306
307`/side` is unavailable inside another side conversation and during review mode.
308
263### Generate `AGENTS.md` with `/init`309### Generate `AGENTS.md` with `/init`
264 310
2651. Run `/init` in the directory where you want Codex to look for persistent instructions.3111. Run `/init` in the directory where you want Codex to look for persistent instructions.
284 330
285Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.331Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.
286 332
333Use `/mcp verbose` to include detailed server diagnostics. If you pass anything other than `verbose`, Codex shows the command usage.
334
287### Browse apps with `/apps`335### Browse apps with `/apps`
288 336
2891. Type `/apps`.3371. Type `/apps`.
295### Browse plugins with `/plugins`343### Browse plugins with `/plugins`
296 344
2971. Type `/plugins`.3451. Type `/plugins`.
2983462. Pick a plugin from the list to inspect its capabilities or available actions.2. Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.
299 347
300348Expected: Codex opens the plugin browser so you can review installed plugins andExpected: Codex opens the plugin browser so you can review installed plugins,
301349discoverable plugins that your configuration allows.discoverable plugins that your configuration allows, and installed plugin state.
350Press <kbd>Space</kbd> on an installed plugin to toggle its enabled state.
302 351
303### Switch agent threads with `/agent`352### Switch agent threads with `/agent`
304 353