cli/slash-commands.md +74 −6
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. |
23| [`/agent`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |28| [`/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. |
30| [`/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. |
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. |
3743| [`/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. |
38| [`/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. |
39| [`/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. |
40| [`/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. |
41| [`/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. |
42| [`/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. |
43| [`/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. |
44| [`/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. |
46| [`/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. |
47| [`/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. |
48| [`/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`. |
49 59
50`/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
51committed any important work.61committed any important work.
90 100
911. Type `/plan` and press Enter to switch the active conversation into plan1011. Type `/plan` and press Enter to switch the active conversation into plan
92 mode.102 mode.
931032. 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
104migration plan for this service`).
943. You can paste content or attach images while using inline `/plan` arguments.1053. You can paste content or attach images while using inline `/plan` arguments.
95 106
96Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.107Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.
135the in-progress response. The command is unavailable before the first completed146the in-progress response. The command is unavailable before the first completed
136Codex output and immediately after a rollback.147Codex output and immediately after a rollback.
137 148
149You can also press <kbd>Ctrl</kbd>+<kbd>O</kbd> from the main TUI to copy the
150latest completed response without opening the slash command menu.
151
138### Grant sandbox read access with `/sandbox-add-read-dir`152### Grant sandbox read access with `/sandbox-add-read-dir`
139 153
140This command is available only when running the CLI natively on Windows.154This command is available only when running the CLI natively on Windows.
177limits, git branch, token counters, session id, current directory/project root,191limits, git branch, token counters, session id, current directory/project root,
178and Codex version.192and Codex version.
179 193
194### Configure terminal title items with `/title`
195
1961. Type `/title`.
1972. Use the picker to toggle and reorder items, then confirm.
198
199Expected: The terminal window or tab title updates immediately and persists to
200`tui.terminal_title` in `config.toml`.
201
202Available title items include app name, project, spinner, status, thread, git
203branch, model, and task progress.
204
205### Remap TUI shortcuts with `/keymap`
206
207Use `/keymap` to inspect, update, and persist keyboard shortcut bindings for the TUI.
208
2091. Type `/keymap`.
2102. Pick the shortcut context and action you want to change.
2113. Enter the new binding or remove the existing one.
212
213Expected: Codex updates the active keymap and writes the custom binding to `tui.keymap` in `config.toml`.
214
215Key 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.
216
180### Check background terminals with `/ps`217### Check background terminals with `/ps`
181 218
1821. Type `/ps`.2191. Type `/ps`.
187 224
188Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.225Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.
189 226
227### Stop background terminals with `/stop`
228
2291. Type `/stop`.
2302. Confirm if Codex asks before stopping the listed terminals.
231
232Expected: Codex stops all background terminals for the current session. `/clean`
233is still available as an alias for `/stop`.
234
190### Keep transcripts lean with `/compact`235### Keep transcripts lean with `/compact`
191 236
1921. After a long exchange, type `/compact`.2371. After a long exchange, type `/compact`.
217Expected: Codex starts a fresh conversation in the same CLI session, so you262Expected: Codex starts a fresh conversation in the same CLI session, so you
218can switch tasks without leaving your terminal.263can switch tasks without leaving your terminal.
219 264
220265Unlike `/clear`, `/new` does not clear the current terminal view first.Unlike `/clear`, `/new` doesn't clear the current terminal view first.
221 266
222### Resume a saved conversation with `/resume`267### Resume a saved conversation with `/resume`
223 268
238If you need to fork a saved session instead of the current one, run283If you need to fork a saved session instead of the current one, run
239`codex fork` in your terminal to open the session picker.284`codex fork` in your terminal to open the session picker.
240 285
286### Start a side conversation with `/side`
287
288Use `/side` to start an ephemeral fork from the current conversation without switching away from the main task.
289
2901. Type `/side` to open a side conversation.
2912. Optionally add inline text, for example `/side Check whether this plan has an obvious risk`.
2923. Return to the parent thread after the focused detour finishes.
293
294Expected: 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.
295
296`/side` is unavailable inside another side conversation and during review mode.
297
241### Generate `AGENTS.md` with `/init`298### Generate `AGENTS.md` with `/init`
242 299
2431. Run `/init` in the directory where you want Codex to look for persistent instructions.3001. Run `/init` in the directory where you want Codex to look for persistent instructions.
262 319
263Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.320Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.
264 321
322Use `/mcp verbose` to include detailed server diagnostics. If you pass anything other than `verbose`, Codex shows the command usage.
323
265### Browse apps with `/apps`324### Browse apps with `/apps`
266 325
2671. Type `/apps`.3261. Type `/apps`.
270Expected: Codex inserts the app mention into the composer as `$app-slug`, so329Expected: Codex inserts the app mention into the composer as `$app-slug`, so
271you can immediately ask Codex to use it.330you can immediately ask Codex to use it.
272 331
332### Browse plugins with `/plugins`
333
3341. Type `/plugins`.
3352. Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.
336
337Expected: Codex opens the plugin browser so you can review installed plugins,
338discoverable plugins that your configuration allows, and installed plugin state.
339Press <kbd>Space</kbd> on an installed plugin to toggle its enabled state.
340
273### Switch agent threads with `/agent`341### Switch agent threads with `/agent`
274 342
2751. Type `/agent` and press Enter.3431. Type `/agent` and press Enter.