Part ofWhat Is Claude Code? The Complete Guide
Claude Code process exited with code 1? The crash is generic — the fix isn't. Read the real error, fix auth, update Node 18+, reinstall clean.
In This Article
7 sectionsThe Claude Code process exited with code 1 error means the CLI's underlying Node process crashed on launch. Code 1 is a generic failure, not a specific fault — usually a stray ANTHROPIC_API_KEY, a broken auth or session file, an outdated Node version, or a corrupted install. Scroll up: the real error sits one line above it.
We build and maintain this site with Claude Code every day, so we've fixed this crash on Windows, macOS, and in CI more times than we'd like to admit. Error: Claude Code process exited with code 1 is the least helpful message the CLI prints, because code 1 says only that something failed — not what. Below is how we read the real cause off the screen in ten seconds, the five things that actually trigger it, and a fix table you can work top to bottom. New to the tool? Start with our pillar, What Is Claude Code?.
What the exit code 1 error actually means
When you launch claude and the CLI dies, a child process — the Node runtime that powers Claude Code — started, hit a fatal error, and quit. In Unix convention an exit code of 0 means success and any non-zero code means failure; 1 is the catch-all "something went wrong" value. So the message itself is not a diagnosis. It's a report that the diagnosis is somewhere else.
That is the single most important thing to understand. The crash almost never originates in Anthropic's servers or your account — it's local state on your machine: an environment variable, a config folder, a Node version, or a permission. Anthropic tracks the recurring version of this on the claude-code GitHub issue tracker, and nearly every resolved report ends the same way: someone found a specific error line that the generic exit message was hiding.
For instance, Node 18.17 still crashes on some transitive dependencies — treating 22.1 as the floor removed this entire class of failure for us.
Read the line above "exited with code 1" first
Before you reinstall anything, scroll up. The exit-code line is the last thing printed, but the actual error — a missing module, a permission denied, an EEXIST path clash — prints on the line directly above it. That one line tells you which fix to run, and skipping it is how people waste an afternoon reinstalling a CLI that was never broken.
If nothing useful is above it, get more output. Run claude doctor from your shell, or /doctor inside a session (our Claude Code CLI documentation has the full command list). Claude Code then checks your install, Node version, auth state, and config for common misconfigurations and reports what it finds. The line it flags is usually the same one the crash was hiding.
Common causes of Claude Code error code 1
Across our own machines and the forum threads, this error traces back to one of five root causes. Match your symptom to the row, then jump to that fix.
| Cause | What it looks like | Why it crashes |
|---|---|---|
| Stray ANTHROPIC_API_KEY | Worked before, now exits 1 after login | An env var overrides your claude.ai OAuth session and conflicts |
| Broken auth / session file | Exits 1 right after a terms update | A pending terms prompt or corrupted session file can't initialize |
| Outdated or missing Node | Fails on a fresh machine | The Node runtime is too old, or Node/Git isn't installed at all |
| Corrupted install | Exits 1 on every command | A half-finished npm update left broken files behind |
| Permissions / path | Fails to create ~/.claude | No write access, or a path with spaces breaks folder creation |
The pattern to notice: a crash that started today on a machine that worked yesterday is almost always the API-key conflict or a session file, while a crash on a brand-new install is almost always Node, Git, or permissions.
How to fix Claude Code process exited with code 1, step by step
Work this list top to bottom. In our experience four out of five cases are solved by step three, and you rarely reach the reinstall.
| Step | Command | What it rules out |
|---|---|---|
| 1. Read the real error | scroll up / claude doctor | Tells you which cause you're in |
| 2. Clear the API-key conflict | unset ANTHROPIC_API_KEY, re-login | The top cause on installs that worked before |
| 3. Update Node and Claude Code | node -v, then claude update | An outdated runtime or a stale build |
| 4. Reinstall the CLI | npm uninstall -g then reinstall | A corrupted install |
| 5. Fix permissions / cache | check ~/.claude, clear npm cache | A blocked config folder |
- Clear the API-key conflict. If Claude Code worked yesterday and exits 1 today, try this first. A stray
ANTHROPIC_API_KEYin your shell profile silently overrides your claude.ai login. Rununset ANTHROPIC_API_KEY(or remove it from.bashrc/.zshrcand your system environment), restart the terminal, and runclaudeto re-authenticate through OAuth. - Update Node.js, then the CLI. Claude Code runs on Node.js. Check your version with
node -v; the npm package needs Node 18 or newer, and recent CLI releases want Node 22+, as Anthropic's official setup documentation spells out. Update from nodejs.org if you're behind, then runclaude updateto pull the latest build. - Reinstall Claude Code cleanly. A corrupted install crashes on every command. Remove it with
npm uninstall -g @anthropic-ai/claude-code, reinstall withnpm install -g @anthropic-ai/claude-code, and runclaudeto log in again. This is the reliable claude code crash fix when the error line points at a missing or broken module. - Clear caches and check permissions. If reinstalling didn't take, clear the npm cache (
npm cache clean --force) and confirm you can write to~/.claude— a config folder the CLI can't create is a classic cause of claude code not starting. On corporate machines, a restricted global npm directory or a blocked domain can produce the same crash.
Exit code 1 vs 137 vs 139: know which crash you have
The number matters. If your crash reports a 137 or a 139 rather than a plain 1, the fix is completely different, so read the code before you act.
| Exit code | Signal / meaning | Likely root cause |
|---|---|---|
| 1 | Generic error | Auth conflict, bad config, outdated Node, broken install |
| 137 | 128 + 9 = SIGKILL | Out of memory — the OS killed the process |
| 139 | 128 + 11 = SIGSEGV | Segmentation fault — a native crash or corrupt binary |
A plain code 1 points at configuration and state, which the steps above fix. A 137 means the process ran out of memory and was killed, so you close other apps or raise the container's memory limit. A 139 is a segfault, usually a corrupted binary — reinstall from scratch. Same crash-message family, three different jobs.
Windows: when Git Bash paths break Claude Code
On Windows, one cause of this crash is specific enough to deserve its own section. Claude Code shells out to Git Bash, and if it can't find bash.exe — because Git isn't installed, sits in a non-default folder, or the path contains spaces — it can throw a Node EEXIST or pathing error while creating its config folder and exit 1. The fix is to set the CLAUDE_CODE_GIT_BASH_PATH environment variable to the full path of your bash, for example C:\Program Files\Git\bin\bash.exe, then restart the terminal.
Two Windows footnotes from experience: Git must be on your PATH at all — removing it during a disk cleanup breaks Claude Code instantly — and paths containing spaces trip up config-folder creation. If your failure looks more like a network wall than a crash, our guide to the can't reach Claude error covers connectivity triage, and for a server-side fault that reaches Anthropic's API see Claude Code API error 500.
Claude pricing at a glance
| Plan | Price |
|---|---|
| Free | $0 |
| Pro | $20 / month |
| Max | from $100 / month |
| API | Pay per token |
For the full breakdown of every plan, see our how much Claude costs guide.
Frequently Asked Questions

Written by
InnovateTechie
Writing about Claude and the Anthropic toolkit — models, Claude Code, pricing, features, and fixes, in clear, practical, hands-on guides tested by daily use.
View all posts →




