explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

custom AI agents

[email protected]

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource librarydemofor LLMs

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

More from us

InfloqInfluencer marketingBgBlurPrivacy-first blurOlly SocialSocial AI copilotCeptoryVideo intelligenceBgRemoverBackground removal

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportprivacytermsdata rightssubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

On this page

  • How slash commands fit a typical workflow
  • Queuing commands during active tasks
  • Setup, permissions, and project memory
  • Model, speed, and communication style
  • Planning, goals, and review mode
  • Session, context, and conversation control
  • Parallel agents and background terminals
  • Review, diff, and shipping
  • Skills, MCP, apps, plugins, and hooks
  • IDE, editor, and TUI customization
  • Diagnostics and feedback
  • Complete command reference table
  • Codex vs Claude Code: shared command patterns
  • Commands worth memorizing first
  • Related explainx.ai guides
  • Summary
← Back to blog

explainx / blog

Codex Slash Commands: Complete CLI Reference (2026)

Every OpenAI Codex slash command—/model, /goal, /plan, /permissions, /compact, and 40+ more. Workflow guide plus full reference from official docs.

Jun 11, 2026·15 min read·Yash Thakker
OpenAI CodexSlash CommandsAI CodingDeveloper ToolsCodex CLI
go deep
Codex Slash Commands: Complete CLI Reference (2026)

OpenAI Codex is OpenAI's agentic CLI for reading, editing, and running code in your repo—available in the terminal, desktop app, and cloud. Beyond natural-language prompts, it exposes 40+ built-in slash commands that switch models, adjust permissions, attach IDE context, spawn subagent threads, compact long conversations, and review your working tree without leaving the TUI.

This article is a complete slash-command reference, organized from the official Slash commands documentation. It is not a replacement for upstream docs: command availability, experimental flags, and catalog-driven features like /fast change with each release. Use this as a map of the surface area and a workflow guide; verify behavior against developers.openai.com/codex before you ship team runbooks.

For the Anthropic and Google equivalents, see Claude Code commands and Gemini CLI slash commands. For open-source multi-provider TUI, see OpenCode slash commands. For editor-parity terminal agent, see Cursor CLI slash commands.

TL;DR

QuestionAnswer
How do I see all commands?Type / in the Codex composer; filter by typing more letters.
Task already running?Type a slash command and press Tab to queue it for the next turn.
First session in a repo?/init → /permissions → /mcp → /skills → /hooks.
Long conversation?/status for token usage; /compact to summarize and free context.
Parallel exploration?/fork for a new thread; /side for ephemeral detours; /agent to switch subagents.
Before merge?/diff → /review.
Project memory file?AGENTS.md via /init (Codex) vs CLAUDE.md (Claude Code) vs GEMINI.md (Gemini CLI).
Sister guides?Claude Code · Gemini CLI · OpenCode · Cursor CLI
Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.


How slash commands fit a typical workflow

OpenAI groups slash commands around session control—steering an active run without restarting Codex. The lifecycle below is the fastest way to learn the table.

mermaid
flowchart LR
  A[Setup /init /permissions /mcp] --> B[Work /model /plan /goal]
  B --> C[Context /ide /mention /skills]
  C --> D[Parallel /agent /fork /side]
  D --> E[Ship /diff /review]
  E --> F[Sessions /new /clear /resume /archive]

First session in a repo

StepCommandWhat it does
1/initGenerate an AGENTS.md scaffold for persistent instructions
2/permissionsSet approval preset (Auto, Read Only, or custom profiles)
3/mcpList configured MCP tools; add verbose for server diagnostics
4/skillsBrowse and attach local skills for task-specific behavior
5/hooksReview lifecycle hooks; trust, disable, or inspect managed hooks

During a task

CommandPurpose
/modelChoose active model and reasoning effort when available
/fast [on|off|status]Toggle Fast service tier (catalog-driven; hidden if model has no Fast tier)
/personalityCommunication style: friendly, pragmatic, or none
/plan [prompt]Enter plan mode; optional inline prompt as first planning request
/goal <objective>Set persistent task target; pause, resume, or clear with subcommands
/compactSummarize conversation to free tokens
/statusActive model, approval policy, writable roots, token usage
/side or /btwEphemeral side conversation without disrupting main thread

Context and attachments

CommandPurpose
/ide [text]Include open files, selection, and IDE context in next prompt
/mention <path>Attach a specific file or folder to the conversation
/appsBrowse connectors; insert as $app-slug in composer
/memoriesToggle memory injection and generation

Parallel work and subagents

CommandPurpose
/agentSwitch active subagent thread
/forkClone conversation into new thread; original untouched
/sideEphemeral fork; parent thread status stays visible
/psList background terminals and recent output
/stopStop all background terminals (alias: /clean)
/experimentalToggle subagents, Apps, Smart Approvals, etc.

See our goal mode guide for /goal patterns across Codex, Claude Code, and Hermes Agent.

Before you ship

CommandPurpose
/diffGit diff including untracked files
/reviewWorking-tree review; uses review_model from config if set
/approveRetry once after auto reviewer denied an action

Between sessions

CommandPurpose
/newFresh conversation in same CLI session (terminal not cleared)
/clearClear terminal and start fresh chat (unlike Ctrl+L)
/resumeContinue from saved session picker
/archiveArchive current session and exit; restore with codex unarchive <SESSION>
/fork (terminal)Run codex fork to fork a saved session from picker
/quit or /exitExit immediately

Queuing commands during active tasks

When Codex is already working on a turn, slash commands behave differently than at idle:

  1. Type the command and press Tab to queue it for the next turn.
  2. Codex parses queued slash commands when they execute—menus and errors appear after the current turn finishes.
  3. Slash completion still works before you queue the command.

Some commands are unavailable while a task runs: /plan, /archive, /copy (uses last completed output), and /side (also unavailable in review mode).


Setup, permissions, and project memory

CommandPurpose
/initGenerate AGENTS.md scaffold in current directory
/permissionsSet approval preset mid-session (Auto, Read Only, custom profiles)
/approveOne-time retry of a recent auto-review denial
/experimentalToggle optional features; may require restart
/memoriesConfigure memory use and generation for future sessions
/sandbox-add-read-dir <path>Grant sandbox read access to absolute directory (Windows only)
/logoutClear local credentials on shared machines

/permissions vs /approve: /permissions changes the ongoing policy for what Codex can do without asking. /approve is a one-shot retry when the automatic reviewer denied a specific recent action.

Project memory: Codex uses AGENTS.md (via /init). Claude Code uses CLAUDE.md. Both solve the same problem—persistent repo instructions—under different filenames. See What is CLAUDE.md? for the Anthropic pattern and What is MEMORY.md? for the broader agent-memory hierarchy.


Model, speed, and communication style

CommandPurpose
/modelChoose model (e.g. gpt-4.1-mini, gpt-4.1) and reasoning effort when available
/fast [on|off|status]Toggle Fast service tier for current model/thread
/personalitySet friendly, pragmatic, or none communication style
/statusConfirm model, approval policy, writable roots, token usage, remote info
/debug-configPrint config layer order, policy sources, MCP servers, rules

/fast is catalog-driven. If the active model does not advertise a Fast tier, Codex will not expose /fast. Persist Fast settings when Codex offers to save them. Show Fast status in the footer via /statusline.

/personality is model-gated. If the active model does not support personality-specific instructions, Codex hides the command. Use none to disable personality instructions.


Planning, goals, and review mode

CommandPurpose
/plan [prompt]Switch to plan mode; optional inline prompt (supports pasted content and images)
/goal <objective>Set task goal (non-empty, max 4,000 chars)
/goalView current goal
/goal pausePause goal tracking
/goal resumeResume paused goal
/goal clearRemove goal
/reviewReview working tree for behavior changes and missing tests

Goal length: Objectives must be non-empty and at most 4,000 characters. For longer instructions, put details in a file and point the goal at that file.

Plan mode: While a task is running, /plan is temporarily unavailable. For longer autonomous runs, pair /goal with verification loops—see loop engineering for cross-platform guardrails.

Review model: /review uses the current session model unless you set review_model in config.toml.


Session, context, and conversation control

CommandPurpose
/newFresh conversation; terminal view preserved
/clearClear terminal and reset transcript (new chat)
/compactSummarize earlier turns to free context
/resumeReload saved session from picker
/archiveArchive session and exit TUI
/forkClone current conversation to new thread ID
/side, /btwEphemeral side conversation; parent status stays visible
/copyCopy latest completed output (also Ctrl+O)
/raw [on|off]Toggle raw scrollback for easier terminal selection (also Alt+R)
/quit, /exitExit CLI immediately

/clear vs Ctrl+L: Ctrl+L clears the terminal view but keeps the current chat. /clear resets both the visible UI and the conversation. Codex disables both while a task is in progress.

/fork vs /side: /fork creates a durable parallel thread you can switch to via /agent or session management. /side is a temporary detour—you return to the parent thread when done. /side cannot nest inside another side conversation.

Archive restore: After /archive, run codex unarchive <SESSION> to restore. To fork a saved session (not the current one), use codex fork in the terminal.


Parallel agents and background terminals

CommandPurpose
/agentSwitch active agent/subagent thread
/experimentalEnable subagents and related experimental features
/psList background terminals with status and up to 3 recent output lines
/stopStop all background terminals for current session (alias: /clean)

Background terminals appear when unified_exec is in use; otherwise /ps may return an empty list. Enable subagents via /experimental if the feature picker includes them—restart when prompted.

For multi-agent orchestration patterns, see Claude Code dynamic workflows and OpenAI Codex plugins.


Review, diff, and shipping

CommandPurpose
/diffGit diff: staged, unstaged, and untracked files
/reviewCodex summarizes issues in working tree
/approveRetry a denied action once under current policy

Typical pre-commit flow:

bash
/review
/diff

Codex focuses on behavior changes and missing tests. Follow /review with /diff when you need line-level inspection inside the CLI.


Skills, MCP, apps, plugins, and hooks

CommandPurpose
/skillsBrowse and select local skills for next request
/mcpList MCP tools Codex can call
/mcp verboseInclude detailed server diagnostics
/appsBrowse connectors; insert $app-slug mention
/pluginsBrowse installed and discoverable plugins; Space toggles enabled state
/hooksInspect lifecycle hooks; trust, disable, or review managed hooks

MCP: Use /mcp to confirm which external tools are available. Pass only verbose as an argument—anything else shows usage help.

Plugins vs apps: /plugins manages Codex plugin packages (tools, skills, MCP configs). /apps inserts connector mentions into the composer for immediate use.

For MCP fundamentals, see What is MCP?. For Codex plugin architecture, see OpenAI Codex plugins repository.


IDE, editor, and TUI customization

CommandPurpose
/ide [text]Pull IDE context (open files, selection) into next prompt
/mention <path>Attach file or folder via popup picker
/vimToggle Vim mode for composer
/keymapInspect and persist TUI shortcut bindings to config.toml
/statuslineConfigure footer items (model, context, git, tokens, session, etc.)
/titleConfigure terminal window/tab title fields
/themeChoose and persist syntax-highlighting theme
/rawToggle raw scrollback mode

Persist defaults in config.toml:

SettingConfig key
Vim mode defaulttui.vim_mode_default = true
Raw output defaulttui.raw_output_mode = true
Status line itemstui.status_line
Terminal title itemstui.terminal_title
Themetui.theme
Key bindingstui.keymap (context-specific overrides tui.keymap.global)

Status-line items include model, model+reasoning, context stats, rate limits, git branch, token counters, session id, current directory, and Codex version.

Title items include app name, project, spinner, status, thread, git branch, model, and task progress.

Keymap bindings use names like ctrl-a, shift-enter, and page-down. Empty binding list unbinds an action.


Diagnostics and feedback

CommandPurpose
/statusSession summary: model, policy, writable roots, tokens, remote address
/debug-configConfig layer precedence, approval policies, sandbox modes, MCP, rules
/feedbackSubmit logs and diagnostics to Codex maintainers

Use /debug-config when an effective setting differs from what you expect in config.toml. Output includes allowed_approval_policies, allowed_sandbox_modes, mcp_servers, rules, enforce_residency, and experimental_network when configured.


Complete command reference table

Every built-in slash command from the official Slash commands page as of June 2026.

CommandPurposeWhen to use it
/permissionsSet approval policy without asking firstSwitch Auto ↔ Read Only mid-session
/ide [text]Include IDE context in next promptOpen files/selection without re-explaining
/keymapRemap TUI keyboard shortcutsPersist custom bindings in config.toml
/vimToggle Vim mode for composerNormal/insert editing in composer
/sandbox-add-read-dir <path>Grant sandbox read to extra directoryWindows only; absolute existing path
/agentSwitch active agent threadContinue or inspect subagent work
/appsBrowse connectorsInsert $app-slug before asking Codex to use app
/pluginsBrowse installed/discoverable pluginsInspect tools; toggle enabled with Space
/hooksReview lifecycle hooksTrust, disable non-managed hooks
/clearClear terminal and start fresh chatReset UI + conversation (not just Ctrl+L)
/archiveArchive session and exitRemove from active list; transcript kept locally
/compactSummarize conversationFree tokens after long runs
/copyCopy latest completed outputAlso Ctrl+O; unavailable before first output
/diffShow Git diff incl. untrackedReview edits before commit
/exitExit CLISame as /quit
/experimentalToggle experimental featuresSubagents, Apps, Smart Approvals
/approveApprove one retry of denied actionAfter auto reviewer blocks a command
/memoriesConfigure memory injection/generationTurn memory on/off for future sessions
/skillsBrowse and use local skillsTask-specific behavior via skill context
/feedbackSend logs to maintainersReport issues with diagnostics
/initGenerate AGENTS.md scaffoldPersistent repo instructions
/logoutSign out of CodexShared machines
/mcp [verbose]List MCP toolsConfirm external tool availability
/mention <path>Attach file to conversationPoint Codex at specific paths
/modelChoose active model (+ reasoning)Switch before running a task
/fast [on|off|status]Toggle Fast service tierWhen model catalog exposes Fast
/plan [prompt]Enter plan modePropose execution plan before coding
/goal [subcommand]Set/view/pause/resume/clear goalPersistent target for larger tasks
/personalityChoose communication stylefriendly, pragmatic, or none
/psShow background terminalsCheck long-running commands
/stopStop all background terminalsAlias: /clean
/forkFork conversation to new threadExplore alternative without losing original
/side, /btwEphemeral side conversationFocused detour; parent keeps running
/raw [on|off]Toggle raw scrollbackEasier copy/select of long output
/resumeResume saved conversationContinue previous CLI session
/newNew conversation, same CLISwitch tasks without exiting terminal
/quitExit CLISame as /exit
/reviewReview working treeSecond pass on local changes
/statusSession config and token usageConfirm model, policy, capacity
/debug-configConfig layer diagnosticsDebug precedence and policy sources
/statuslineConfigure footer interactivelyPersist to tui.status_line
/titleConfigure terminal titlePersist to tui.terminal_title
/themeChoose syntax themePersist to tui.theme

Codex vs Claude Code: shared command patterns

Both agentic CLIs converged on a similar slash-command vocabulary in 2026. This table maps the most common equivalents:

TaskCodexClaude Code
Project memory/init → AGENTS.md/init → CLAUDE.md
Permissions/permissions/permissions
Plan before coding/plan/plan
Autonomous target/goal/goal
Free context/compact/compact
Switch model/model/model + /effort
Fast tier/fast/fast
Git diff/diff/diff
Working tree review/review/code-review, /review
MCP tools/mcp/mcp
Skills/skills/skills
Subagent threads/agent/agents, /tasks
Fork conversation/fork/branch, /fork
Side question/side, /btw/btw
Fresh chat/new, /clear/clear
Resume session/resume/resume
IDE context/ide/ide
Hooks/hooks/hooks
Status / usage/status/status, /usage, /context

Claude Code adds cloud orchestration (/batch, /background, /ultrareview), scheduled loops (/loop), and a larger settings surface. Codex adds /personality, /apps, /approve, /memories, and tighter TUI customization via /statusline and /title. Gemini CLI adds custom .toml slash commands, @ file injection, and ! shell passthrough.

Full references: Claude Code · Codex · Gemini CLI · OpenCode · Cursor CLI (five-way comparison in Cursor guide)


Commands worth memorizing first

Minimum viable slash stack for new Codex users:

bash
/init                          # AGENTS.md scaffold
/permissions                   # trust boundaries
/model                         # pick the right model
/plan Propose a migration plan # think before large edits
/goal tests pass               # persistent target
/compact                       # free context mid-session
/diff                          # inspect edits
/review                        # second pass before commit
/resume                        # pick up yesterday's thread

For Codex desktop features beyond the CLI—pets, skills reload, MCP—see Codex pets complete guide and Codex plugins repository.


Related explainx.ai guides

  • Claude Code commands reference — Anthropic CLI counterpart
  • Gemini CLI slash commands reference — Google CLI counterpart
  • OpenCode slash commands reference — open-source TUI counterpart
  • Cursor CLI slash commands reference — Cursor terminal counterpart
  • Goal mode complete guide — /goal across Codex, Claude Code, Hermes
  • Loop engineering — verification loops and guardrails
  • What is MCP? — /mcp and external tools
  • What are agent skills? — /skills authoring patterns
  • OpenAI Codex plugins — plugin architecture
  • Codex pets guide — desktop TUI extras
  • Claude Code vs Codex — platform comparison
  • AI coding plugins ecosystem — OpenAI vs Anthropic plugin stacks

Primary source: Slash commands — Codex Docs · Codex overview


Summary

Codex slash commands are the control plane for agentic coding in the terminal: they set trust (/permissions), project memory (/init → AGENTS.md), model and speed (/model, /fast), planning and goals (/plan, /goal), parallelism (/agent, /fork, /side), and quality gates (/diff, /review) without leaving the composer.

Type / to discover what your build exposes—availability varies by version, model catalog, and experimental flags. Treat the official Slash commands page as source of truth; bookmark this guide alongside Claude Code, Gemini CLI, OpenCode, and Cursor CLI command references.


Command names, aliases, and availability reflect OpenAI's documentation as of June 11, 2026. Re-check developers.openai.com/codex and the Codex changelog before documenting internal runbooks—OpenAI ships CLI updates frequently.

Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

Related posts

Jul 5, 2026

GPT-5.5 Codex's "516 Bug": Reasoning-Token Clustering Explained

Developers analyzing their own Codex session logs found GPT-5.5 responses clustering at exact reasoning-token counts — 516, 1034, 1552 — far more often than other models, and runs that hit those exact values are disproportionately wrong. OpenAI hasn't confirmed a cause yet.

Jun 11, 2026

Claude Code Commands: Complete Slash Command Reference (2026)

Claude Code exposes 90+ slash commands for setup, parallel agents, review, memory, and shipping. This is the complete reference: what each command does, when to use it, and how they fit a typical workflow.

Jun 11, 2026

Cursor CLI Slash Commands: Complete Reference (2026)

Cursor CLI exposes 25+ slash commands for Plan/Ask modes, models, sandbox, MCP, rules, and session control. This is the complete reference from official docs plus how commands fit a typical workflow.