Skip to content
InnovateTechie
Claude Code

Claude Code Process Exited With Code 1: How to Fix

InnovateTechieBy InnovateTechie10 min read
Share
Claude Code process exited with code 1 troubleshooting — the crashed Node CLI subprocess and its fixes

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.

The 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.

Claude Code process exited with code 1 explained — a generic non-zero exit from the crashed Node CLI subprocess

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.

CauseWhat it looks likeWhy it crashes
Stray ANTHROPIC_API_KEYWorked before, now exits 1 after loginAn env var overrides your claude.ai OAuth session and conflicts
Broken auth / session fileExits 1 right after a terms updateA pending terms prompt or corrupted session file can't initialize
Outdated or missing NodeFails on a fresh machineThe Node runtime is too old, or Node/Git isn't installed at all
Corrupted installExits 1 on every commandA half-finished npm update left broken files behind
Permissions / pathFails to create ~/.claudeNo 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.

StepCommandWhat it rules out
1. Read the real errorscroll up / claude doctorTells you which cause you're in
2. Clear the API-key conflictunset ANTHROPIC_API_KEY, re-loginThe top cause on installs that worked before
3. Update Node and Claude Codenode -v, then claude updateAn outdated runtime or a stale build
4. Reinstall the CLInpm uninstall -g then reinstallA corrupted install
5. Fix permissions / cachecheck ~/.claude, clear npm cacheA blocked config folder
  1. Clear the API-key conflict. If Claude Code worked yesterday and exits 1 today, try this first. A stray ANTHROPIC_API_KEY in your shell profile silently overrides your claude.ai login. Run unset ANTHROPIC_API_KEY (or remove it from .bashrc/.zshrc and your system environment), restart the terminal, and run claude to re-authenticate through OAuth.
  2. 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 run claude update to pull the latest build.
  3. Reinstall Claude Code cleanly. A corrupted install crashes on every command. Remove it with npm uninstall -g @anthropic-ai/claude-code, reinstall with npm install -g @anthropic-ai/claude-code, and run claude to log in again. This is the reliable claude code crash fix when the error line points at a missing or broken module.
  4. 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.

Step-by-step Claude Code crash fix flow — read the error, clear the API key, update Node, then reinstall the CLI

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 codeSignal / meaningLikely root cause
1Generic errorAuth conflict, bad config, outdated Node, broken install
137128 + 9 = SIGKILLOut of memory — the OS killed the process
139128 + 11 = SIGSEGVSegmentation 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

PlanPrice
Free$0
Pro$20 / month
Maxfrom $100 / month
APIPay per token

For the full breakdown of every plan, see our how much Claude costs guide.

Frequently Asked Questions

The this exit-code crash error keeps appearing because a background process fails to initialize — usually a pending terms update you haven't accepted, a broken auth or session file, an ANTHROPICAPIKEY that conflicts with your OAuth login, or a project path containing spaces. Accept terms at claude.ai, unset the stray key, and re-authenticate first.

Scroll up to the first real error line printed just above exited with code 1 — that names the actual fault. In most cases the fix is to run unset ANTHROPICAPIKEY, restart your terminal, and re-login through claude.ai OAuth. That single sequence clears the most common crash on installs that were working before.

Run claude doctor from your shell, or /doctor inside Claude Code. It inspects your Node version, install, auth state, and config, then prints what's wrong. Also check the output or log panel for the line immediately preceding the exit — that line, not the code 1 itself, holds the real diagnosis you need.

No. A code 1 crash happens before any request completes, so no successful API call reaches Anthropic and no tokens are billed. Exit code 1 is a local startup failure, not a finished request. You are only charged for calls that actually run, and a crashed CLI never sends one.

CI environments usually lack interactive OAuth, run with different environment variables, and may miss Node, Git, or a TTY. Without a way to authenticate headlessly, the process fails on launch. Provide credentials through the supported non-interactive method, and make sure Node and Git are installed on the runner image.

Yes. Code 1 is a generic error — auth, config, or install. Code 137 is 128 + 9, a SIGKILL, which almost always means the process ran out of memory. Code 139 is 128 + 11, a SIGSEGV segmentation fault, usually a corrupted binary. Each points to a different root cause and fix.

Almost always local. Pending terms, a stale session file, a conflicting environment variable, or a missing dependency cause the crash — not an account ban. Accept the latest terms at claude.ai, re-authenticate, and clear any stray ANTHROPICAPIKEY first. Genuine account problems surface as auth errors with messages, not a bare code 1.
InnovateTechie

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 →