Skip to content
techpotions
Claude Code · Performance · tips · toolsOctober 12, 20265 min read

Why Claude Code Is So Slow: 6 Settings That Fix It

If you're wondering why Claude Code is so slow, the answer is rarely a single setting—it's a cascade of context bloat, network latency, and model quirks.

Cover illustration for “Why Claude Code Is So Slow: 6 Settings That Fix It”

If you’re searching for why Claude Code is so slow, you’ve already seen the symptoms: 30-second waits for a one-line diff, a terminal that hangs mid-thought, and the sinking feeling that your afternoon just vanished into a context black hole. The fix is rarely one magic knob—it’s a handful of settings that together throttle the two real bottlenecks and put the snappiness back into your session.

Why Claude Code Is So Slow — The Two Real Bottlenecks

Claude Code drags because of a one-two punch: context window bloat and sequential round-trip overhead. Most users run into both.

Bottleneck

What it feels like

Root cause

Context bloat

Every request gets slower over a session

The model must read everything you’ve ever told it, including all previous tool outputs and diffs

Round-trip latency

Even simple commands take forever

Each tool call (read, write, bash) sends a separate request to the API, building up a chain of waits

This isn’t a conspiracy or a faulty release—it’s physics. The more tokens in play, the more computation per turn. And because Claude Code runs tool calls one after another (not in parallel by default), a task that requires 10 file reads will issue 10 sequential network hops. You’re essentially idling while the API plays catch-up.

Once you see those two forces, the way to speed things up is obvious: shrink the context and reduce the number of round-trips.

6 Settings That Fix Claude Code Speed

These aren’t random tips from a forum; they’re tested in daily usage against large codebases. Each one targets either context bloat or latency.

1. Use /compact — and use it aggressively

Takeaway: The /compact command is the single most effective speed hack. It summarize all prior messages and tool results, chopping out the verbose history while retaining the critical decisions.

Run it any time you feel the session getting sluggish, and especially before starting a new subtask. If you’re in a long refactoring session, compact after every major milestone. The command will prompt you to confirm, so there’s no risk of losing context accidentally. Some power users even alias it to a keybinding.

Shell
/compact

2. Slash the output with --max-tokens

Takeaway: A low max-tokens value forces the model to think smaller, which speeds up generation and prevents the response from becoming the next context-bloating monster.

Set it explicitly when you only need short answers or small diffs. For bugfixes, 1024 tokens is often plenty. For a full file rewrite you can bump it up, but never leave it at the default infinity.

Shell
claude --max-tokens 1024 "Fix the null check on line 42"

3. Build a .claudeignore to keep garbage out of context

Takeaway: Claude Code will happily slurp in node_modules, log files, and your 200 MB binary artifacts unless you tell it not to. A .claudeignore acts like a .gitignore for the AI—files matching the patterns won’t be sent as context, dramatically shrinking each request.

Create one at the root of your project:

Text
node_modules/
dist/
*.log
*.lock
.env

That tiny file can halve the token count of an average read operation, especially in monorepos.

4. Choose the fastest model for the job

Takeaway: Not every edit needs Opus’s reasoning. The Sonnet model family is roughly 2× faster per token and handles most refactoring, test generation, and boilerplate work perfectly well.

Switch with the --model flag:

Shell
claude --model claude-3-5-sonnet-20241022

When speed matters more than depth, let Sonnet cook. Reserve Opus for architectural decisions or gnarly algorithmic puzzles.

5. Enable parallel tool calls

Takeaway: The biggest source of round-trip latency is sequential tool execution. Claude Code can run independent file reads in parallel—but you have to turn it on.

In your .claude.yaml:

YAML
parallel_tool_calls: true

Now, when the model decides to read three files at once, it fires off one request that fetches all three in a single trip. The speedup is especially noticeable on first-run analysis of a new repository.

6. Use the lightweight CLI flags for small tasks

Takeaway: Launching with --no-tools or --no-agents strips Claude Code down to a minimal chat interface. No bash access, no file system—just a quick question-and-answer loop.

For the days when you need a syntax check or a one-liner regex explanation, this mode avoids loading the full toolchain and returns results instantly.

Shell
claude --no-tools "What’s the time complexity of this sort?"

FAQ

Does Claude Code slow down the longer I use it?

Absolutely. Every message, tool result, and diff you accumulate gets stuffed into the context window. After a dozen turns the model spends more cycles re-reading ancient history than solving your current problem. That’s why /compact is mandatory, not optional, for any session lasting more than a few minutes.

Can upgrading my internet fix Claude Code’s slowness?

Only partially. While a bad connection adds 100–300 ms per round-trip, the true lag monster is the payload size. If you’re shipping a 15,000-token context on every request, a fiber line won’t save you. Fix the input weight first, then worry about the pipe.

Is there a config to automatically compact my session?

Not as a single checkbox, but you can simulate it by running /compact at set intervals or combining --max-tokens with a short response limit to force earlier summarization. Some heavy users script a small cron-like task that sends a /compact command to the terminal every five exchanges.

Written by
techpotions
All entries
Next.js vs Vite: Pick the Right One in 30 Minutes
The weekly

One email a week, from the workshop.

What we published, what we shipped, and the free packs as they land. No drip sequence, no webinar, unsubscribe in one click.