Codex not working? Quick fixes and triage
Before you reinstall anything, run through this checklist. Most Codex issues are auth problems, rate limits, or config mistakes. All fixable in under a minute.
Step 1: Check if you are authenticated
The most common reason Codex is not working is expired or missing credentials. Run codex in your
terminal:
- If authenticated: Codex starts normally, ready for prompts
- If not authenticated: Opens browser for ChatGPT login
Auth troubleshooting
- Token expired: Re-authenticate by running
codexand completing the browser flow - Password changed: Old tokens are invalidated; re-authenticate
- Session revoked: Check ChatGPT settings for active sessions; re-authenticate after revoking old ones
Step 2: Check for rate limits
If Codex was working earlier but now fails or responds slowly, you may have hit rate limits. The CLI shows a 429 error with a reset time.
Rate limit solutions
- Wait: The error includes reset time; quota recovers over time
- Switch accounts: If you have multiple ChatGPT accounts, use CodexUse to switch to one with available quota
- Check usage: CodexUse shows estimated usage per profile
Step 3: Verify network and OpenAI status
Sometimes the issue is not on your end:
- VPN interference: Some VPNs block or throttle OpenAI traffic; try disconnecting
- Corporate proxy: Enterprise networks may require proxy configuration
- DNS problems: Try switching DNS temporarily
- OpenAI outage: Check status.openai.com for service issues
Step 4: Check your config
The Codex CLI configuration can cause issues if misconfigured. Common problems:
- Invalid model: Try removing the model setting to use the default
- Sandbox blocking: If commands fail mysteriously, check sandbox settings
- Reset config: Rename config.toml and restart Codex with defaults
Step 5: Check CLI version
Verify you are running the version you expect:
Version issues
- Multiple installations: You might have npm and brew versions conflicting
- Old version: Update to latest; some issues are fixed in newer releases
Troubleshooting table
| Symptom | Likely cause | Action |
|---|---|---|
| "Command not found: codex" | CLI not installed or not in PATH | Run npm install -g @openai/codex |
| Browser opens every time you run codex | Auth token keeps expiring or not saving | Check file permissions; ensure config directory is writable |
| Hangs without any output | Network timeout or slow connection | Check internet; disable VPN if using one |
| "Model not found" error | Invalid model name in config | Remove model line from config or use a valid model |
| Works in terminal, fails in scripts | Different shell environment | Use absolute path to codex binary |
| CodexUse shows expired profile | Refresh token invalidated by OpenAI | Delete the profile and re-add with fresh authentication |
When to actually reinstall
Reinstall the Codex CLI only if:
- You have tried all the above steps
- The CLI itself crashes or shows internal errors (not auth/network issues)
- You are updating from a very old version with known breaking changes
What to avoid
- Reinstalling as the first troubleshooting step. It rarely helps
- Deleting your Codex config directory without backing up first
- Assuming "it is broken" without checking auth and rate limits
- Running as sudo/root. The CLI does not need elevated privileges
Related
What should I check first when Codex is not working?
Check authentication (run codex to see if it prompts for login), verify you are not
rate-limited, and confirm network connectivity.
Do I need to reinstall Codex CLI to fix errors?
Rarely. Most issues are auth, rate limits, or config problems. Only reinstall after ruling out these common causes.
Why does Codex keep asking me to log in?
Your token expired or was invalidated. Re-authenticate through the browser flow.