cli/slash-commands.md +84 −9
8This guide shows you how to:8This guide shows you how to:
9 9
10- Find the right built-in slash command for a task10- Find the right built-in slash command for a task
1111- Steer an active session with commands like `/model`, `/personality`,- Steer an active session with commands like `/model`, `/fast`,
1212 `/permissions`, `/experimental`, `/agent`, and `/status` `/personality`, `/permissions`, `/agent`, and `/status`
13 13
14## Built-in slash commands14## Built-in slash commands
15 15
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. |
22| [`/sandbox-add-read-dir`](#grant-sandbox-read-access-with-sandbox-add-read-dir) | Grant sandbox read access to an extra directory (Windows only). | Unblock commands that need to read an absolute directory path outside the current readable roots. |27| [`/sandbox-add-read-dir`](#grant-sandbox-read-access-with-sandbox-add-read-dir) | Grant sandbox read access to an extra directory (Windows only). | Unblock commands that need to read an absolute directory path outside the current readable roots. |
2328| [`/agent`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned sub-agent thread. || [`/agent`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |
24| [`/apps`](#browse-apps-with-apps) | Browse apps (connectors) and insert them into your prompt. | Attach an app as `$app-slug` before asking Codex to use it. |29| [`/apps`](#browse-apps-with-apps) | Browse apps (connectors) and insert them into your prompt. | Attach an app as `$app-slug` before asking Codex to use it. |
2530| [`/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 clean slate. || [`/plugins`](#browse-plugins-with-plugins) | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
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. |
26| [`/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. |
2733| [`/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`. |
28| [`/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. |
29| [`/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. |
3036| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as sub-agents from the CLI. || [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as subagents from the CLI. |
31| [`/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. |
32| [`/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. |
33| [`/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. |
3440| [`/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. |
35| [`/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. |
36| [`/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. |
43| [`/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. |
37| [`/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. |
38| [`/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. |45| [`/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. |
39| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |46| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |
47| [`/stop`](#stop-background-terminals-with-stop) | Stop all background terminals. | Cancel background terminal work started by the current session. |
40| [`/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. |48| [`/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| [`/side`](#start-a-side-conversation-with-side) | Start an ephemeral side conversation. | Ask a focused follow-up without disrupting the main thread's transcript. |
41| [`/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. |50| [`/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. |
42| [`/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. |51| [`/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. |
43| [`/quit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |52| [`/quit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |
45| [`/status`](#inspect-the-session-with-status) | Display session configuration and token usage. | Confirm the active model, approval policy, writable roots, and remaining context capacity. |54| [`/status`](#inspect-the-session-with-status) | Display session configuration and token usage. | Confirm the active model, approval policy, writable roots, and remaining context capacity. |
46| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |55| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |
47| [`/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. |56| [`/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| [`/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| [`/keymap`](#remap-tui-shortcuts-with-keymap) | Remap TUI keyboard shortcuts. | Inspect and persist custom shortcut bindings in `config.toml`. |
48 59
49`/quit` and `/exit` both exit the CLI. Use them only after you have saved or60`/quit` and `/exit` both exit the CLI. Use them only after you have saved or
50committed any important work.61committed any important work.
63 74
64Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.75Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.
65 76
77### Toggle Fast mode with `/fast`
78
791. Type `/fast on`, `/fast off`, or `/fast status`.
802. If you want the setting to persist, confirm the update when Codex offers to save it.
81
82Expected: Codex reports whether Fast mode is on or off for the current thread. In the TUI footer, you can also show a Fast mode status-line item with `/statusline`.
83
66### Set a communication style with `/personality`84### Set a communication style with `/personality`
67 85
68Use `/personality` to change how Codex communicates without rewriting your prompt.86Use `/personality` to change how Codex communicates without rewriting your prompt.
92### Toggle experimental features with `/experimental`110### Toggle experimental features with `/experimental`
93 111
941. Type `/experimental` and press Enter.1121. Type `/experimental` and press Enter.
951132. Toggle the features you want (for example, **Multi-agents**), then restart Codex.2. Toggle the features you want (for example, Apps or Smart Approvals), then restart Codex if the prompt asks you to.
96 114
97Expected: Codex saves your feature choices to config and applies them on restart.115Expected: Codex saves your feature choices to config and applies them on restart.
98 116
127the in-progress response. The command is unavailable before the first completed145the in-progress response. The command is unavailable before the first completed
128Codex output and immediately after a rollback.146Codex output and immediately after a rollback.
129 147
148You can also press <kbd>Ctrl</kbd>+<kbd>O</kbd> from the main TUI to copy the
149latest completed response without opening the slash command menu.
150
130### Grant sandbox read access with `/sandbox-add-read-dir`151### Grant sandbox read access with `/sandbox-add-read-dir`
131 152
132This command is available only when running the CLI natively on Windows.153This command is available only when running the CLI natively on Windows.
169limits, git branch, token counters, session id, current directory/project root,190limits, git branch, token counters, session id, current directory/project root,
170and Codex version.191and Codex version.
171 192
193### Configure terminal title items with `/title`
194
1951. Type `/title`.
1962. Use the picker to toggle and reorder items, then confirm.
197
198Expected: The terminal window or tab title updates immediately and persists to
199`tui.terminal_title` in `config.toml`.
200
201Available title items include app name, project, spinner, status, thread, git
202branch, model, and task progress.
203
204### Remap TUI shortcuts with `/keymap`
205
206Use `/keymap` to inspect, update, and persist keyboard shortcut bindings for the TUI.
207
2081. Type `/keymap`.
2092. Pick the shortcut context and action you want to change.
2103. Enter the new binding or remove the existing one.
211
212Expected: Codex updates the active keymap and writes the custom binding to `tui.keymap` in `config.toml`.
213
214Key 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.
215
172### Check background terminals with `/ps`216### Check background terminals with `/ps`
173 217
1741. Type `/ps`.2181. Type `/ps`.
179 223
180Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.224Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.
181 225
226### Stop background terminals with `/stop`
227
2281. Type `/stop`.
2292. Confirm if Codex asks before stopping the listed terminals.
230
231Expected: Codex stops all background terminals for the current session. `/clean`
232is still available as an alias for `/stop`.
233
182### Keep transcripts lean with `/compact`234### Keep transcripts lean with `/compact`
183 235
1841. After a long exchange, type `/compact`.2361. After a long exchange, type `/compact`.
209Expected: Codex starts a fresh conversation in the same CLI session, so you261Expected: Codex starts a fresh conversation in the same CLI session, so you
210can switch tasks without leaving your terminal.262can switch tasks without leaving your terminal.
211 263
212264Unlike `/clear`, `/new` does not clear the current terminal view first.Unlike `/clear`, `/new` doesn't clear the current terminal view first.
213 265
214### Resume a saved conversation with `/resume`266### Resume a saved conversation with `/resume`
215 267
230If you need to fork a saved session instead of the current one, run282If you need to fork a saved session instead of the current one, run
231`codex fork` in your terminal to open the session picker.283`codex fork` in your terminal to open the session picker.
232 284
285### Start a side conversation with `/side`
286
287Use `/side` to start an ephemeral fork from the current conversation without switching away from the main task.
288
2891. Type `/side` to open a side conversation.
2902. Optionally add inline text, for example `/side Check whether this plan has an obvious risk`.
2913. Return to the parent thread after the focused detour finishes.
292
293Expected: 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.
294
295`/side` is unavailable inside another side conversation and during review mode.
296
233### Generate `AGENTS.md` with `/init`297### Generate `AGENTS.md` with `/init`
234 298
2351. Run `/init` in the directory where you want Codex to look for persistent instructions.2991. Run `/init` in the directory where you want Codex to look for persistent instructions.
254 318
255Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.319Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.
256 320
321Use `/mcp verbose` to include detailed server diagnostics. If you pass anything other than `verbose`, Codex shows the command usage.
322
257### Browse apps with `/apps`323### Browse apps with `/apps`
258 324
2591. Type `/apps`.3251. Type `/apps`.
262Expected: Codex inserts the app mention into the composer as `$app-slug`, so328Expected: Codex inserts the app mention into the composer as `$app-slug`, so
263you can immediately ask Codex to use it.329you can immediately ask Codex to use it.
264 330
331### Browse plugins with `/plugins`
332
3331. Type `/plugins`.
3342. Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.
335
336Expected: Codex opens the plugin browser so you can review installed plugins,
337discoverable plugins that your configuration allows, and installed plugin state.
338Press <kbd>Space</kbd> on an installed plugin to toggle its enabled state.
339
265### Switch agent threads with `/agent`340### Switch agent threads with `/agent`
266 341
2671. Type `/agent` and press Enter.3421. Type `/agent` and press Enter.