Skip to main content
OpenAIintermediate

Why Is Codex So Slow? Fix Slow Codex CLI Responses

Why is Codex so slow? Usually reasoning effort, a bloated session context, or a weekly rate limit. Lower the effort level, run /compact, and check /status — each fix takes seconds.

9 min readUpdated August 2026

Why is Codex so slow? Nine times out of ten it is one of three things, and all three are fixable in under a minute:

  1. Reasoning effort is set higher than the task needs. Lower it. This is the biggest single lever on response time.
  2. The session has grown long. Run /compact to summarize the chat and free tokens, or /clear to start fresh. Every turn re-sends the accumulated history, so a long chat pays for itself on every request.
  3. You have hit a rate limit. Run /status. On ChatGPT plans, approaching the weekly cap slows work down rather than failing loudly.

If a brand-new chat with a trivial prompt is also slow, stop tuning your setup — the cause is network latency or an OpenAI-side incident, both covered below.

LLM Token Counter

Count tokens in text for GPT, Claude, Gemini, and open models like Llama, Gemma, and Qwen — or search any model on Hugging Face. Estimate API costs, check context window fit, and optimize prompts

Open the full LLM Token Counter
Loading interactive tool...

Want us to handle this for you?

Get expert help →

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

Shipping code with AI?

Get alerted when it breaks

AI assistants ship code you didn't write line-by-line. GlitchReplay gives you error tracking plus session replay — so when AI-generated code breaks in production, you see the exact stack trace and the user's screen. Sentry-SDK compatible, flat-rate pricing.

Try GlitchReplay free

Frequently Asked Questions

Find answers to common questions

In almost every case it is one of three things: the reasoning effort is set higher than the task needs, the session context has grown large enough that every turn re-reads it, or you have hit a rate limit and requests are being throttled. Lower the reasoning effort, run /compact or start a fresh chat, and check /status. Network latency and OpenAI-side incidents account for most of the rest.

Drop the reasoning effort to low for well-scoped work, keep each chat to a single unit of work and run /compact before it grows long, and set a fast default model in ~/.codex/config.toml. Reducing the approval prompts you sit through with -a on-request also removes real wall-clock time from multi-step tasks.

Every turn sends the accumulated conversation back to the model, so a long session pays for its own history on each request. Run /compact to summarize the visible chat and free tokens, or /clear to start a fresh chat. Performance returns to baseline immediately.

Yes — it is the single largest lever. Higher effort means the model spends more time reasoning before it answers. OpenAI's own guidance is to use low for faster, well-scoped tasks and reserve extra high for long, agentic, reasoning-heavy work. Set it with model_reasoning_effort in ~/.codex/config.toml.

Check /status. Codex meters usage against a weekly limit on ChatGPT plans; when you approach or exceed it, work slows or stops rather than failing outright. OpenAI temporarily removed the separate 5-hour window in July 2026, so the weekly cap is now the ceiling.

Large repos make Codex spend turns searching for the right files before it can start work, and sessions that touch many files accumulate context quickly. Point it at specific paths in your prompt and write an AGENTS.md (via /init) describing the repo layout and build commands so it stops rediscovering them every session.

Yes. Codex streams every response over the API, so latency shows up as a delay before output starts and as pauses mid-stream. VPNs are the most common cause of a sudden slowdown; test with the VPN disconnected before changing anything else.

Check status.openai.com. Codex CLI slowdowns often correlate with published API incidents, and no local configuration change will help during one. If a simple prompt in a brand-new chat is also slow, the problem is not your context or your repo.

It adds wall-clock time rather than model time. Every approval prompt is a round trip that waits on you, so a multi-step task under a strict policy can take far longer in practice. Use -a on-request for routine work and keep the sandbox restrictive instead of loosening approvals.