Codex commands: every slash command explained

Here are 63 OpenAI Codex slash commands, grouped by category, each with a description, when to use it and an example. Based on the official Developer commands documentation. Codex commands work in three places — the Codex CLI in a terminal, the IDE extension and the Codex mode of the ChatGPT desktop app — and each supports a slightly different set; commands available only in some of them are marked. ChatGPT on the web has its own command menu, and these commands don’t work there.

Context

/compact /recap /side /mention /ide /ide-context /memories

/compact

Compacts the context by summarizing the earlier conversation, freeing up context space.

Use after long runs; Codex keeps the key information so the context window does not fill up.

/compact

/recap

Generates a summary of the current conversation without compacting the context.

Use to catch up quickly after stepping away; to free up context space, use /compact.

/recap

Available in: Terminal

/side [question]

Opens a temporary side conversation that does not interrupt or affect the main conversation.

Use to ask a related question without adding the exchange to the main conversation. In the CLI you can also use /btw.

/side why does this function need a lock?

Aliases: /btw

/mention <path>

Adds a file or folder to the conversation so later turns can reference it directly.

Use to have Codex focus on specific files next; type a path and pick from the popup list.

/mention src/lib/api.ts

Available in: Terminal

/ide [note]

Brings context such as open editor files and the current selection into the next prompt.

Use when running Codex in the terminal with an IDE open, so you do not have to explain which files are open.

/ide explain the selected code

Available in: Terminal

/ide-context

Toggles automatically attaching IDE context.

Turn it off if you do not want every message to include editor files and selections automatically.

/ide-context

Available in: Desktop, IDE

/memories

Sets whether existing memories are used and whether new memories are generated.

Available when memories are enabled for your account; the setting affects later sessions.

/memories

Models & permissions

/model /reasoning /fast /personality /plan /goal /permissions /approve /experimental

/model

Chooses the model to use (and its reasoning effort).

The list shows only models available to your account and workspace; after switching, confirm with /status.

/model

/reasoning

Chooses the reasoning effort for the current conversation.

Raise it for hard problems and lower it for simple tasks to go faster. In the CLI, choose it in /model.

/reasoning

Available in: Desktop, IDE

/fast

Toggles the Fast tier for the current model, and the choice is saved.

This command appears only when the model offers a Fast tier. Run it again to turn it off.

/fast

/personality

Chooses the style of Codex's responses.

Available when the current model supports multiple styles.

/personality

Available in: Desktop, IDE

/plan [prompt]

Switches to plan mode, optionally with a first planning request.

Have Codex produce an execution plan before changing code. Temporarily unavailable while Codex is working.

/plan design a database migration for this service

/goal [goal|edit|pause|resume|clear]

Sets, views, edits, pauses, resumes, or clears the task goal.

Gives a large task a goal that is tracked continuously; with no argument, shows the current goal. Goals are limited to 4000 characters; put longer instructions in a file and reference it.

/goal finish the migration and keep all tests passing

/permissions

Sets which actions Codex can perform without asking for approval.

Loosen or tighten approvals mid-session, for example switching between Auto and Read Only.

/permissions

Available in: Terminal

/approve

Approves one retry of the action most recently denied by auto-review.

Use when auto-review blocked a command you know is safe; retries once without changing permission settings.

/approve

/experimental

Toggles experimental features, such as the network proxy and preventing sleep while running.

After choosing, restart Codex when prompted for changes to take effect.

/experimental

Available in: Terminal

Review & changes

/review /diff /init

/review [note]

Has Codex review changes in the workspace and find problems.

Use after Codex finishes a piece of work, or when you want a second look at local changes; can also compare against a base branch.

/review

/diff

Shows Git changes, including new files not yet tracked by Git.

Check what Codex changed before committing or running tests.

/diff

Available in: Terminal

/init

Generates AGENTS.md in the current directory with standing instructions for Codex.

Run the first time you use Codex in a new project, then add coding conventions, test commands, and so on.

/init

Workspace & run location

/worktree /local /cloud /cloud-environment /project /cd /pwd

/worktree

Starts or continues a conversation in a new Git worktree.

Use to work in a separate checkout without affecting the current branch. Requires a local repository; unavailable while a task is running.

/worktree

/local

Runs the conversation in the local workspace.

Use to switch from the cloud back to running on your machine.

/local

Available in: Desktop, IDE

/cloud

Runs the conversation in the cloud.

Available when your account can use cloud execution; suited to long-running tasks you do not want tying up your machine.

/cloud

Available in: Desktop, IDE

/cloud-environment

Chooses the cloud environment for this conversation.

Use when you have multiple cloud environments configured (different repositories or dependencies).

/cloud-environment

Available in: Desktop, IDE

/project

Chooses the project a new conversation belongs to.

/project

Available in: Desktop, IDE

/cd [path]

Changes the session's working directory, or switches to the home directory when no path is given.

Requires the main session to be idle, with no queued input and no background terminals.

/cd ../another-repo

Available in: Terminal

/pwd

Shows the current session's working directory.

/pwd

Available in: Terminal · Aliases: /cwd

Session

/new /clear /rename /fork /resume /archive /delete /agents /subagents /copy /export /app /quit

/new [name]

Starts a new conversation, optionally with a name.

Use when switching to an unrelated task. In the CLI it does not clear the terminal first; to clear the screen too, use /clear.

/new fix login issue

Available in: Desktop, Terminal

/clear [name]

Clears the terminal and starts a new conversation.

Use to reset both the screen and the context. To clear only the screen and keep the current conversation, press Ctrl+L. Unavailable while a task is running.

/clear

Available in: Terminal

/rename [name]

Renames the current conversation.

Give the session a recognizable name so you can find it later with /resume.

/rename payment module refactor

Available in: Desktop, Terminal

/fork

Copies the current conversation into a new conversation.

Use to try a different approach without losing the current history.

/fork

/resume

Resumes a previously saved conversation from the session list.

Pick up where you left off in an earlier CLI session.

/resume

Available in: Terminal

/archive

Archives the current session, removing it from the session list while keeping its history.

Restore it later with codex unarchive. Any running turn is stopped first.

/archive

Available in: Desktop, Terminal

/delete

Permanently deletes the current session and any child sessions forked from it.

Use when archiving is not enough and you really want the history gone; this cannot be undone. Unavailable while the conversation is running or in a side conversation.

/delete

Available in: Terminal

/agents

Opens the agent command center to browse conversations and switch between agents.

/agents

Available in: Terminal

/subagents

Switches to one of the current session's subagent threads.

View or continue work a subagent is doing.

/subagents

Available in: Terminal

/copy

Copies Codex's most recent complete response.

You can also press Ctrl+O.

/copy

Available in: Terminal

/export [file name]

Exports the whole conversation as Markdown, copying it to the clipboard or saving it to a file.

Include a file name to save directly; wait for the current turn to finish before exporting.

/export session.md

Available in: Terminal

/app

Continues the current session in the ChatGPT desktop app.

Switches from the terminal to the desktop app; supports macOS and Windows.

/app

Available in: Terminal

/quit

Exits the Codex CLI.

Save or commit important changes before exiting.

/quit

Available in: Terminal · Aliases: /exit

Skills & extensions

/skills /mcp /apps /plugins /hooks /import /ps /stop

/skills

Browses and uses skills, so Codex completes specific tasks following a skill's instructions.

You can also invoke one by writing $skill-name in a prompt; skills enabled in the desktop app and IDE appear directly in the command list.

/skills

Available in: Terminal

/mcp [verbose|login <name>]

Shows configured MCP tools and their connection status.

Confirm which external tools Codex can call in this session; add verbose for server details.

/mcp verbose

/apps

Browses apps (connectors) and inserts them into the prompt.

Once selected, an app is inserted as $app-name so you can ask Codex to use it.

/apps

Available in: Terminal

/plugins

Browses installed and available plugins.

See the tools plugins provide, install recommended plugins, or manage plugins.

/plugins

Available in: Terminal

/hooks

Shows and manages lifecycle hooks.

Inspect configured hooks, trust new or changed hooks, or disable them before they run.

/hooks

Available in: Terminal

/import

Imports configuration, project files, and recent conversations from Claude Code or Cursor.

Run in a local TUI session; imports up to 50 chats from the last 30 days. Unavailable while a task is running or in a remote session.

/import

Available in: Terminal

/ps

Lists background terminals and their recent output.

Check on long-running commands without leaving the main conversation.

/ps

Available in: Terminal

/stop

Stops all background terminals in the current session.

/stop

Available in: Terminal · Aliases: /clean

Settings & diagnostics

/status /usage /statusline /title /theme /pet /tui /vim /keymap /raw /debug-config /daemon /warnings /setup-default-sandbox /feedback /logout

/status

Shows session configuration and usage: current model, approval policy, writable directories, remaining context, and more.

Confirm Codex is running the way you expect.

/status

/statusline

Sets which items the bottom status line shows and in what order.

Options include model, context, quota, Git branch, tokens, and more; saved to config.toml.

/statusline

Available in: Terminal

/title

Sets which information the terminal window or tab title shows.

/title

Available in: Terminal

/theme

Chooses a syntax highlighting theme, with a preview before saving.

/theme

Available in: Terminal

/pet [off]

Chooses or hides the pet in the interface.

/pet off

Available in: Desktop, Terminal · Aliases: /pets

/tui

Chooses the terminal mode for the next launch: scrollback or full screen.

Takes effect after restarting Codex.

/tui

Available in: Terminal

/vim

Toggles Vim mode for the input box.

To enable it by default, set tui.vim_mode_default = true in config.toml.

/vim

Available in: Terminal

/keymap

Shows and changes TUI keyboard shortcuts, saving them to config.toml.

/keymap

Available in: Terminal

/raw [on|off]

Toggles raw scrollback mode, making it easier to select and copy text in the terminal.

You can also press Alt+R.

/raw on

Available in: Terminal

/debug-config

Prints configuration layers and policy sources to troubleshoot why a setting is not taking effect.

/debug-config

Available in: Terminal

/daemon

Opens the management interface for the local background service.

Confirming an update exits Codex and may interrupt work in progress.

/daemon

Available in: Terminal

/warnings

Shows warnings and diagnostics retained during the session.

/warnings

Available in: Terminal

/setup-default-sandbox

Sets up the elevated agent sandbox on Windows.

Appears only on Windows when Codex is using a degraded sandbox; follow the prompts to complete the administrator setup.

/setup-default-sandbox

Available in: Terminal

/feedback

Sends feedback to the Codex team, optionally with logs.

/feedback

/logout

Signs out of Codex and clears local credentials.

Use when you are done on a shared computer.

/logout

Available in: Terminal