When Claude Code Won't Let You Log In, Fall Back to Codex
One day, I could not log in to Claude Code.
Work does not stop just because a tool stops working.
Since I also subscribe to ChatGPT, my first instinct was, “I can escape to Codex.”
But before doing that:
Try another machine first.
That is often the fastest path.
First Move: Try Claude Code on Another Machine
Start with this:
Try logging in to Claude Code with the same Max account on another machine.
Many programmers have more than one computer. Simply trying the same account in a different environment tells you a lot.
If it works on another machine, your emergency workaround is done.
You can keep working there for a while. If the original machine still does not recover, then you can think about reinstalling Claude Code or debugging that environment.
If Another Machine Also Fails, Switch to Codex
This is where the Codex fallback starts.
To be clear, Codex is not a drop-in replacement for Claude Code.
But if the goal is to keep development moving during an emergency, it works well enough.
Why Codex, Not Something Else?
There are several alternatives to Claude Code:
- Codex CLI by OpenAI
- Aider as a multi-provider CLI
- Cursor as a GUI
- GitHub Copilot Workspace
- Gemini Code Assist
My reasons for choosing Codex are simple:
- I can already use Codex - this is personal, but I also pay for ChatGPT.
- The UX is the closest - agentic CLI,
AGENTS.md, file edits, and review loops feel familiar. - The learning cost is low - if you are used to Claude Code, the mental model transfers fairly well.
Preparation: Do This Before You Need It
Installing Codex for the first time on the day Anthropic is down is not realistic.
Step 1: Install Codex CLI
Check the latest official documentation. Installation steps may change by version.
Step 2: Authenticate
If you have a ChatGPT Plus or Pro subscription, you should be able to log in within that framework. Check the latest documentation.
For me, this means I can build a backup route with Claude Max plus ChatGPT Plus or Pro, without adding another dedicated Codex subscription.
Step 3: Test It with a Simple Task
cd /tmp/test-project
codex
Something as simple as “write a Hello World Python script” is enough for a smoke test.
Step 4: Have Claude Code Create a Handoff Document
This is the important part.
Before switching to Codex, while Claude Code is still available, have Claude Code create a handoff document.
For example:
I want to operate this project with Codex as well.
Do not implement anything yet.
Summarize the current structure, startup method, test method, forbidden files, and risks.
Create CLAUDE_TO_CODEX_HANDOFF.md.
The point is that Claude Code should not create AGENTS.md directly.
Claude Code understands the history and context of your Claude Code workflow. So its job is to gather the material Codex needs to read.
Step 5: Let Codex Create AGENTS.md
AGENTS.md is the operating rulebook for Codex, so it makes sense to let Codex itself create it.
Give Codex the CLAUDE_TO_CODEX_HANDOFF.md file written by Claude Code and say something like:
This project is usually developed with Claude Code.
First, read CLAUDE_TO_CODEX_HANDOFF.md and understand the current state.
Based on that, create an AGENTS.md for Codex.
Do not read secret files.
After that, perform the following task:
<specific task>
That gives the process a clean division of responsibility.
Claude Code inventories the current situation. Codex turns that inventory into rules for itself.
That feels more natural than asking Claude Code to guess how Codex should operate.
How Codex Behaves Differently
When switching to Codex, assume the output quality may drop. Do not expect perfect continuity. Still, it is better than doing nothing.
The differences I notice are:
- More literal - it follows what is written, and may miss context Claude Code would infer.
- Shallower file exploration - if you want it to inspect something, point to it explicitly.
- More conservative agent behavior - tool chains tend to be shorter, so you may need to split tasks into smaller instructions.
The answer is to make your instructions one level more concrete.
Bad:
Review the auth area.
Better:
Read every file under src/auth/ and review it from the perspectives of responsibility separation, security, and error handling.
This is also good practice for Claude Code, but with Codex it becomes essential.
What Codex Should Add to AGENTS.md
Some implicit rules that Claude Code might understand from context should be made explicit for Codex.
Again, Claude Code does not need to write this directly. It is better for Codex to read the handoff document and organize the rules for itself.
For example:
# Working Style
- Read this document and docs/adr/* before starting work
- Check the existing file structure before creating new files
- Explain the planned changes and impact before editing
- Keep refactoring within the requested scope
- Explain the reason before adding or removing dependencies
Claude Code may understand “avoid excessive refactoring” from a short sentence. Codex often needs the rule to be more concrete.
Operation: Create Days Where You Actually Use Codex
You cannot understand a tool without using it.
The worst timing to remember how Codex works is during an emergency.
If you use Codex for even 30 minutes on real tasks during normal times, emergency switching becomes much smoother.
For example:
- Give Codex a light refactoring task
- Ask Codex to generate documentation
- Ask Codex to produce review points
Calling it “practice” makes it easy to skip.
The trick is to intentionally give Codex meaningful tasks.
If it works well, it may even save some tokens.
I usually develop with Claude Code, but I am editing this blog with Codex.
Summary
The triage order is:
- Try the same Max account on Claude Code from another machine - this may solve the problem.
- If that also fails, switch to Codex - this is the final fallback.
Preparation during normal times:
- Install Claude Code on multiple machines and log in with the Max account.
- Keep the repository syncable with Git.
- Include
CLAUDE.mdand.claude/in the repository where appropriate. - Install and authenticate Codex CLI as well.
- Have Claude Code create
CLAUDE_TO_CODEX_HANDOFF.md. - Have Codex read
CLAUDE_TO_CODEX_HANDOFF.mdand createAGENTS.md. - Regularly give Codex real tasks.
Trying Codex for the first time during an emergency is too late.
Prepare and rehearse your escape route during normal times.
Claude Code may be the strongest engine, but depending on one engine is a risk.
The project is the real asset. AI tools are engines. Build the project so the engine can be swapped.