Skip to content

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.

  1. 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.
  2. 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.

  1. 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.

  1. Make sure your Codex CLI and VS Code Codex extension run normally — that is, you can already chat with the model smoothly in the Codex extension in VS Code.
  2. Press Win + R, type the following and press Enter to open your user directory:
%userprofile%\.codex
  1. Find the config.toml file in the directory, open and edit it. Your config file should look like this:
toml
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
  1. Open the AGENTS.md file in the directory (create it manually if it doesn't exist), write the following into it, and save:
markdown
# 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
  1. Run VS Code, open the Codex extension, and see what's different!

Common Codex commands

CommandDescription
/modelChoose the model currently in use
/approvalsSet the approval rules for this session
/reviewHave Codex review changes in the current workspace
/resumeChoose and continue a previous interactive session from the history list
/newStart a new conversation in the current CLI session
/initGenerate an AGENTS.md template in the current directory
/compactSummarize the conversation to free up context
/undoUndo Codex's last operation
/diffView the current git diff (including untracked files)
/mentionAdd a specific file or directory to the conversation context
/statusView session configuration and token usage
/mcpList the currently available MCP tools
/exitExit the Codex CLI

Garbled text with Codex on Windows

  1. Press Win + R to open the Run window in the bottom-left, type the following command and press Enter:
intl.cpl

Codex garbled text issue

Codex garbled text issue

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

Codex garbled text issue

  1. 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

  1. Press Win + R to open the Run window in the bottom-left, type the following command and press Enter:
%userprofile%\.vscode\extensions

Common steps

Set the latest model

  1. 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.

Set the latest model

  1. Go into webview\assets in order, and you'll see a bunch of js files.

Set the latest model

  1. 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).

Set the latest model

  1. Restart VS Code, and you'll see you can now select the latest model!

How to configure a global prompt for Codex

  1. Please review the first two steps in Configure CLI Tools.
  2. The AGENTS.md file mentioned in the guide is Codex's global prompt file. If it doesn't exist, create it manually and write your prompt into it.
  3. Write and save the prompt, restart Codex or VS Code, and the prompt takes effect.
  1. Please review the first two steps in Configure CLI Tools.
  2. Open the config.toml file mentioned in the guide and add the following:
toml
[features]
web_search_request = true

Enable Codex built-in web search

  1. 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:

  1. Check whether your local network is working and whether you can access other pages.
  2. Check whether your computer is using a network proxy (VPN) tool. If so, turn it off.
  3. Use the terminal, run the codex command, 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.
  4. 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
  1. Run the following command in the Windows or macOS terminal to check whether the environment variables exist.
bash
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 = MISSING

If the output is different, run the following command in the terminal and then go to step 2:

bash
cmd /c "setx OPENAI_API_KEY \"\" & setx OPENAI_BASE_URL \"\""
  1. See the Configure CLI Tools chapter.

Important

You need to:

  1. Check whether the ApiKey configuration in ~/.codex/auth.json is correct.
  2. Check whether the request address in ~/.codex/config.toml is 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:

  1. Press Ctrl + C to interrupt your conversation; in VS Code, click the stop button.
  2. Start a new conversation and try again, and observe whether the issue reappears.
  3. If it still fails after more than 3 retries, bring your error screenshot and ask support or fellow members in the group.
最近更新