Slash commands give you fast, keyboard-first control over Codex. Type / in
the composer to open the slash popup, choose a command, and Codex will perform
actions such as switching models, adjusting permissions, or summarizing long
chats without leaving the terminal.
This guide shows you how to:
- Find the right built-in slash command for a task
- Steer an active session with commands like
/model,/fast,/personality,/permissions,/approve,/raw,/agent, and/status
Built-in slash commands
Codex ships with the following commands. Open the slash popup and start typing the command name to filter the list.
When a chat is already running, you can type a slash command and press Tab to
queue it for the next turn. Codex parses queued slash commands when they run, so
command menus and errors appear after the current turn finishes. Slash
completion still works before you queue the command.
| Command | Purpose | When to use it |
|---|---|---|
/permissions | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |
/ide | Include open files, current selection, and other IDE context. | Pull editor context into the next prompt without re-explaining what’s open in your IDE. |
/keymap | Remap TUI keyboard shortcuts. | Inspect and persist custom shortcut bindings in config.toml. |
/vim | Toggle Vim mode for the composer. | Switch between Vim normal/insert behavior and the default composer editing mode. |
/setup-default-sandbox | Set up the elevated agent sandbox (Windows only). | Replace the degraded Windows sandbox after Codex offers the elevated setup. |
/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. |
/agent, /subagents | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |
/apps | Browse apps (connectors) and insert them into your prompt. | Attach an app as $app-slug before asking Codex to use it. |
/plugins | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
/hooks | View and manage lifecycle hooks. | Inspect configured hooks, trust new or changed hooks, or disable non-managed hooks before they run. |
/clear | Clear the terminal and start a fresh chat. | Reset the visible UI and chat context together when you want a fresh start. |
/rename | Rename the current chat. | Give a saved session a recognizable name without leaving the TUI. |
/archive | Archive the current session and exit Codex. | Remove the current session from active session lists without deleting its transcript. |
/delete | Permanently delete the current session and exit Codex. | Remove the transcript and descendant sessions when archiving isn’t enough. |
/compact | Summarize the visible chat to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |
/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. |
/diff | Show the Git diff, including files Git isn’t tracking yet. | Review Codex’s edits before you commit or run tests. |
/exit | Exit the CLI (same as /quit). | Alternative spelling; both commands exit the session. |
/experimental | Toggle experimental features. | Enable options such as Network proxy or Prevent sleep while running. |
/approve | Approve one retry of a recent auto review denial. | Retry a command or action that the auto reviewer denied. |
/memories | Configure memory use and generation. | Turn memory injection or memory generation on or off without leaving the TUI. |
/skills | Browse and use skills. | Improve task-specific behavior by selecting a relevant local skill. |
/import | Import Claude Code or Cursor setup, projects, and recent chats. | Migrate supported external-agent artifacts into Codex configuration and local files. |
/feedback | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |
/init | Generate an AGENTS.md scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you’re working in. |
/logout | Sign out of Codex. | Clear local credentials when using a shared machine. |
/mcp | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session; add verbose for server details. |
/mention | Attach a file to the chat. | Point Codex at specific files or folders you want it to inspect next. |
/model | Choose the active model (and reasoning effort, when available). | Switch between models such as gpt-5.6-luna and gpt-5.6-terra before running a task. |
/fast | Toggle a Fast service tier when the model catalog exposes one. | Turn the current model’s Fast tier on or off and persist the selection. |
/plan | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |
/goal | Set, edit, pause, resume, view, or clear a task goal. | Give Codex a persistent target to track while a larger task runs. |
/personality | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |
/ps | Show background terminals and their recent output. | Check long-running commands without leaving the main transcript. |
/stop | Stop all background terminals. | Cancel background terminal work started by the current session. |
/fork | Fork the current chat into a new chat. | Branch the active session to explore a new approach without losing the current transcript. |
/app | Continue the current session in the ChatGPT desktop app. | Move from the TUI to the desktop app on macOS or Windows. |
/side, /btw | Start an ephemeral side chat. | Ask a focused follow-up without disrupting the main chat’s transcript. |
/raw | Toggle raw scrollback mode. | Make terminal selection and copying less formatted while reviewing long output. |
/resume | Resume a saved chat from your session list. | Continue work from a previous CLI session without starting over. |
/new | Start a new chat inside the same CLI session. | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo. |
/quit | Exit the CLI. | Leave the session immediately. |
/review | Ask Codex to review your working tree. | Run after Codex completes work or when you want a second set of eyes on local changes. |
/status | Display session configuration and token usage. | Confirm the active model, approval policy, writable roots, and remaining context capacity. |
/usage | View account token usage or use a rate-limit reset. | Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI. |
/debug-config | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |
/statusline | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |
/title | Configure terminal window or tab title fields interactively. | Pick and reorder title items such as project, status, thread, branch, model, and task progress. |
/theme | Choose a syntax-highlighting theme. | Preview and persist a terminal syntax-highlighting theme. |
/pets, /pet | Choose or hide a terminal pet. | Personalize the TUI with a built-in or custom ambient pet. |
/quit and /exit both exit the CLI. Use them only after you have saved or
committed any important work.
Use /permissions to adjust what Codex can do without asking first. Use
/approve only when you need to retry a recent action that automatic review
denied.
Control your session with slash commands
The following workflows keep your session on track without restarting Codex.
Set the active model with /model
- Start Codex and open the composer.
- Type
/modeland press Enter. - Choose a model such as
gpt-5.6-lunaorgpt-5.6-terrafrom the popup.
Expected: Codex confirms the new model in the transcript. Run /status to verify the change.
Toggle Fast mode with /fast
- Type
/fastto turn the current model’s Fast service tier on. - Type
/fastagain to turn it off.
Expected: Codex toggles the tier and saves the selection. In the TUI footer,
you can also show a Fast mode status-line item with /statusline.
Fast tier commands are catalog-driven. If the current model doesn’t advertise a
Fast tier, Codex won’t show /fast.
Set a communication style with /personality
Use /personality to change how Codex communicates without rewriting your prompt.
- In an active chat, type
/personalityand press Enter. - Choose a style from the popup.
Expected: Codex confirms the new style in the transcript and uses it for later responses in the chat.
Codex supports friendly, pragmatic, and none personalities. Use none
to disable personality instructions.
If the active model doesn’t support personality-specific instructions, Codex hides this command.
Switch to plan mode with /plan
- Type
/planand press Enter to switch the active chat into plan mode. - Optional: provide inline prompt text (for example,
/plan Propose a migration plan for this service). - You can paste content or attach images while using inline
/planarguments.
Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.
While Codex is already working, /plan is temporarily unavailable.
Set or view a task goal with /goal
- Type
/goal <objective>to set the goal, for example/goal Finish the migration and keep tests green. - Type
/goalto view the current goal. - Use
/goal editto revise the objective. Use/goal pause,/goal resume, or/goal clearto pause, resume, or remove it.
Expected: Codex keeps the goal attached to the active chat while work continues.
Goal objectives must be non-empty and at most 4,000 characters. For longer instructions, put the details in a file and point the goal at that file.
Toggle experimental features with /experimental
- Type
/experimentaland press Enter. - Toggle the features you want (for example, Network proxy or Prevent sleep while running), then restart Codex if the prompt asks you to.
Expected: Codex saves your feature choices to config and applies them on restart.
Approve an auto review denial with /approve
Use /approve when the automatic reviewer denied a recent action and you want
Codex to retry it once.
- Type
/approve. - Confirm the retry when Codex shows the relevant denied action.
Expected: Codex retries that denied action once under the current session policy.
Configure memories with /memories
- Type
/memories. - Choose whether Codex should use existing memories, generate new memories, or keep memory behavior disabled.
Expected: Codex updates the relevant memory settings for future sessions.
Use skills with /skills
- Type
/skills. - Pick the skill you want Codex to apply.
Expected: Codex inserts the selected skill context so the next request follows that skill’s instructions.
Import Claude Code or Cursor configuration with /import
- Type
/import. - Choose Claude Code or Cursor.
- Select the setup, project files, or recent chats you want to migrate.
Expected: Codex opens the external-agent import picker and imports the selected supported artifacts into Codex configuration and local files. Session discovery includes up to 50 chats from the last 30 days.
Run /import from a local TUI session. It’s unavailable while a task is running,
in remote sessions, and while connected to the local app-server daemon.
For the desktop app workflow and supported artifact types, see Import from another agent.
Clear the terminal and start a new chat with /clear
- Type
/clearand press Enter.
Expected: Codex clears the terminal, resets the visible transcript, and starts a fresh chat in the same CLI session.
To name the new chat as you create it, run /clear release prep.
Unlike Ctrl+L, /clear starts a new chat.
Ctrl+L only clears the terminal view and keeps the current chat. Codex disables both actions while a task is in progress.
Archive the current session with /archive
- Type
/archiveand press Enter. - Confirm that you want to archive the current session and exit Codex.
Expected: Codex archives the current session and closes the interactive TUI.
Codex keeps the session transcript stored locally; restore it later with
codex unarchive <SESSION>.
/archive is unavailable while a task is running.
Delete the current session with /delete
- Type
/deleteand press Enter. - Confirm that you want to delete the current session and exit Codex.
Expected: Codex deletes the current session transcript and closes the interactive TUI. Deletion is permanent and also removes spawned descendant sessions.
/delete is unavailable while a chat is running or in a side chat.
Update permissions with /permissions
- Type
/permissionsand press Enter. - Select the approval preset that matches your comfort level, for example
Autofor hands-off runs orRead Onlyto review edits. When named permission profiles are active, the picker also shows configured custom profiles and their descriptions.
Expected: Codex announces the updated policy. Future actions respect the updated approval mode until you change it again.
Include IDE context with /ide
- Type
/ide. - Add optional inline text if you want to explain what Codex should do with the current IDE selection or open files.
Expected: Codex includes available IDE context in the next prompt.
Toggle Vim mode with /vim
- Type
/vim. - Continue editing in the composer.
Expected: Codex toggles composer Vim mode for the current session. To make Vim
mode the default for new sessions, set tui.vim_mode_default = true in
config.toml.
Set up the elevated Windows sandbox with /setup-default-sandbox
This command appears only on Windows when Codex is using the degraded restricted-token sandbox.
- Type
/setup-default-sandbox. - Follow the administrator setup flow.
Expected: Codex configures the elevated Windows sandbox and selects the corresponding automatic approval preset.
Copy the latest response with /copy
- Type
/copyand press Enter.
Expected: Codex copies the latest completed Codex output to your clipboard.
If a turn is still running, /copy uses the latest completed output instead of
the in-progress response. The command is unavailable before the first completed
Codex output and immediately after a rollback.
You can also press Ctrl+O from the main TUI to copy the latest completed response without opening the slash command menu.
Toggle raw scrollback with /raw
- Type
/raw,/raw on, or/raw off.
Expected: Codex toggles raw scrollback mode, which makes terminal selection and
copying more direct. You can also use the default Alt+R
binding or persist the default with tui.raw_output_mode = true.
Grant sandbox read access with /sandbox-add-read-dir
This command is available only when running the CLI natively on Windows.
- Type
/sandbox-add-read-dir C:\absolute\directory\pathand press Enter. - Confirm the path is an existing absolute directory.
Expected: Codex refreshes the Windows sandbox policy and grants read access to that directory for later commands that run in the sandbox.
Inspect the session with /status
- In any chat, type
/status. - Review the output for the active model, approval policy, writable roots, and current token usage. When the TUI connects remotely, the output also shows the remote address and the server version.
Expected: Codex prints a summary confirming that it’s operating where you expect.
View account usage with /usage
- Type
/usageto open the usage menu. - Choose whether to show token activity or redeem an available earned reset.
- To open token activity directly, type
/usage daily,/usage weekly, or/usage cumulative.
Expected: Codex opens usage actions or shows account token activity for the selected view. If the session doesn’t have Codex service account auth, Codex shows a sign-in requirement.
Inspect config layers with /debug-config
- Type
/debug-config. - Review the output for config layer order (lowest precedence first), on/off state, and policy sources.
Expected: Codex prints layer diagnostics plus policy details such as
allowed_approval_policies, allowed_sandbox_modes, mcp_servers, rules,
enforce_residency, and experimental_network when configured.
Use this output to debug why an effective setting differs from config.toml.
Configure footer items with /statusline
- Type
/statusline. - Use the picker to toggle and reorder items, then confirm.
Expected: The footer status line updates immediately and persists to
tui.status_line in config.toml.
Available status-line items include model, model+reasoning, context stats, rate limits, git branch, token counters, session id, current directory/project root, and Codex version.
Configure terminal title items with /title
- Type
/title. - Use the picker to toggle and reorder items, then confirm.
Expected: The terminal window or tab title updates immediately and persists to
tui.terminal_title in config.toml.
Available title items include app name, project, spinner, status, thread, git branch, model, and task progress.
Choose a syntax theme with /theme
- Type
/theme. - Preview a theme from the picker, then confirm.
Expected: Codex updates syntax highlighting and persists the choice to
tui.theme in config.toml.
Choose a terminal pet with /pets
- Type
/pets(or/pet) to open the pet picker. - Choose a built-in or custom pet, or turn pets off.
Expected: Codex displays the selected ambient pet in supported terminals and
persists the selection. You can also type /pets off to hide it.
Remap TUI shortcuts with /keymap
Use /keymap to inspect, update, and persist keyboard shortcut bindings for the TUI.
- Type
/keymap. - Pick the shortcut context and action you want to change.
- Enter the new binding or remove the existing one.
Expected: Codex updates the active keymap and writes the custom binding to tui.keymap in config.toml.
Key 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.
Check background terminals with /ps
- Type
/ps. - Review the list of background terminals and their status.
Expected: Codex shows each background terminal’s command plus up to three recent, non-empty output lines so you can gauge progress at a glance.
Background terminals appear when unified_exec is in use; otherwise, the list may be empty.
Stop background terminals with /stop
- Type
/stop. - Confirm if Codex asks before stopping the listed terminals.
Expected: Codex stops all background terminals for the current session. /clean
is still available as an alias for /stop.
Keep transcripts lean with /compact
- After a long exchange, type
/compact. - Confirm when Codex offers to summarize the chat so far.
Expected: Codex replaces earlier turns with a concise summary, freeing context while keeping critical details.
Review changes with /diff
- Type
/diffto inspect the Git diff. - Scroll through the output inside the CLI to review edits and added files.
Expected: Codex shows changes you’ve staged, changes you haven’t staged yet, and files Git hasn’t started tracking, so you can decide what to keep.
Highlight files with /mention
- Type
/mentionfollowed by a path, for example/mention src/lib/api.ts. - Select the matching result from the popup.
Expected: Codex adds the file to the chat, ensuring follow-up turns reference it directly.
Start a new chat with /new
- Type
/newand press Enter.
Expected: Codex starts a fresh chat in the same CLI session, so you can switch chats without leaving your terminal.
To name the new chat as you create it, run /new bug bash.
Unlike /clear, /new doesn’t clear the current terminal view first.
Rename the current chat with /rename
- Type
/rename <name>, or type/renameto open the naming prompt. - Enter a short name that will help you find the chat later.
Expected: Codex updates the saved chat name without changing its transcript.
Resume a saved chat with /resume
- Type
/resumeand press Enter. - Choose the session you want from the saved-session picker.
Expected: Codex reloads the selected chat’s transcript so you can pick up where you left off, keeping the original history intact.
Fork the current chat with /fork
- Type
/forkand press Enter.
Expected: Codex clones the current chat into a new chat with a fresh ID, leaving the original transcript untouched so you can explore an alternative approach in parallel.
If you need to fork a saved session instead of the current one, run
codex fork in your terminal to open the session picker.
Continue in the desktop app with /app
On macOS and Windows, type /app to open the current session in the ChatGPT
desktop app. If the app isn’t installed or running, Codex shows an error asking
you to install or launch it.
Expected: The desktop app opens the same saved chat so you can continue there.
Start a side chat with /side
Use /side to start an ephemeral fork from the current chat without switching away from the main chat.
- Type
/sideto open a side chat. - Optionally add inline text, for example
/side Check whether this plan has an obvious risk. - Return to the parent chat after the focused detour finishes.
Expected: Codex opens a side chat whose transcript is separate from the parent chat. While you are in side mode, the TUI continues to show the parent chat’s status so you can see whether the main chat is still running.
/side is unavailable inside another side chat and during review mode.
Generate AGENTS.md with /init
- Run
/initin the directory where you want Codex to look for persistent instructions. - Review the generated
AGENTS.md, then edit it to match your repository conventions.
Expected: Codex creates an AGENTS.md scaffold you can refine and commit for
future sessions.
Ask for a working tree review with /review
- Type
/review. - Follow up with
/diffif you want to inspect the exact file changes.
Expected: Codex summarizes issues it finds in your working tree, focusing on
behavior changes and missing tests. It uses the current session model unless
you set review_model in config.toml.
List MCP tools with /mcp
- Type
/mcp. - Review the list to confirm which MCP servers and tools are available.
Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.
Use /mcp verbose to include detailed server diagnostics. If you pass anything other than verbose, Codex shows the command usage.
Browse apps with /apps
- Type
/apps. - Pick an app from the list.
Expected: Codex inserts the app mention into the composer as $app-slug, so
you can immediately ask Codex to use it.
Browse plugins with /plugins
- Type
/plugins. - Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.
Expected: Codex opens the plugin browser so you can review installed plugins, discoverable plugins that your configuration allows, and installed plugin state. Press Space on an installed plugin to toggle its enabled state.
View and manage lifecycle hooks with /hooks
- Type
/hooks. - Choose a hook event to inspect the matching handlers.
- Trust, disable, or re-enable non-managed hooks as needed.
Expected: Codex opens the hook browser so you can review configured lifecycle hooks. Managed hooks appear as managed and can’t be disabled from the user hook browser.
Switch agent threads with /agent
- Type
/agentor/subagentsand press Enter. - Select the thread you want from the picker.
Expected: Codex switches the active thread so you can inspect or continue that agent’s work.
Send feedback with /feedback
- Type
/feedbackand press Enter. - Follow the prompts to include logs or diagnostics.
Expected: Codex collects the requested diagnostics and submits them to the maintainers.
Sign out with /logout
- Type
/logoutand press Enter.
Expected: Codex clears local credentials for the current user session.
Exit the CLI with /quit or /exit
- Type
/quit(or/exit) and press Enter.
Expected: Codex exits immediately. Save or commit any important work first.