Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Codex slash / commands

Codex slash / commands

The slash / in Codex is a shortcut command system (slash commands).

After we type the / symbol in the dialog box, the system immediately pops up a command panel listing all available commands and their descriptions.

To use MCP, Skills, the browser, etc., just type / and then select the corresponding feature.

To summon the pet, you can type /pet; in the English version, type /pet:

If using Chinese feels awkward, you can set the language to English:

Command categories

By function, they can be divided into four categories: context management, code and development workflow, model and reasoning control, and personalization and others.

Context management

A command group that controls conversation threads and the context window.

Command Function Description Applicable scenarios
/compact, /compress Compress the context Intelligently summarize the current conversation history, retain key information, and free up token space When a long conversation shows a "context full" warning
/status, /state View status Output key runtime parameters such as the current conversation ID, consumed context tokens, and remaining quota Before deciding whether to perform token-consuming operations

/compact does not lose key context; it intelligently preserves important code snippets and decision information, compressing only redundant conversation turns.

Code and development workflow

A core feature command group for developers.

Command Function Description Applicable scenarios
/review, /code-review Code review Have Claude systematically review the current file or specified code segments, checking for potential bugs, security issues, performance bottlenecks, and code style Before submitting a PR, after code refactoring
/side, /sidebar Side conversation Start an independent conversation in a temporary branch without affecting the main line; when done, you can merge, discard, or keep it When you want to quickly try an approach without polluting the main conversation history
/fork, /branch Forked branch Fork the conversation into a local Git branch or a brand-new worktree, supporting parallel exploration of different approaches When you need to compare approach A with approach B
/mcp MCP status List all MCP (Model Context Protocol) servers connected in the current conversation, and view their online status and available tool lists Troubleshoot connection status when external tools don't respond

The difference between /side and /fork: /side is a conversation-level branch, suitable for quick experiments; /fork creates a Git branch, suitable for code-level parallel development.

Model and reasoning control

A command group for adjusting AI capabilities and thinking depth.

Command Function Description Applicable scenarios
/reasoning, /reasoning-mode Reasoning effort Switch between low / medium / high reasoning intensity levels; the current level is shown in real time after the command Increase for complex algorithm problems; keep low-to-medium for daily Q&A
/model, /model-type Model switching Switch between different AI models; the current model name is shown after the command Choose a lightweight model for quickly generating boilerplate code, and a flagship model for deep architectural analysis

High-intensity reasoning responds more slowly but gives more accurate answers; low-intensity responds faster. When debugging complex bugs, it's recommended to switch to high reasoning mode.

Personalization and others

A command group for experience customization and auxiliary features.

Command Function Description Applicable scenarios
/persona, /personality Set persona Adjust Claude's reply tone and style, with presets such as "concise and direct," "detailed teaching," or "senior engineer" Unify output style during team collaboration
/feedback, /report-feedback Submit feedback Quickly open the feedback channel to report bugs, suggest features, or share your experience Give feedback immediately when you encounter output quality issues
/pet, /desktop-pet Desktop pet Toggle the display state of Claude Code's built-in desktop pet, a little easter egg feature Hide it when you need to focus, summon it when taking a break

Recommended workflows

Integrating slash commands into your daily development workflow can double your efficiency.

# 步骤1:开始新任务前,检查上下文余量

/status



# Step 2: When encountering complex problems, increase reasoning intensity

/reasoning   # 切换至"高"档



# Step 3: After completing code modifications, start the review

/review



# Step 4: Explore uncertain solutions, enable sidebar chat

/side



# Step 5: When context is almost full, compress history

/compact

Step Timing Recommended commands Purpose
1 Before starting a new task /status Check the remaining context and quota to decide whether to start a new conversation
2 When encountering complex problems /reasoning Increase reasoning intensity for deeper analysis
3 Before submitting a PR /review Catch edge cases and potential bugs that might be missed
4 Explore new approaches /side or /fork Experiment in a safe environment without affecting mainline progress
5 When context is nearly full /compact Compress conversation history while retaining key context

Quick reference

The following quick reference table summarizes brief information about all 11 built-in commands.

Command Function Quick notes
/compact Compress the context When tokens run low in a long conversation, intelligently summarize the history
/status View status Overview of conversation ID, token usage, and remaining quota
/review Code review AI automatically checks bugs, security, performance, and style
/side Side conversation Explore safely in a temporary branch without polluting the mainline
/fork Forked branch Create a Git branch or new worktree for parallel evolution
/mcp MCP status View external service connections and tool availability
/reasoning Reasoning effort Adjustable across low / medium / high levels; current level shown after the command
/model Switching models Switch the underlying AI model; current model name shown after the command
/persona Set persona Adjust AI reply tone and style
/feedback Submit feedback Report issues or suggestions to Anthropic
/pet Desktop pet Summon or hide the built-in desktop pet (easter egg feature)