← Back to tech blog

Claude Code best PC setup:
16GB vs 24GB vs 64GB RAM benchmark

Many people assume Claude Code “runs in the cloud” so hardware doesn’t matter—that’s only half right. Inference doesn’t use your local GPU, but every Agent tool call can spawn npm test, xcodebuild, docker compose, language servers… We ran 8 identical tasks on three same-chip M4 Macs (16 / 24 / 64GB), measuring peak RAM, swap events, and end-to-end time. Bottom line: 16GB for terminal-only light use; 24GB is the sweet spot for IDE + Agent daily work; Xcode + multiple simulators + parallel subagents → 64GB.

1. Myth: Claude Code needs no local compute?

Claude Code’s LLM inference runs on Anthropic’s cloud—no NVIDIA GPU required, no OOM from “model too large.” That doesn’t mean “any old 8GB machine is fine.” Agent mode is fundamentally AI operating your local environment:

  • Read files → ripgrep, git, filesystem cache
  • Run tests → Node, Jest, pytest, cargo test process trees
  • Fix CI → xcodebuild, Gradle, Docker containers
  • Parallel subagents → multiple terminal sessions reading disk and compiling at once

In our 30-day Claude Code billing audit we showed the priciest pattern is long sessions + full-repo reads. RAM works the same way—swap can slow Agent-triggered local commands 2–5×. You’re waiting on compiles and tests, not just model latency.

In one line: Pick a machine where Agent workloads don’t stutter—not one that merely “can run a model.”

2. Test setup and methodology

ItemSpec
HardwareMac mini M4 ×3 (16 / 24 / 64GB RAM, 512GB SSD each)
OSmacOS 15.5; iCloud Desktop sync off; Low Power Mode off
Claude Code2026.7, default Sonnet; Opus for complex refactors
Repos① TS monorepo (pnpm, ~180 packages) ② Swift iOS (SPM + CocoaPods) ③ mid-size Go backend (Docker Compose)
Sampling3 runs per scenario, median; memory_pressure + Activity Monitor for peak and swap
TimingWall clock from prompt to Agent “task complete” (includes local commands)

Note: same chip, RAM only differs—no CPU generation noise. Numbers vary slightly by repo size and deps, but relative gaps between tiers held across repeats.

3. How much RAM Claude Code itself uses

Extreme light case: terminal only, empty repo, single short Q&A:

StateResidentPeak
Claude Code idle (signed in)~180 MB~220 MB
Single Q&A (no tool calls)~200 MB~350 MB
5 tool-call rounds (20 files)~280 MB~520 MB
40-round Agent session (no /clear)~400 MB~780 MB

So: if Claude Code is just “ChatGPT in a terminal,” 16GB is plenty. The gap is local side effects Agent runs for you.

4. 8-scenario comparison table

Peak RAM (Claude Code + parallel local processes), noticeable swap (>500MB/min paging), and median wall time.

Scenario 16GB peak 16GB time 24GB peak 24GB time 64GB peak 64GB time
S1 Terminal only + small TS fix (3 files, lint) 6.8 GB OK 42s 6.8 GB 41s 6.8 GB 40s
S2 Claude Code + Cursor + TS LSP 14.6 GB occasional swap 14.6 GB OK 14.6 GB
S3 Agent runs pnpm test (full suite) 15.9 GB heavy swap 8m 12s 16.4 GB light swap 3m 05s 16.4 GB 2m 58s
S4 12-file API refactor + tests 16.1 GB heavy swap 14m 30s 17.8 GB OK 6m 20s 17.8 GB 6m 08s
S5 Claude Code + Xcode + iPhone 16 simulator unusable 25m+ 22.3 GB marginal 11m 40s 22.3 GB OK 10m 55s
S6 Dual parallel subagents (each runs tests) OOM risk failed 21.7 GB swap 9m 50s 21.7 GB OK 4m 22s
S7 Docker Compose 4 services + Agent API calls unusable 23.1 GB swap 7m 15s 23.1 GB OK 5m 40s
S8 Monorepo nightly CI sim (build + test + lint) constant swap 45m+ 24.6 GB high pressure 18m 20s 24.6 GB OK 16m 05s

Reading the table: 16GB collapses after S3—not because Claude Code is slow, but because tests thrash swap. 24GB covers S1–S4 and light S5; parallel Agents and Docker still pinch. 64GB has zero “unusable” rows; S6 dual subagent is more than 2× faster than 24GB.

5. 16GB: what works, when you must endure

Good fit

  • Mostly Claude Code terminal; IDE occasional or Vim/Neovim
  • Small repos (<50k LOC), tests finish in <30s
  • No iOS simulators, no Docker matrix
  • Already on MacBook Air / entry MacBook Pro, can’t bump RAM now

16GB survival rules

  1. One heavy app at a time: close Cursor TS LSP windows while Agent runs tests
  2. Use .claudeignore to cut noise (same as billing article cost rules—and saves RAM)
  3. /clear after each sub-task to avoid context snowball buffers
  4. Offload xcodebuild, Docker, long CI to cloud Mac; local machine for edit + light checks only
Quick memory pressure check (terminal)
# Live overview
memory_pressure

# Swap usage
sysctl vm.swapusage

# Top memory hogs
top -l 1 -s 0 -o mem | head -20

Felt experience: S1–S2 are smooth on 16GB. At S3 full tests: fans spin, cursor lags, Agent retries on “test timeout”—slow and burns extra tokens.

6. 24GB: the best fit for most people

If you can pick one tier for “Claude Code + modern IDE,” 24GB is the 2026 sweet spot—Apple offers it as a common upgrade on 14″ M4 MacBook Pro, usually cheaper than jumping 24→48.

24GB handles comfortably

  • Claude Code + Cursor (or VS Code) + TS / Python LSP together
  • One full test run on a mid-size monorepo
  • Cross-module refactors ≤12 files + test loop
  • Single Docker service (DB / Redis) + local API dev

Where 24GB still pinches

  • Xcode + iOS simulator + Claude Code (S5 peak 22.3GB—tiny headroom)
  • Dual subagents (S6) or four Docker services (S7)
  • Chrome 50+ tabs + the stack above (common, not a joke)
Recommendation: full-stack / backend / DevOps devs—24GB is the minimum “no fuss” tier. iOS devs compiling locally should jump to 64GB or hybrid cloud (next section).

7. 64GB: who actually needs it

64GB sounds like overkill until Agent workflows mean parallelism—not one compile queue, but multiple subagents reading disk, testing, and starting containers at once.

Signals you want 64GB

SignalWhy 64GB
Often 2+ iOS simulators for UI tests~3–5GB per simulator; Xcode ~4–6GB
Regular parallel Claude Code subagentsEach child session may run its own test tree
Local Docker matrix (db + cache + queue + mock)Container RAM stacks fast
Large monorepo (turbo / nx cache resident)Build cache + LSP + index fills 24GB
Tech lead with 3 project windows openNot luxury—daily reality

S6 dual subagent: 4m 22s on 64GB vs 9m 50s on 24GB—not the model; two parallel npm test runs no longer fight swap. At 2 parallel jobs/day saving 5 minutes each → ~60 hours/year waiting.

Budget stuck at 36GB (some M4 Pro SKUs)? Fine iOS compromise—S5 simulators steadier than 24GB; still close one subagent or offload to cloud for S6.

8. Beyond RAM: what else matters

ComponentImpact on Claude CodeRecommendation
SSDAgent reads many files; swap pain = disk speed512GB min, 1TB better; don’t host repos on slow externals
ChipLocal compile speed; not model inferenceM4 is enough; M4 Pro compiles faster—see MacBook Pro guide
NetworkStreaming, large context uploads; offline kills AgentStable wired or 5GHz Wi‑Fi; avoid hotspot for long jobs
ThermalsLong compiles + summer ambient = throttlingLaptop stand; 24/7 jobs on Mac mini / cloud
DisplayIndirect RAM hit—dual screens → more IDE windows residentExternal-monitor users need more headroom

9. Hybrid: local machine + cloud Mac

You don’t have to spec a 64GB laptop. Common 2026 pattern:

  1. Local 16–24GB: Claude Code edit, review, light tests
  2. Cloud M4 Mac mini (24–64GB): xcodebuild, nightly CI, parallel subagent heavy work
  3. SSH Agent sessions on cloud; local machine gets results—RAM bottleneck moves to the datacenter

Echoes our billing article: lid-close sleep → Agent reruns, wasted tokens and time. Always-on cloud Mac fits “fire a long job and walk away.”

Not enough RAM? Offload heavy work to always-on cloud Mac

Nuvcloud offers dedicated M4 Mac mini (multiple RAM sizes), SSH/VNC, daily/weekly/monthly billing. 16GB local for coding, 64GB cloud for parallel Claude Code Agents + full Xcode builds—view pricing.

10. Quick buying guide by profile

ProfileRAMTypical hardwareNotes
Student / scripts / ops automation16GBMacBook Air M4, Mac mini M4Plus .claudeignore and cloud for heavy jobs
Full-stack / backend / data24GBMacBook Pro 14 M4, Mac mini M4Best value tier
iOS / macOS indie dev24–36GBMacBook Pro 14 M4 ProSimulators always on → 36GB+
Tech lead / monorepo maintainer48–64GBMacBook Pro 16 M4 Pro/Max, custom Mac miniParallel subagents essential
Windows as primary PCCloud 24GB+Nuvcloud Mac miniNo second laptop needed

11. FAQ

QuestionAnswer
Does Claude Code use more RAM than Cursor?Lighter terminal; but Claude Code Agent runs shell more aggressively—bigger local side effects. See IDE layering article.
Does RAM affect token bills?Indirectly: swap → command timeouts → Agent retries → more rounds. Slow machine = higher bill.
Can unified memory “share” with GPU?Yes, but Claude Code barely uses local GPU. Unified pool means CPU and I/O heavy tasks compete—leave headroom.
Can I upgrade RAM later?No. Apple Silicon RAM is soldered—choose at purchase.
Linux desktop + Claude Code?Supported. Still recommend 24GB+; great value if you don’t need macOS toolchains.
How do I know if I should upgrade?Run memory_pressure during Agent tasks; “warn” or growing swap → more RAM or offload heavy work.

12. Verdict

Claude Code turns “writing code” into “conducting your local environment”—RAM planning is estimating how many processes Agent will spawn in parallel. Our tests are blunt:

  • 16GB: fine for light terminal use; IDE + full tests + Agent together → swap cliff
  • 24GB: 2026 sweet spot for most devs—~80% of daily Claude Code workflows
  • 64GB: “pay once, wait less” for parallel Agents, Xcode matrices, Docker power users

RAM is soldered—skimp on CPU tier before skimping on RAM. On a budget, 24GB local + high-RAM cloud Mac often beats “forcing 16GB”—one slow rerun costs more time and tokens than several days of cloud rent.

View plans →