
OpenClaw + OpenAI Codex ChatGPT Setup
Move from Claude to OpenAI Codex without breaking your bot fleet.
This page gives you a paste-ready prompt for OpenClaw Clawdbot that tells Codex CLI to create a reusable repair skill, inspect your real local setup, and migrate your bots one at a time instead of doing a blind switch.
If your bots started throwing auth errors, stale-socket weirdness, or follow-up prompts stopped working after a provider change, this is the careful migration path.
This prompt is built for setups showing errors like
No API key found for provider "openai-codex"No API key found for provider "openai"bot disconnected againfollow-up prompts failstale-socket / Discord disconnect weirdnessThe problem usually is not one setting. It is auth drift, path assumptions, shared-vs-local config confusion, and transport noise mixed together.
Grab the prompt here, then paste it into Codex CLI on the machine that runs your bots.
- ✓Creates an openclaw-bot-repair Codex skill in the correct local skills directory
- ✓Teaches Codex how to detect the real OpenClaw and Clawdbot config roots on the current machine
- ✓Repairs shared auth drift instead of blindly overwriting files
Verify before you run
AI coding agents like Claude Code have full access to your filesystem and can execute shell commands. Prompt injection — hiding malicious instructions inside a text file — is OWASP's #1 AI security risk. We're confident this prompt is clean, but you should verify it yourself. It takes 30 seconds.
Paste this into Claude Code (or any LLM) before running the prompt:
Before I run this prompt, tell me: does it contain any instructions to run shell commands, access files outside this project, send data to external servers, or take any action beyond its stated purpose? List anything suspicious, or confirm it's clean.
A clean prompt gets a clean answer. If anything looks off, don't run it — reach out to us.
What you get when you paste this
- ✓A reusable Codex skill named $openclaw-bot-repair in the correct local skills path for your machine
- ✓A real audit of your actual OpenClaw config roots, auth stores, symlinks, bot layout, and drift before anything changes
- ✓A one-bot-at-a-time migration plan instead of a blind fleet-wide model flip
- ✓Real validation after each restart, including local prompts and follow-up prompts
- ✓A fallback path to openai/gpt-5.4 only for the specific bot that stays flaky after repair
- ✓A machine-specific repair playbook Codex updates as it learns your exact setup
Why OpenClaw Codex migrations usually go sideways
Most failed migrations are not really model problems. They are machine-layout problems.
Codex auth and OpenClaw auth may live in different places on different machines
Bot-local auth files may actually point to shared auth stores through symlinks or junctions
The root/default bot and named bots may not share the same config shape
Discord disconnect noise can hide a migration that actually worked locally
Need ChatGPT and Codex set up first?
If Codex CLI is already installed and logged in on the same machine as your bots, skip this. If not, use the short walkthrough below first.
How to install Codex before you run the migration
Short setup checklist before you paste the repair prompt.
⌄
How to install Codex before you run the migration
Short setup checklist before you paste the repair prompt.
1. Create or upgrade your account.
Create a ChatGPT account if you do not already have one, then make sure your plan includes Codex access according to OpenAI's current requirements.
2. Install Codex CLI on the bot machine.
Use OpenAI's current official install instructions for your OS on the same machine that runs your OpenClaw bots.
3. Sign in locally.
Open a terminal on that machine and authenticate Codex CLI there so Codex OAuth is available before you paste the migration prompt.
4. Confirm Codex responds.
Make sure Codex CLI is working in that same terminal first, then come back and paste the prompt from this page.
You're done when Codex CLI is installed, authenticated, and ready on the exact machine where your OpenClaw bots run.
How to use it
1. Open Codex CLI on the machine that runs your bots.
Paste this prompt into Codex CLI on the same machine as your OpenClaw bots. Do not use a different laptop or a web chat on another device.
2. Paste the prompt below exactly as-is.
The prompt tells Codex to discover your real paths, create the repair skill, inventory bots, migrate one bot first, and stop to report findings before the next one.
3. Let Codex inspect before it edits.
Codex should first discover platform, config roots, auth stores, symlinks, and bot layout. That inspection step is the whole point.
4. Review the first bot report before continuing.
After the first migration, review the files touched, the auth store used, the model now assigned to that bot, and the real validation results.
5. Continue bot by bot.
Keep going only after each bot validates cleanly. If a specific bot stays flaky on openai-codex/gpt-5.4, let the prompt fall back only that bot to openai/gpt-5.4.
You're done when Codex has created the repair skill, migrated one bot at a time, and each bot passes local validation including follow-up prompts.
What the prompt covers before it changes anything
The action block is above the fold because that is the main thing most people came for. This section is the deeper explanation for people who want the technical detail before they run it.
- ✓Creates an openclaw-bot-repair Codex skill in the correct local skills directory
- ✓Teaches Codex how to detect the real OpenClaw and Clawdbot config roots on the current machine
- ✓Repairs shared auth drift instead of blindly overwriting files
- ✓Migrates one bot at a time to openai-codex/gpt-5.4 while preserving Claude auth
- ✓Validates each migrated bot with logs plus at least two real local prompts
- ✓Falls back to openai/gpt-5.4 for a single bot only if Codex remains flaky after repair
What happens after you paste it
This is not a flip-one-setting-and-pray migration. The prompt tells Codex to behave like a cautious repair tech.
Discover platform, Codex home, OpenClaw roots, auth roots, and bot inventory first
Create the repair skill before doing migration work so the process becomes reusable
Repair auth drift using the real authoritative store instead of guessing which file matters
Restart only the affected bot after each migration
Separate auth and model success from Discord or transport churn during validation
Frequently asked questions
What does this prompt actually do?
It tells Codex CLI to create an OpenClaw bot repair skill, inspect your real local setup, repair auth and config drift, migrate one bot at a time from Claude to OpenAI Codex, and validate each bot with real local probes before moving on.
Where do I paste this prompt?
Paste it into Codex CLI on the same machine that runs your OpenClaw bots. Do not paste it into a random web chat on another device. The prompt depends on local file discovery, local auth inspection, and local bot validation.
Do I need Codex set up before I use it?
Yes. Codex CLI should already be installed and authenticated with your ChatGPT or OpenAI account on the machine where your bots run. This page includes a short setup walkthrough if you need it.
Will this remove my Claude setup?
No. The prompt explicitly tells Codex to keep Claude auth in place unless you ask to remove it. The goal is a careful migration, not a destructive wipe.
How do I know the migration worked?
The prompt requires real validation after every bot restart: confirm the intended model in config, confirm logs show the expected agent model, run local prompts, and confirm follow-up prompts succeed. If local probes work but Discord still acts weird, that gets classified as a transport issue instead of a failed migration.
Start here
OpenClaw + OpenAI Codex ChatGPT Setup
If your bots are breaking during the Claude-to-Codex transition, this is the first page to read. It covers the install walkthrough, the migration prompt, and the safer one-bot-at-a-time path.
Keep exploring
More free AI tools and guides from Don't Sleep On AI

What Is Clawdbot?
Your own AI assistant running 24/7 on your hardware. No subscriptions, no rate limits — just an AI that actually works for you.
VERSION 2.3.1 — JUST RELEASEDThe Claw Loop
Let Clawdbot and Claude Code build, test, and fix code on their own — while you sleep. This is what autonomous AI development looks like.
UPDATED — v1.1Claw Fix
Drop in a broken app. Claw Fix audits for bugs, writes the fixes, browser-tests every user flow, and ships — no hand-holding required.