Guide8 min read

Why Is Claude Code So Slow? Diagnose and Fix the Bottleneck

Claude Code feeling slow? Split service vs local in two minutes, find where time goes, and fix the right layer — with a check, cause, and proof for each.

Fast Inference

Why Claude Code feels slow — and why "slow" is really five different problems

Why is Claude Code so slow? Usually because of one of five layers: Anthropic's service, your network, growing context, sequential tool round trips, or a heavy model at high effort. Diagnose the layer before changing anything.


Two-minute triage: is it the service or your local session?

This six-step split resolves most slowdowns in two minutes:

  1. Reproduce it with a fresh, trivial prompt in a new session.
  2. Check the Anthropic status page for an active incident.
  3. Check your own network for silent stalls.
  4. Run /usage and /context and read the behavior flags.
  5. Apply the layer-specific fix the checks point to.
  6. Prove it by re-running the same task and comparing wall time.

If a fresh one-liner is also slow, suspect the service or network; if only long sessions crawl, suspect local context and round trips.

Rendering diagram…

Figure 1: Two-minute triage decision tree

Capture one turn's wall time and /usage totals before clearing diagnostic state. Then check Anthropic's status page, which logged degraded-performance incidents across Aug 12–20, 2026 (90-day uptime ~99.4%); wait if one is active.


What "slow" actually means

"It's slow" is not diagnosable; the shape is. Match your symptom to its layer:

  • Slow startup → install/extensions/environment (/doctor).
  • Slow first token → context re-processing, cache miss, or service stall.
  • Slow generation → model, effort, and fast-mode territory.
  • Pauses between tool calls → sequential round trips; the model turn is the cost.
  • ~30 s freezes mid-task → silent local network drops with retry and backoff.
  • Slow after long sessions → auto-compaction reading the whole conversation.

Service and network causes

Most people blame Anthropic when the cause is local. In one practitioner's 35-day dataset of 74,493 turns, 325 of 375 API errors (~87%) were local connection drops (ECONNRESET, ENOTFOUND); only 12 were 429 rate limits and 6 were 529 overloaded. Claude Code retries these silently with backoff, so they surface as unexplained ~30-second pauses, not errors.

Check: run with --verbose and watch where the pause sits — between request and response is network; during file reads is local work. Proof: switch your network path (wired, VPN off) and re-run; if the stalls vanish, that was the cause.


Context causes: why Claude Code gets slower over time

The model keeps no state between turns, so Claude Code re-sends the whole transcript every request, processing more tokens before the first reply as it grows. But the data calms the panic. Median turn time rises sublinearly, then plateaus: ~1.1 s under 25K tokens, ~5.2 s past 700K (roughly 5x from empty to full), then flat. p90 holds near 19–22 s throughout, so worst-case spikes are a separate problem, not context growth.

Median turn time rises, then plateaus
Median turn time rises, then plateaus - Claude Code turn wall time by context size

Prompt caching absorbs most of that cost: the repeated prefix (system prompt, CLAUDE.md, prior turns) is re-read at the cached rate until it's invalidated. That window is one hour on a subscription, five minutes on credits or API. A longer gap, or switching model, editing CLAUDE.md, or changing MCP servers mid-session, forces a full reprocess. /usage flags long context or cache misses; /context shows what fills the window.

/compact reads the whole conversation it summarizes, so compacting a large context is itself slow. One practitioner measured ~123 s median, cutting context ~84% before it regrew ~22% within 10 turns. Use a focus (/compact keep only the plan and the diff); when you don't need continuity, /clear is free. The Autocompact is thrashing... error means a large output refilled the window: read files in chunks or /clear.


Model and effort causes

Two levers get conflated: how hard the model reasons, and which model runs. After context, effort is the bigger per-turn lever. /effort (low | medium | high | xhigh | max, default high) governs how many tool calls the model makes before answering; lower effort means fewer calls and turns. It works on Fable 5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7, via /effort, --effort, or CLAUDE_CODE_EFFORT_LEVEL. Test it by dropping high to medium on a routine task.

The default model resolves to Opus 5 on Max and Enterprise pay-as-you-go, Sonnet 5 on Pro and Team Standard. Lighter models like Haiku 4.5 answer routine turns faster. /fast (research preview, Opus 5 and Opus 4.8 only) buys up to 2.5x output speed at $10/$50 per MTok from credits. It's a latency purchase, not a quality change. If the model is your bottleneck, choose a faster Claude model; for plan meters, understand Claude usage limits.


Tooling causes: round trips, MCP, CLAUDE.md

The structural cost is sequential round trips. A single "fix this bug" on a ~100K-token session commonly expands into 6–10 steps, each paying a full 2–4 s model turn while local tool time is negligible (Read ~0.01 s, Bash ~0.12 s). Because 74.9% of tool-calling turns issued exactly one tool call, most work is strictly sequential. Naming several files up front lets Claude batch reads into one turn. External tools are the exceptions: WebFetch ~5 s, WebSearch ~9.3 s, Subagent ~2.4 s median.

Config bloat inflates every turn. Keep CLAUDE.md small (under ~200 lines), disable unused MCP servers with /mcp (their tool definitions consume the window), and delegate verbose work to subagents. Agent teams (experimental, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) use about 7x the tokens, since each teammate runs its own context window.


A controlled test: native Claude Code vs the same harness on Fast

Once the model is your bottleneck, prove it: hold the harness and task constant and swap only the model. fast claude on points all six Claude Code model slots at one catalog model (default glm-5.2) and backs up your settings. It routes your existing harness to a separately billed catalog model; it does not raise native subscription quotas or speed up an unchanged proprietary model.

The method: run a fixed task natively and capture wall time and /usage; then fast claude on --model <catalog-id>, re-run the identical task, and compare. Verify each route (native in /usage, Fast in the Usage dashboard), then revert with fast claude off, which restores your snapshot byte-for-byte.

bash
#!/usr/bin/env bash
set -euo pipefail

# --- Native run: measure your current setup first ---
# Run a fixed task natively, then capture per-session token/cost totals with /usage
# (type /usage inside the Claude Code session). Record wall time and turns.
#   e.g. "Refactor src/auth to use the new session helper and update its tests."

# --- Fast run: route the same harness to a selected catalog model ---
fast claude on --model "<catalog-id>"   # points all six model slots at the catalog model; backs up settings.json
fast claude status                    # confirm the adapter reports "on"
# Restart Claude Code, then re-run the identical task. Fast requests appear in the
# Usage dashboard (https://fast.inference.net/dashboard/usage) with the selected model.

# --- Restore: revert to your original configuration ---
fast claude off                       # restores the original settings.json snapshot byte-for-byte
RouteModelTask wall timeTurnsVerified in
Nativeyour default______/usage
Fast<catalog-id>______Usage dashboard

Fill the blank cells with measurements from the same task on each route (C-001, C-004).

For setup, run fast claude on, choose a model, and verify the route.


Fix matrix and escalation checklist

Act from this matrix. Each row gives a symptom, its likely layer, a check, a fix, and the proof:

SymptomLikely layerCheckFixProof
Service degradedAnthropic servicestatus pagewait or route to Fastfresh prompt fast
Silent ~30s stallLocal network--verbosewired, VPN offstalls gone
Slow first tokenCache miss/usage flagskeep 1h cacheflag clears
Session gets slowerContext size/context/compact focusturn time drops
/compact thrashingCompactionthrash errorchunk reads or /clearcontext stays low
Slow generationEffort level/usage/effort mediumfewer turns
Slow generationHeavy model/modellighter model or /fastfaster tokens
Every turn slowConfig bloat/contexttrim CLAUDE.md, /mcpbase context drops
Token spikesAgent teams/usagedisable teams~7x fewer tokens
Broken or slow startInstall/envclaude doctorclaude --safe-modestarts clean

Sources: C-006, C-007, C-009–C-014, C-018, C-019, C-021, C-022, C-026, C-027.

bash
#!/usr/bin/env bash

# ============================================================
# DIAGNOSE — find where the time goes before changing anything
# ============================================================

# In the Claude Code session (slash commands):
/usage        # per-session token/cost stats; flags long context and cache misses [C-006]
/context      # what is filling the context window right now [C-007]
/doctor       # in-session check of install, settings, extensions, context [C-012]

# In your shell:
claude doctor            # same automated check when the CLI won't start [C-012]
claude --verbose         # print each tool call as it runs, exposing where the pause sits [C-026]
claude --safe-mode       # start with plugins, MCP servers, and hooks disabled to isolate a cause [C-021]

# ============================================================
# ADJUST — the levers that change latency per turn
# ============================================================

# In the Claude Code session (slash commands):
/effort medium           # fewer tool calls before answering (low|medium|high|xhigh|max; default high) [C-018]
/model                   # switch to a lighter/faster model for routine turns [C-020]
/compact keep the plan   # summarize history with a focus; the summary read is itself a large request [C-014]
/clear                   # free reset when you do not need conversation continuity [C-014]

For stubborn cases:

  1. CLI won't start or acts brokenclaude doctor, then claude --safe-mode to isolate a plugin, MCP server, or hook.
  2. High CPU or memory on large repos/compact regularly, restart between tasks, and add build dirs to .gitignore; use /heapdump only if memory stays high (never share it — it holds the full conversation and credentials).
  3. Hang or freezeCtrl+C; if unresponsive, close the terminal and claude --resume (the conversation is preserved).
  4. WSL slow or incomplete search → move the project to the Linux filesystem, or install system ripgrep and set USE_BUILTIN_RIPGREP=0.

If you have outgrown Claude Code entirely, it may be time to consider Claude Code alternatives.


Next step: test the model route

If the model was your bottleneck, test the same harness on a Fast model without leaving the CLI.


References

  1. Anthropic — Claude Code costs: https://code.claude.com/docs/en/costs
  2. Anthropic — troubleshooting: https://code.claude.com/docs/en/troubleshooting
  3. Anthropic — model config: https://code.claude.com/docs/en/model-config
  4. Anthropic — status: https://status.claude.com/
  5. AakashX — Why Claude Code Gets Slower: https://www.aakashx.com/blog/why-claude-code-is-slow/
npm install openaibaseURL: "https://api.inference.net/v1"ship it