FAQ · Codex
Common Codex commands
| Command | Description |
|---|---|
/model | Choose the model currently in use |
/approvals | Set the approval rules for this session |
/review | Have Codex review the current workspace changes |
/resume | Pick and continue from the session history |
/new | Start a new conversation |
/init | Generate an AGENTS.md template in the current directory |
/compact | Summarize the conversation to free up context |
/undo | Undo Codex's last action |
/diff | View the current git diff |
/status | View session config and token usage |
/mcp | List the currently available MCP tools |
/exit | Exit the Codex CLI |
Configure a global prompt (AGENTS.md)
Create AGENTS.md in the Codex config directory (%userprofile%\.codex / ~/.codex), write your global rules, then restart Codex to apply. For example:
markdown
# Codex global working guide
## Answering style
- Answers must be in English
- For summaries / plans / long content, prefer well-formatted tables; output regular content normallyEnable built-in web search
Open config.toml and add:
toml
[features]
web_search_request = trueRestart Codex to use web search.
Garbled text in Codex on Windows
- Press
Win + R, typeintl.cpland press Enter. - Go to the "Administrative" tab → click "Change system locale".
- Tick "Beta: Use Unicode UTF-8 for worldwide language support" and confirm.
- Restart your computer and use Codex again to avoid garbled text.
How to use Codex more effectively
- Break down tasks: don't throw a very vague, large task at it (like "build me an admin backend for a management system"). Codex is precise and does exactly what you point it at, so the more granular the task, the better.
- Stay in control: before starting, estimate which files will change and what changes will be produced, so the changes don't escape your awareness.
- Avoid compaction: if a task uses a lot of context and still isn't resolved — or even needs compaction — it usually means it wasn't broken down enough; go back and split it further.
No network in a sandbox / container
When Codex runs in a CLI sandbox or container (such as tun mode), if other tools work fine but only Codex can't fetch anything, a common cause is an incorrect MTU setting. Setting the MTU to 1500 usually fixes it (typically adjusted in your proxy / Clash client).
Still have questions?
For general and billing questions, see General & Billing, or contact our support email [email protected].
