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.
2. Test setup and methodology
| Item | Spec |
|---|---|
| Hardware | Mac mini M4 ×3 (16 / 24 / 64GB RAM, 512GB SSD each) |
| OS | macOS 15.5; iCloud Desktop sync off; Low Power Mode off |
| Claude Code | 2026.7, default Sonnet; Opus for complex refactors |
| Repos | ① TS monorepo (pnpm, ~180 packages) ② Swift iOS (SPM + CocoaPods) ③ mid-size Go backend (Docker Compose) |
| Sampling | 3 runs per scenario, median; memory_pressure + Activity Monitor for peak and swap |
| Timing | Wall 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:
| State | Resident | Peak |
|---|---|---|
| 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
- One heavy app at a time: close Cursor TS LSP windows while Agent runs tests
- Use
.claudeignoreto cut noise (same as billing article cost rules—and saves RAM) /clearafter each sub-task to avoid context snowball buffers- Offload
xcodebuild, Docker, long CI to cloud Mac; local machine for edit + light checks only
# 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)
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
| Signal | Why 64GB |
|---|---|
| Often 2+ iOS simulators for UI tests | ~3–5GB per simulator; Xcode ~4–6GB |
| Regular parallel Claude Code subagents | Each 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 open | Not 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
| Component | Impact on Claude Code | Recommendation |
|---|---|---|
| SSD | Agent reads many files; swap pain = disk speed | 512GB min, 1TB better; don’t host repos on slow externals |
| Chip | Local compile speed; not model inference | M4 is enough; M4 Pro compiles faster—see MacBook Pro guide |
| Network | Streaming, large context uploads; offline kills Agent | Stable wired or 5GHz Wi‑Fi; avoid hotspot for long jobs |
| Thermals | Long compiles + summer ambient = throttling | Laptop stand; 24/7 jobs on Mac mini / cloud |
| Display | Indirect RAM hit—dual screens → more IDE windows resident | External-monitor users need more headroom |
9. Hybrid: local machine + cloud Mac
You don’t have to spec a 64GB laptop. Common 2026 pattern:
- Local 16–24GB: Claude Code edit, review, light tests
- Cloud M4 Mac mini (24–64GB):
xcodebuild, nightly CI, parallel subagent heavy work - 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
| Profile | RAM | Typical hardware | Notes |
|---|---|---|---|
| Student / scripts / ops automation | 16GB | MacBook Air M4, Mac mini M4 | Plus .claudeignore and cloud for heavy jobs |
| Full-stack / backend / data | 24GB | MacBook Pro 14 M4, Mac mini M4 | Best value tier |
| iOS / macOS indie dev | 24–36GB | MacBook Pro 14 M4 Pro | Simulators always on → 36GB+ |
| Tech lead / monorepo maintainer | 48–64GB | MacBook Pro 16 M4 Pro/Max, custom Mac mini | Parallel subagents essential |
| Windows as primary PC | Cloud 24GB+ | Nuvcloud Mac mini | No second laptop needed |
11. FAQ
| Question | Answer |
|---|---|
| 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.