Codex Related Questions
Author: goswitch
Updated: 2026-06-13T10:02:01.000Z
A Few Tips for More Efficient Use of Codex
Many people may think that the model becomes less effective after using Codex for a period, experiencing so-called "degradation" phenomenon. However, based on my experience, the models provided in Codex have been upgraded many times without any "degradation" — the key is how you use the model appropriately
Task Breakdown: Never submit a very vague task, such as "Please write a management system backend" — this will inevitably lead to degradation! Codex models are characterized by rigorous and orderly, following instructions exactly — you need to break down your tasks
Stay in Control: Before starting a task, evaluate whether it is broken down enough and follows the "modular development" principle. Before submitting the task, you should be able to predict which files Codex will modify and what changes it will occur. Do not let AI go beyond your understanding and control — otherwise the project will become increasingly chaotic until having to start from scratch
Some Thoughts
Honestly, AI has made many things very simple, but basic knowledge determines your upper limit for using AI. At the current stage, AI is just a very excellent Copilot role. This also means that the same AI can have used differently by different people!
- Avoid Compression: In most scenarios, your task should be completed using at most about 60% of Codex's context. If your task exceeds 60% of context and still unresolved and even requires compression, then the task breakdown before execution has failed — you need to break down the task more carefully. An excellent Codex vibe coding user almost never needs to compress content!
Smooth Codex Usage on Windows!
Important
This method simultaneously solves file reading/writing, encoding issues, high token consumption, project no memory and other pain points
Ensure your
Codex CLIandVSCode Codexplugin are working properly, that i.e you can successfully converse with the model in the VSCode Codex pluginPress "Win+R" enter the following content and press Enter to open your user directory
%userprofile%\.codex- Find the
config.tomlfile in the directory, open and edit it. Your configuration file should look like this:
model_provider = "goswitch"
model = "gpt-5.4"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true
windows_wsl_setup_acknowledged = true
model_verbosity = "high"
[model_providers.goswitch]
name = "goswitch"
base_url = "https://goswitch.online/v1"
wire_api = "responses"
requires_openai_auth = true- Open the
AGENTS.mdfile in the directory (create it manually if it doesn't exist), write the following content and save
# Codex Global Work Guidelines
## Answer Style:
- Answers must use English
- For summaries, Plans, Tasks, and long content output, prioritize logical organization and use a beautiful Table format; output normal content normally- Run VSCode, open the Codex plugin and and let's see what's different!
Common Codex Commands
| Command | Description |
|---|---|
| /model | Select the current model |
| /approvals | Set approval rules for this session |
| /review | Let Codex review current workspace changes |
| /resume | Select and continue a previous session from the session history list |
| /new | Start a new conversation in the current CLI session |
| /init | Generate AGENTS.md template in the current directory |
| /compact | Sumize conversation content to release context |
| /undo | Undo Codex's last operation |
| /diff | View current git diff (including untracked files) |
| /mention | Add specified file or directory to the conversation context |
| /status | View session configuration and token usage |
| /mcp | List currently available MCP tools |
| /exit | Exit Codex CLI |
Codex Encoding Issues on Windows
- Press
Win + Rto open the run window, enter the following command and press Enter
intl.cpl
- Click the "Administrative" tab above, then click the "Change System Locale Settings" button shown by the red arrow

- Check the option shown by the red arrow, click OK. Then click OK in the previous window, restart your computer, and use Codex to avoid encoding issues

Set Latest Model in VSCode Codex Plugin
Windows
- Press
Win + Rto open the run window, enter the following command in press Enter
%userprofile%\.vscode\extensions
MacOS
- In Finder, press "Command+Shift+G", enter the following path in press Enter to open the VSCode extension directory
~/.vscode/extensions
- Find the folder starting with
openai.chatgpt, - the numbers after it are the version number, if there are multiple such directories, enter the directory with the latest version number

- Navigate to
webview\assetsfolder, you will see many js files

Download the replace script, and unzip it, copy this js file to the directory with many js files
Download the replace script
Automatically read the latest version number and file name, click to download directly
Waiting to get
File name Download now
Restart VSCode, and you can see that you can now select the latest model!
How to Configure Global Prompt in Codex
Please check the first two steps in Codex CLI Configuration
The
AGENTS.mdfile mentioned in the tutorial is the global prompt file in Codex. If this file does not be present, you need to create it manually, then write the promptSave the prompt, restart Codex or VSCode, the prompt will take effect
Enable Built-in Web Search in Codex
Please check the first two steps in Codex CLI Configuration
Open the
config.tomlfile mentioned in the tutorial, add the following content
[features]
web_search_request = true- Run Codex and try
Codex Network Connection Issues in Container or CLI Sandbox
When Codex encounters network connection issues in the CLI sandbox or container (such as tun mode) (such as unable to pull installation packages), and other tools (such as terminal, Claude Code) work normally, this is usually caused by improper MTU settings. Solution:
- Change the MTU value to 1500, this setting can usually be changed in your Clash client.
- For users who cannot find Clash MTU settings on Linux, refer to this link: https://linux.do/t/topic/1220328
Connection failed Issue
Error message similar to: text Connection failed: error sending request for url (https://www.goswitch.com/v1/responses)This situation is caused by local network problems, troubleshoot according to the following steps:
- Check whether the local network is working properly, and whether you can access other pages
- Check whether your computer uses using a
network proxy (VPN)tool, if so please turn it off - Use the terminal, run the
codexcommand, try to send a conversation message in the CLI to determine whether it is a VSCode Codex plugin issue. If so, please restart VSCode and try again - If it still not work, bring your error screenshot and consult customer service or friends in the group
401 Error
Error message similar to: text exceeded retry limit, last status: 401 Unauthorized, request id: xxxxxx
- Run the following command in Windows or MacOS terminal to determine whether environment variables exist
Windows
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 following output appears, proceed directly to step 2
OPENAI_API_KEY = MISSINGOPENAI_BASE_URL = MISSINGIf the output is different, please run the following command in the terminal and then proceed to step 2
cmd /c "setx OPENAI_API_KEY \"\" & setx OPENAI_BASE_URL \"\""macOS``` bash echo "================= OPENAI ENV CHECK ================="if [ -z "$OPENAI_API_KEY" ]; then echo "OPENAI_API_KEY = MISSING"else echo "OPENAI_API_KEY = OK"fiif [ -z "$OPENAI_BASE_URL" ]; then echo "OPENAI_BASE_URL = MISSING"else echo "OPENAI_BASE_URL = OK"fiecho "========================================================"
If the following output appears, proceed directly to step 2
``` text
OPENAI_API_KEY = MISSINGOPENAI_BASE_URL = MISSINGIf the output is different, run the following command in the terminal and then proceed to step 2
unset OPENAI_API_KEY OPENAI_BASE_URL- See the Codex Configuration in CLI chapter
Important
You need:
- Check whether the ApiKey configuration in ~/.codex/auth.json is correct
- Check whether the request address in ~/.codex/config.toml is correct
403 Error
Error message similar to:``` text unexpected status 403 Forbidden: {"error":{"message":"Usage not included in yourplan","type":"usage_not_included","param":null,"code":null,"plan_type":"basic"}}
This situation is caused by an account issue in the pool, you need to:1. Use `Ctrl+C` to interrupt the conversation, if in VSCode, click the stop button
2. Re-initiate the conversation and try again, observe whether this problem appears again
3. If retrying more than 3 times is invalid, bring your error screenshot and consult customer service or friends in the group