Codex FAQ
A few tips for using Codex more effectively
Many people feel that Codex isn't as good as it used to be after using it for a while — the so-called "dumbing down" phenomenon. But from my own experience, the models offered in Codex have gone through many upgrades and haven't actually gotten dumber. The key is how you use the model sensibly.
- Task breakdown: Never submit a very vague task, such as
please write me an admin dashboard for a management system. Used this way, it will definitely feel dumb! Codex models are rigorous and orderly — they hit exactly what you point at, which means you need to break your task down. - Within your control: Before starting a task, evaluate it and consider whether it has been broken down finely enough and whether it follows the principles of "modular" development. Before submitting a task, you should be able to estimate which files this Codex change will touch and what changes it will produce. Never let the AI operate outside your understanding and control, otherwise the project will get messier and messier until you have to start over from scratch.
Some rambling
Honestly, the AI era has made a lot of things much simpler, but fundamentals determine the ceiling of how well you use AI. At this stage, AI is only an excellent Copilot. That's why the same AI performs differently in different people's hands.
- Avoid compaction: In most scenarios, your task can be solved using at most around 60% of Codex's context. If your task still isn't solved after exceeding 60% of the context and even needs compaction, then the breakdown work before this task failed — you need to break your task down more finely. An excellent Codex Vibe Coding player almost never needs to compact context!
Use Codex smoothly on Windows!
Important
This method solves several pain points at once: file read/write, garbled text, high token consumption, and no project memory.
- Make sure your
Codex CLIandVS Code Codexextension run normally — that is, you can already chat with the model smoothly in the Codex extension in VS Code. - Press
Win + R, type the following and press Enter to open your user directory:
%userprofile%\.codex- Find the
config.tomlfile in the directory, open and edit it. Your config file should look like this:
model_provider = "OpenAI"
model = "gpt-5.5"
review_model = "gpt-5.5"
model_reasoning_effort = "xhigh"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://tokenflow.run"
wire_api = "responses"
requires_openai_auth = true
[features]
goals = true- Open the
AGENTS.mdfile in the directory (create it manually if it doesn't exist), write the following into it, and save:
# Codex Global Working Guide
## Answer style:
- Answers must be in English
- For summaries, Plans, Tasks, and long outputs, prefer organizing the logic first and then output neatly in a clean Table format; output normal content as usual- Run VS Code, open the Codex extension, and see what's different!
Common Codex commands
| Command | Description |
|---|---|
/model | Choose the model currently in use |
/approvals | Set the approval rules for this session |
/review | Have Codex review changes in the current workspace |
/resume | Choose and continue a previous interactive session from the history list |
/new | Start a new conversation in the current CLI session |
/init | Generate an AGENTS.md template in the current directory |
/compact | Summarize the conversation to free up context |
/undo | Undo Codex's last operation |
/diff | View the current git diff (including untracked files) |
/mention | Add a specific file or directory to the conversation context |
/status | View session configuration and token usage |
/mcp | List the currently available MCP tools |
/exit | Exit the Codex CLI |
Garbled text with Codex on Windows
- Press
Win + Rto open the Run window in the bottom-left, type the following command and press Enter:
intl.cpl

- Click the "Administrative" tab at the top, then click the "Change system locale" button indicated by the red arrow.

- Check the option indicated by the red arrow and click OK. Then click OK in the previous window as well, restart your computer, and use Codex again to avoid garbled text.
Set the latest model in the VS Code Codex extension
- Press
Win + Rto open the Run window in the bottom-left, type the following command and press Enter:
%userprofile%\.vscode\extensionsCommon steps

- Find the folder starting with
openai.chatgpt— the number after it is the version. If there are multiple such folders, enter the one with the newest version number.

- Go into
webview\assetsin order, and you'll see a bunch of js files.

- Download and unzip the replacement script, then copy this js file into the directory that just had a bunch of js files (the script automatically reads the latest version number and file name — just click to download).

- Restart VS Code, and you'll see you can now select the latest model!
How to configure a global prompt for Codex
- Please review the first two steps in Configure CLI Tools.
- The
AGENTS.mdfile mentioned in the guide is Codex's global prompt file. If it doesn't exist, create it manually and write your prompt into it. - Write and save the prompt, restart Codex or VS Code, and the prompt takes effect.
Enable Codex's built-in web search
- Please review the first two steps in Configure CLI Tools.
- Open the
config.tomlfile mentioned in the guide and add the following:
[features]
web_search_request = true
- Run Codex and give it a try.
Codex network connection issues in a container or CLI sandbox
When Codex runs in a CLI sandbox or container (such as tun mode) and encounters network connection issues (e.g. unable to pull install packages), while other tools (such as the terminal or Claude Code) work fine, this is usually caused by an improper MTU setting.
Solution:
- Change the MTU value to
1500. This setting can usually be changed in your Clash client. - For users who can't find the Clash MTU setting on Linux, refer to this link: https://linux.do/t/topic/1220328
Connection failed issue
The error message looks like:
Connection failed: error sending request for url (https://xxxxxx/v1/responses)This happens when there is a problem with your local network. Troubleshoot as follows:
- Check whether your local network is working and whether you can access other pages.
- Check whether your computer is using a network proxy (VPN) tool. If so, turn it off.
- Use the terminal, run the
codexcommand, and try sending a message in the CLI to determine whether it's a VS Code Codex extension issue. If so, restart VS Code and try again. - If it still doesn't work, bring your error screenshot and ask support or fellow members in the group.
Codex 401 error
The error message looks like:
exceeded retry limit, last status: 401 Unauthorized, request id: xxxxxx- Run the following command in the Windows or macOS terminal to check whether the environment variables exist.
cmd /c "echo ================= OPENAI ENV CHECK ================= & ^ if defined OPENAI_API_KEY (echo OPENAI_API_KEY = OK) else (echo OPENAI_API_KEY = MISSING) & ^ if defined OPENAI_BASE_URL (echo OPENAI_BASE_URL = OK) else (echo OPENAI_BASE_URL = MISSING) & ^ echo ========================================================="If the output is the following, go directly to step 2:
OPENAI_API_KEY = MISSING
OPENAI_BASE_URL = MISSINGIf the output is different, run the following command in the terminal and then go to step 2:
cmd /c "setx OPENAI_API_KEY \"\" & setx OPENAI_BASE_URL \"\""- See the Configure CLI Tools chapter.
Important
You need to:
- Check whether the ApiKey configuration in
~/.codex/auth.jsonis correct. - Check whether the request address in
~/.codex/config.tomlis correct.
Codex 403 error
The error message looks like:
unexpected status 403 Forbidden: {"error":{"message":"Usage not included in your plan","type":"usage_not_included","param":null,"code":null,"plan_type":"basic"}}This happens when the account in the pool has a problem. You need to:
- Press
Ctrl + Cto interrupt your conversation; in VS Code, click the stop button. - Start a new conversation and try again, and observe whether the issue reappears.
- If it still fails after more than 3 retries, bring your error screenshot and ask support or fellow members in the group.
