OpenAI Codex CLI error
Codex CLI: Your access token could not be refreshed because your refresh token was...
Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.Status: Fixed in releaseLast verified 2 documented fixes4 sources
What it means
Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again.
Causes
- Maintainer etraut-openai (#9634): an older copy of Codex (CLI or IDE extension) left running in the background can cause this.
- A hole in token refresh logic for the app server used by the IDE extension, fixed in PR #11802.
How to fix it
- Fix 1.
Update Codex. Maintainers said this is fixed in 0.117.0 and added more logging; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.
- Fix 2.
Log out and sign in again, as the message says, and close older Codex CLI or extension processes that may still be running.
Terminalcodex logout codex login
More Codex CLI errors
All 14 Codex CLI errorsstream disconnected before completion: stream closed before response.completedStatus: Workaroundstream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)Status: OpenError running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)Status: Fixed in releaseSelected model is at capacity. Please try a different model.Status: By designCodex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.Status: Fixed in releaseError logging in: Port 127.0.0.1:1455 is already in useStatus: WorkaroundToken exchange failed: token endpoint returned status 403 ForbiddenStatus: WorkaroundMCP client for `playwright` failed to start: program not foundStatus: Fixed in release
Related reading
- Agent Harness Lessons From a 500B-Token Decompile: Give Agents a PASS/FAIL OracleAgent harness lessons from a 500B+ token decompile: a byte-matching PASS/FAIL oracle beat the reviewer agent. How agents cheated it and what to copy.
- Codex CLI Needs Resource Budgets, Not Just Token BudgetsA trending Codex SQLite WAL bug is a useful warning for every local coding agent: logs, disks, background processes, and telemetry paths need budgets too.
- Harness Engineering Makes Tokens a Systems BudgetHarness engineering turns tokens into a systems budget. OpenAI's Codex post and Tokenomics research say agent teams need budgets, receipts, and eval loops.
- Codex CLI 0.163: Instant Steering Is Now the DefaultCodex CLI 0.163.0 makes mid-response steering the default and adds searchable /config and a leader key. What changed and what to check before upgrading.
- Codex 'gpt-5.5 Model Is Not Supported' Error: The FixCodex says gpt-5.5 is not supported with a ChatGPT account because OpenAI retired it from ChatGPT sign-in on October 14. The fix and what still works.
- Codex CLI Background Daemon: How to Turn It OffCodex CLI starts a persistent, self-updating background daemon since 0.157.0. What it does, why it hit Hacker News and the reported workaround to turn it off.
FAQ
What does "Your access token could not be refreshed because your refresh token was..." mean in Codex CLI?
Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again.
How do I fix "Your access token could not be refreshed because your refresh token was..."?
There are 2 documented fixes. Start with the first: Update Codex. Maintainers said this is fixed in 0.117.0 and added more logging; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.
Is this Codex CLI error fixed?
Status: Fixed in release. A release fixed this. The affected versions note says where the fix landed. Affected versions: Reported on v0.88.0 (#9634); maintainers say fixed in 0.117.0
Sources
Last verified against 4 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.