Fix 1: Lower the Reasoning Effort
Reasoning effort controls how long the model thinks before it answers, and it dominates every other setting. OpenAI's own guidance is to use low for faster, well-scoped tasks and reserve extra high for long, agentic, reasoning-heavy tasks. Most day-to-day CLI work — renaming things, adding a test, fixing a failing build, writing a small function — is well-scoped work that gains nothing from deep reasoning and pays a large latency penalty for it.
Set a fast default in ~/.codex/config.toml:
model = "gpt-5.6"
model_reasoning_effort = "low"
Then raise it only for the tasks that need it. You can override any config value for a single run without editing the file:
codex -c model_reasoning_effort=high
Switching model and effort mid-session is also possible from the model picker, so a practical pattern is to stay on low effort by default and step up when a task genuinely calls for planning.
Fix 2: Stop Paying for Old Context
Codex sends the conversation back to the model on every turn. A chat that has read twenty files, run a test suite and applied three rounds of edits is re-transmitting all of that on each subsequent request — which is why sessions feel fast at the start and sluggish an hour in.
/compact Summarize the visible chat to free tokens
/clear Clear the terminal and start a fresh chat
Use /compact before a long follow-up task rather than waiting until the session already feels overloaded — compaction summarizes what is there, so compacting early preserves the decisions you care about while they are still legible.
Better still, avoid the growth in the first place: keep one chat per coherent unit of work. When you move to an unrelated task, start a new chat instead of continuing. You can always return to an earlier one with codex resume.
Signs you have waited too long:
- Responses that used to start in seconds now pause noticeably before any output appears.
- Codex re-reads files it already read earlier in the session.
- Answers start referencing decisions from a task you finished an hour ago.
Our guide to Codex context errors covers what happens when the window fills completely.
Fix 3: Check Whether You Are Rate Limited
Slow is often how a limit presents itself. Run /status to see your current usage and reset window.
Codex meters usage against a weekly limit on ChatGPT plans. OpenAI temporarily removed the separate rolling 5-hour window for Plus, Pro and Business in July 2026, which means the weekly cap is now the effective ceiling — a bigger runway, not an unlimited one. Local CLI usage and cloud usage draw from the same pool, so a heavy afternoon in the cloud shows up as a slow evening in your terminal.
If /status shows you near the cap, no local tuning will help. Wait for the reset, buy credits, or move the work to an API key. We cover the mechanics in detail in Codex CLI usage and rate limits.
Fix 4: Give Codex Less to Search Through
On a large repository, a slow first response is usually Codex looking for things rather than thinking about them. Every exploratory grep and file read is a turn, and each one costs latency and context.
Two changes fix most of it.
Name the files in your prompt. "Fix the retry logic in src/api/client.ts" starts work immediately. "Fix the retry logic" spends four turns finding the file first.
Write an AGENTS.md. This is the highest-leverage change for a big repo, because it makes the layout knowledge permanent instead of rediscovered every session:
/init
That scaffolds an AGENTS.md in your project. Keep it short and accurate — repo layout, build and test commands, conventions, and how to verify a change. OpenAI's guidance is explicit that a short, accurate AGENTS.md beats a long file full of vague rules, and a vague one actively wastes context on every request.
Fix 5: Rule Out the Network
Codex streams every response, so network latency is visible as a delay before the first token and as pauses mid-output.
# Is it OpenAI, or you?
curl -s https://status.openai.com/api/v2/status.json | jq '.status.description'
# Connection timing to the API
curl -o /dev/null -s -w "Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\n" \
https://api.openai.com/v1/models
Look for connect times under 100 ms. If TTFB is high while connect time is low, the delay is server-side, not local.
VPNs are the most common local cause. They add latency to every request and sometimes route traffic through a distant exit node:
# Disconnect the VPN, then time a trivial prompt
time codex exec "reply with the word ok"
# Reconnect and compare
time codex exec "reply with the word ok"
If the difference is large, use split tunnelling to route OpenAI traffic directly. Corporate proxies that inspect TLS have the same effect and are worth testing the same way.
Fix 6: Cut the Approval Round Trips
Approval policy does not change how fast the model thinks, but it changes how long a task takes on the clock — every prompt is a round trip that waits on a human.
# Ask only when Codex decides it needs to
codex -a on-request
# Or set it permanently
approval_policy = "on-request"
sandbox_mode = "workspace-write"
The policy values are untrusted, on-request and never. Note that --full-auto is now a deprecated compatibility flag that prints a warning; prefer --sandbox workspace-write. And resist the temptation to reach for --dangerously-bypass-approvals-and-sandbox (aliased --yolo) for speed — it removes both approvals and sandboxing, and is only appropriate inside an externally hardened environment.
The right trade is a permissive approval policy with a restrictive sandbox: let Codex work without interrupting you, while the sandbox keeps it inside your workspace. See configuring sandbox modes for the details, and /permissions to set the boundaries for a single run.
Measuring Before You Change Anything
Establish a baseline so you can tell which fix actually worked:
# Minimal request — measures model latency and network, nothing else
time codex exec "reply with the word ok"
# Context-heavy request in your repo — measures the cost of your codebase
time codex exec "summarize the architecture of this project"
The gap between the two is what your repository and context are costing you. If the first command is already slow, the problem is not your context, your repo or your prompt — go to the network and rate-limit sections. If only the second is slow, fixes 2 and 4 are where the time is.
When It Is Not You
Codex CLI slowdowns frequently track OpenAI-side incidents and model rollouts. Users have reported simple turns taking many minutes during these periods, regardless of local configuration. Before spending an afternoon tuning, check status.openai.com and confirm that a trivial prompt in a fresh chat is fast. If it is not, and the status page is clean, the model you are on may simply be slower than the task warrants — drop the reasoning effort and try again.
Next Steps
- Learn how to switch models in Codex CLI and pick the right one per task
- Fix context window errors when compaction is no longer enough
- Review the full slash command reference for
/compact,/statusand/permissions - Explore session management so short chats do not mean lost work