Claude Code Troubleshooting: 10 Errors and Fixes (2026)
Jump to: quick triage · reverts changes · context compaction · edits outside scope · permission denials · conflicts with architecture · TypeScript errors pile up · monorepo confusion · token limits · Claude Code and Cursor together · hard-to-audit changes · common misunderstandings · FAQ
Start Here: Is It Claude Code, Your Setup, or the API?
Before treating anything below as one of the 10 behavior problems, rule out the three causes that look similar but aren't about how Claude Code behaves during a task.
| What you see | Likely cause | What to do |
|---|---|---|
Nothing happens, or API Error: Repeated 529 Overloaded errors | The API is at capacity across all users, not your own usage limit | Check status.claude.com, wait a moment, or run /model to switch models (capacity is tracked per model) |
API Error: Request rejected (429) or API Error: 500 | A rate limit, or a server-side fault | Check the status page named in the error text, wait a minute, then retry |
| The session looks frozen and won't take input | A single command or tool call is hung, not the whole process | Press Ctrl+C; if that doesn't help, close the terminal and run claude --resume in the same directory to pick the conversation back up |
| Something changed after you added a plugin, hook or MCP server | A customization, not Claude Code itself | Run claude --safe-mode to start a session with CLAUDE.md, skills, plugins, hooks and MCP servers all turned off; if the problem disappears, one of those was the cause |
claude won't even start, or settings seem to be ignored | Installation or configuration, not runtime behavior | Run claude doctor from your shell (works even when a session won't start) or /doctor inside a session for a full checkup with proposed fixes |
If what you're actually dealing with is command not found: claude, a login loop, or a message about hitting a subscription or spend limit, that's an installation, login or usage-limit problem rather than one of the 10 below; those have their own fix paths in Anthropic's documentation. Everything from here on assumes Claude Code starts, you're signed in, and the API is reachable.
Error 1 - Claude Code Reverts Changes It Just Made
What you see: you ask Claude Code to build on a change from a few prompts ago, and it's gone, or back to an earlier version, with nothing having visibly failed.
Why it happens
Each new prompt gets Claude Code's own fresh read of the current files, not a memory of what it decided earlier in the conversation. If a file changed through something other than Claude Code's own edit, or an earlier plan was abandoned partway through, the next prompt can "correct" the file back toward whatever it expects, undoing work you wanted kept.
How to fix it
- Commit after any change you want to keep, before asking for the next feature. A real git commit, not just a save, gives you an instant diff or revert point.
- Keep each prompt scoped to the current step. "Continue from where you left off" invites Claude Code to reinterpret the state; naming the specific file and function doesn't.
- Put hard constraints in the repo-root
CLAUDE.md. It's the file Claude Code reads at session start; a subdirectory'sCLAUDE.mdonly loads on demand, when Claude Code reads another file in that subdirectory, so a rule you can't afford to lose belongs at the root.
What you should see: the next prompt builds on the committed state, and git diff shows only what you asked for.
Error 2 - Context Compaction Fires Mid-Feature
What you see: partway through a multi-step task, Claude Code forgets a constraint you set earlier, or you see Autocompact is thrashing: the context refilled to the limit repeated in the error text
Why it happens
Claude Code automatically compacts (summarizes) the conversation once the context window fills up, and a summary can drop a specific detail that was never written down anywhere else. The thrashing message is a distinct case: compaction succeeds, but a file or tool output immediately refills the window several times in a row, so Claude Code stops retrying rather than burn API calls on a loop that isn't converging.
How to fix it
- Keep anything you can't afford to lose in
CLAUDE.md(conventions, the current task's constraints), not only in the conversation. - Run
/compactproactively with a focus, for example/compact keep only the plan and the diff, instead of waiting for it to trigger on its own. - If you hit the thrashing message specifically, ask Claude Code to read the oversized file in smaller chunks (a line range or a single function) instead of the whole file, or move that piece of work to a subagent so it runs in its own context window.
- Run
/contextto see what's actually loaded. IfMessagesis the largest row, a tool output is refilling the window; if everything else is larger, trim what loads at session start.
What you should see: /context shows headroom again, and the constraint you set earlier still holds in the next response.
Error 3 - Claude Code Modifies Files Outside the Requested Scope
What you see: you ask for a change to one file or component, and the diff touches files you never mentioned.
Why it happens
A broad or feature-level prompt reads as permission to touch anything related to it. "Update the checkout flow" can be taken as license to edit every file that flow imports, not just the one you had in mind.
How to fix it
- Name the exact file or files in the prompt instead of describing the feature in general terms.
- Ask Claude Code to list which files it plans to touch before it makes the change, and approve that list first.
- List off-limits directories explicitly, either in the prompt or in
CLAUDE.md(for example, "don't touch anything under /app/legacy").
What you should see: the diff is limited to the files you named.
Error 4 - Permission Denials Breaking the Workflow
What you see: Claude Code stops on a permission prompt, or the same action keeps getting blocked even after you thought you'd approved it.
Why it happens
Permission settings merge across scopes, and the closer one wins: local overrides project, which overrides user. Managed settings from an organization apply first and can't be overridden from any of the other scopes. A rule you set in one file can be silently overridden by another scope without an obvious error.
How to fix it
- Run
/statusto see which settings sources are active, including whether managed settings are in effect. - If Claude Code can't reach a folder it needs, use
--add-dirto grant access explicitly, rather than approving the same prompt repeatedly. - Remember that a Bash deny rule matches the literal command string, not the underlying executable: a rule blocking
Bash(rm *)won't stop/bin/rmor a different way of invoking deletion. For a hard guarantee rather than a permission rule, use a PreToolUse hook or the sandbox.
What you should see: /status confirms the setting you expect is the one in effect, and the action runs, or stays blocked, only where you intended.
Error 5 - Generated Code Conflicts with Existing Architecture
What you see: new code duplicates a utility that already exists, or ignores the pattern the rest of the codebase follows.
Why it happens
Without being told your project's conventions, Claude Code writes in whatever pattern is most common for the language or framework, which isn't necessarily yours.
How to fix it
- Document conventions in
CLAUDE.md: naming, where utilities live, which libraries are already in use. This is exactly the kind of guidance CLAUDE.md is meant to hold, the same way you'd brief a new teammate on project conventions and where files belong. - Before generating something new, ask Claude Code to search for an existing implementation first.
- Review the diff for duplicated logic before merging, not after.
What you should see: new code reuses existing utilities and matches the surrounding style.
Error 6 - TypeScript Errors Accumulate Across Sessions
What you see: small type errors pile up across several sessions until a build finally fails with a long list at once.
Why it happens
A session can look clean within the files it touched while a type change elsewhere breaks a caller that session never opened.
How to fix it
- Run your type checker at the end of every session, not only before a deploy.
- Ask Claude Code to fix type errors as a dedicated pass, pointing it at the checker's output directly, rather than folding the cleanup into unrelated feature work.
- Keep the check in CI so a session can't silently ship a type error.
What you should see: the type checker runs clean at the end of each session.
Error 7 - Claude Code Gets Confused by Monorepo Structure
What you see: Claude Code edits the wrong package, or applies a rule that only one package follows to all of them.
Why it happens
Subdirectory CLAUDE.md files load on demand, when Claude Code reads another file in that subdirectory, rather than at session start. If a session never points Claude Code at a file inside a given package, that package's CLAUDE.md never loads, and Claude Code falls back to the repo-root file or to general conventions instead.
How to fix it
- State the target package by path in the prompt every time, rather than assuming Claude Code remembers which one you're working in.
- Keep a short structure map in the repo-root
CLAUDE.md(which folder is which package), since that file always loads at session start. - If you need a package's own
CLAUDE.mdto apply, ask Claude Code to read one file inside that package first so the subdirectory file loads before the real task begins.
What you should see: edits land only in the named package, and package-specific rules apply only there.
Error 8 - Token Limits Hit on Large Codebases
What you see: a session on a large codebase slows down, hits a context-window error, or Claude Code's own memory usage climbs.
Why it happens
There's a hard limit on how much the model can hold in context at once, and reading whole large files eats into it quickly.
How to fix it
- Narrow the scope: ask about a specific function or line range instead of an entire large file.
- Split large tasks into smaller ones so each session's context stays manageable.
- If a session's heap memory passes roughly 2.5GB, Claude Code shows a critical memory warning. Restart and run
claude --continueto resume the same conversation in a fresh process. - If memory stays high after restarting, run
/heapdump. It writes a heap snapshot and a diagnostics file to your desktop (your home directory on Linux, if there's no Desktop folder). The snapshot contains your full conversation and credentials, so don't attach it to a public issue; share only the-diagnostics.jsonfile if you're reporting it.
What you should see: /context shows headroom, and repeat sessions on the same codebase stop climbing in memory.
Error 9 - Claude Code and Cursor Running on the Same Project
What you see: two AI coding tools editing the same files produce conflicting changes, or one tool's edit gets silently overwritten by the other.
Why it happens
Neither tool knows the other is active; each assumes its own pending changes are the only ones.
How to fix it
- Commit, or at least stage, before switching tools, so each one starts from a clean, known state.
- Assign ownership per task or per file, not per session: decide which tool is doing a given piece of work before you start it.
- Diff after switching tools, not only at the end of the day.
What you should see: each tool's changes land on top of a clean, committed base, with no silent overwrites. If Cursor itself is the one acting up, see the Cursor troubleshooting guide.
Error 10 - Autonomous Changes That Are Hard to Audit or Revert
What you see: after a long agentic session, the diff is large enough that it's hard to tell what changed or why, and reverting means losing everything since the last commit.
Why it happens
Letting Claude Code run many steps unsupervised produces one large diff instead of a trail of small, reviewable ones.
How to fix it
- Commit after each meaningful step, not only at the end of the session. Every commit is a point you can return to.
- Keep sessions focused on one feature or fix so the resulting diff stays reviewable.
- For a single session where you want fewer autonomous side effects to review, scope prompts tightly or start it with
claude --safe-modeif plugins or hooks are adding unreviewed behavior of their own.
What you should see: git log shows a trail of small, named commits instead of one large, unreviewable diff.
Common Misunderstandings About Claude Code
- Claude Code doesn't notice a file you changed outside it in the same session unless you ask it to re-read that file. Editing in your IDE while a task is mid-flight can leave Claude Code working from a stale view.
- "Stuck thinking" isn't always frozen. Long reasoning or a large tool call before the first token appears can look identical to a hang, especially right after compaction; give it a minute before assuming it's stuck.
--safe-modedisables your customizations for that one session only. It doesn't deleteCLAUDE.md, plugins, hooks or MCP configuration; they're back in your next normal session.- A 529 or 429 error isn't a sign that your account or your own usage is the problem. 529 specifically means capacity across all users, and doesn't count against your usage limit.
When It Isn't a Bug
- Claude Code deliberately withholds certain changes without your confirmation, such as destructive commands or broad deletions. That's the permission system working as designed, not a malfunction.
- Being prompted to switch models under high load ("please use /model to switch to Sonnet") is the system protecting overall response time, not an error in your setup.
- A Markdown table with more than 200 rows shows only the first 200 in the terminal by design. The full table stays in the conversation; ask Claude Code to write it to a file if you need the rest.
What to Include When You Ask for Help
- The exact error text, not a paraphrase. 529 and 429 look similar but mean different things.
- The output of
claude --versionand your operating system. - Whether the problem still happens under
claude --safe-mode, which rules out a plugin, hook or MCP server as the cause. - The relevant part of
claude doctoror/doctoroutput. - If it's memory-related, the
-diagnostics.jsonfile from/heapdump, never the raw heap snapshot, since that one holds your conversation and credentials.
FAQ
Is Claude Code down right now?
Check status.claude.com first. Claude Code shows the same status when it hits capacity, with the message "API Error: Repeated 529 Overloaded errors." A 529 means the API is at capacity across all users, not a problem with your account or your own usage limit.
What do the 429 and 529 errors actually mean?
529 means the API is at capacity. 429 means you, your API key, or your cloud provider project hit a rate limit. Both point to a status page in their error text, so check that before assuming the cause is local to your machine.
Claude Code crashed or I had to force-close it. Did I lose my work?
Usually not. Closing a frozen terminal and running claude --resume in the same directory picks the conversation back up. If the crash came from the running binary itself becoming unreadable, such as on network storage, start a new session instead; your files on disk aren't affected by a crashed session either way.
Why does Claude Code say it's "not responding" in VS Code?
First confirm whether the CLI itself is stuck, by testing it from a plain terminal, or whether it's only the VS Code integration. Restarting the extension or reloading the window rules out the integration as the cause. If the CLI itself is genuinely hung, treat it like any other freeze: Ctrl+C, then restart and run claude --resume if needed.
Sources
- Debug your configuration - Anthropic, consulted 2026-10-15
- Troubleshooting - Anthropic, consulted 2026-10-15
- Error reference - Anthropic, consulted 2026-10-15
- status.claude.com - Anthropic's live status page
- AppStuck's Claude Code page for what else can go wrong once Claude Code is working correctly
- Claude Code MCP not working if the problem is specifically an MCP server
Stuck with Claude Code?
AppStuck fixes, finishes and ships Claude Code apps.
See how we fix Claude Code apps