Skip to main content

What are Slash Commands?

Slash commands are special commands that start with / and give you control over Codex’s behavior. They’re used to modify settings, manage conversation state, trigger specific features, and control the agent’s workflow.
Slash commands are entered in the Codex prompt and are processed before being sent to the AI model.

Available Commands

Workflow Control

Triggers a specialized code review of your changes.
/review
What it does:
  • Spawns a sub-agent with specialized review instructions
  • Analyzes your code changes for bugs, security issues, and maintainability problems
  • Provides structured feedback with priority levels (P0-P3)
  • Outputs an overall correctness verdict
  • Exits automatically when review is complete
Features:
  • Uses dedicated review prompt and model
  • Can be configured with custom review model via review_model in config
  • Auto-approval enabled (no interruptions during review)
  • Web search and collaborative tools disabled for focused review
See Code Review for detailed usage.
Explicitly load a specific skill for the current task.
/use skill-name
Examples:
/use pdf-editor
/use skill-creator
/use bigquery-analytics
This ensures the skill is loaded into context even if it wouldn’t trigger automatically.
Lists available and installed ChatGPT app connectors.
/apps
Shows:
  • Connected apps (labeled as “connected”)
  • Available apps that can be installed
See Apps & Connectors for more details.

Session Management

Clears the current conversation history while keeping configuration.
/clear
Useful when you want to start fresh without restarting Codex.
Resets both conversation history and session state.
/reset
More thorough than /clear - resets all session state.

Configuration

Switch to a different AI model mid-conversation.
/model gpt-4o
/model o1-mini
/model claude-3-5-sonnet-20241022
Changes the model for the current session without restarting.
Change the approval policy for the current session.
/approval suggest
/approval auto-edit
/approval full-auto
Approval modes:
  • suggest - Agent asks for approval on all file writes and shell commands
  • auto-edit - Agent can write files but asks before running commands
  • full-auto - Agent can write files and run commands (sandboxed)
Adjust the sandbox policy for the current session.
/sandbox read-only
/sandbox workspace-write
/sandbox danger-full-access
See Security & Sandboxing for details on each mode.

Information

Display help information and available commands.
/help
Display current configuration and session state.
/status
Shows:
  • Current model
  • Approval mode
  • Sandbox mode
  • Active skills
  • Session information

Using Slash Commands

In the TUI

Slash commands are entered at the prompt:
> /review
> /use pdf-editor
> /model gpt-4o
Press Tab for autocomplete suggestions when typing slash commands.

In Scripts

You can pass slash commands in non-interactive mode:
codex exec "/review" --ephemeral

Command Aliases

Some commands have shorter aliases for convenience:
CommandAlias
/review/r
/clear/c
/help/h
/status/s

Advanced Usage

Combining Commands

You can chain multiple commands in a single session:
> /clear
> /model gpt-4o
> /approval full-auto
> "Now refactor the authentication module"

Commands in AGENTS.md

You can include default slash commands in your AGENTS.md project documentation:
# Project Configuration

Always use the following settings:
- Model: gpt-4o
- Approval: auto-edit
This sets project-specific defaults without requiring manual slash commands each time.

Creating Custom Commands

While Codex doesn’t currently support custom slash commands, you can achieve similar behavior using:
  1. Skills - Create a skill that triggers on specific phrases
  2. AGENTS.md - Add project-specific instructions
  3. Aliases - Use shell aliases to wrap common command patterns

Example: Custom Workflow Alias

# In your shell config (.bashrc, .zshrc, etc.)
alias codex-review='codex exec "/review"'
alias codex-fast='codex --model gpt-4o-mini --approval full-auto'
Then use:
codex-review
codex-fast "write unit tests"

Command Reference

Workflow

  • /review - Code review mode
  • /use - Load a skill
  • /apps - Manage app connectors

Session

  • /clear - Clear history
  • /reset - Full reset

Configuration

  • /model - Switch model
  • /approval - Change approval mode
  • /sandbox - Change sandbox mode

Information

  • /help - Show help
  • /status - Show status

Keyboard Shortcuts

While not slash commands, these keyboard shortcuts work in the TUI:
ShortcutAction
Ctrl+CCancel current operation (press twice to quit)
Ctrl+DExit Codex (press twice if needed)
TabAutocomplete slash commands
/ Navigate command history
Ctrl+LClear screen (not history)

Best Practices

Starting a new task? Use /clear to remove irrelevant context from the previous task. This helps Codex focus on what matters.
For exploratory tasks, use /approval suggest to review each action. For well-defined tasks in sandboxed environments, use /approval full-auto for speed.
If you know you need a specific skill, use /use skill-name at the start to ensure it’s loaded, rather than relying on automatic triggering.
If Codex behaves unexpectedly, use /status to verify your current configuration.

Next Steps

Code Review

Learn more about the /review command

Skills System

Understand how skills work with /use