ENOTEMPTY: directory not empty
A remove or rename targeted a directory that still has contents.
88 issues · 9 open · 79 resolved (90%) · first seen Mar 5, 2025
First response · local
What to do now
Most likely: The operating system rejected a file or directory operation.
- Read the first path in the error and verify that it exists and belongs to the expected user.
- Check disk space, permissions, symlinks and whether another process holds the target.
- Reproduce with the smallest affected path before changing project-wide permissions.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is holding steady. 11 new reports in the last 90 days vs 10 in the 90 before — +10%. The open backlog peaked at 21 in 2025-12 and sits at 9 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
23 of these reports name the Claude Code build they were running, spanning 20 releases. Heaviest reporters:
- Claude Code v2.1.236
- Claude Code v2.1.119
- Claude Code v2.1.132
- Claude Code v2.1.237
- Claude Code v2.1.233
- Claude Code v2.1.225
- Claude Code v2.1.117
- Claude Code v2.1.29
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 4 days across 79 closures. Of the 79 closures with a recorded reason, 25% were closed as completed and 59 as not-planned or duplicate. The most recent completed fix landed in 2026-06.
Workarounds reported by the community
19 of these issues post a workaround someone says worked. The highest-engagement ones:
- Long Context Beta Not Available for Current Subscription
- …multi-session continuity protocols specifically designed to work around current context limits. When I configure the 1M "model" I receive: "The long context beta is not yet available for this subscription." I'll be happy…
Found in the thread of #6871 · still open - [BUG] ✗ Auto-update failed · Try claude doctor or npm i -g @anthropic-ai/claude-code
- …m global directory (check with npm config get prefix). This workaround resolves the immediate issue, but the underlying npm bug remains unfixed.
Found in the thread of #996 · still open - [BUG] Claude command intermittently becomes unavailable ("command not found") with ENOTEMPTY errors preventing reinstallation on Ubuntu 24.04
- …- Issue matches reported bug 471 affecting multiple users - Workaround: Use full path or wait for it to randomly fix itself - Shell command cache may be involved (requires to clear) This appears to be a systematic issue…
Found in the description of #1682 · resolved - Bug Report :: When Update keeps giving me please wait and try again later
- …64 (kernel 6.8.0-88-generic) - Claude Code version: 2.0.55 Workaround: This suggests the lock cleanup issue affects multiple locations: 1. (original issue) 2. (mentioned in 559) 3. (this case) It appears Claude Code's u…
Found in the thread of #6200 · still open - [Bug] Auto-update fails with npm ENOTEMPTY rename error
- …tiple instances simultaneously 4. Package corruption occurs Workaround Applied Disabled auto-updates to prevent race condition: Suggested Fix 1. Mutex/lock file before triggering auto-update to prevent concurrent updates…
Found in the thread of #7373 · resolved
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 1–88
Ranked by community engagement (reactions weighted over comments).
- Long Context Beta Not Available for Current Subscription
- [BUG] ✗ Auto-update failed · Try claude doctor or npm i -g @anthropic-ai/claude-code
- [BUG] Claude command intermittently becomes unavailable ("command not found") with ENOTEMPTY errors preventing reinstallation on Ubuntu 24.04
- Automatic Update Mechanism Failure
- Bug Report :: When Update keeps giving me please wait and try again later
- [Bug] Auto-update fails with npm ENOTEMPTY rename error
- [BUG] Recurring auto-update failures with ENOTEMPTY error
- [Bug] npm Install Fails: ENOTEMPTY Error During Global Package Update
- Auto-update fails repeatedly with ENOTEMPTY error on macOS with nvm
- [BUG] Auto-update to 2.1.237 leaves broken stub on Windows: claude-code-win32-x64@2.1.237 missing from npm registry (incomplete release)
- [BUG] Problems updating 1.0.58 -> 1.0.59
- [BUG] claude was corrupted/removed durring an active session and unable to re-install
- [Bug] Auto-update fails with ENOTEMPTY on macOS 15+ due to stale temp directories and extended attributes
- [BUG] False positive "Config mismatch" warning when installation method matches
- [Bug] Anthropic API Error: 500 Internal Server Error
- Bug Report
- [Bug] Claude Code is not working since Sept 30 | Anthropic API Error: Unexpected Usage Policy Violation Blocking Existing Session
- [Bug] Multiple concurrent instances cause version downgrade (2.0.70 → 2.0.65)
- Raw mode terminal issue - Claude Doctor
- [Bug] rm -rf command deletes unintended parent directory contents
- [Bug] Anthropic API Error: Unexpected 500 Server Response
- Auto-update fails with ENOTEMPTY error on repeated attempts
- [BUG] Upgrade command communicated fails
- [Bug] Anthropic API Error: Internal server error (500)/
- [Bug] Phantom File Edits: No Actual Changes Persisted
- 5-hour limit reached ∙ resets 10:30pm
- Bug Report: Potential Unintended Behavior Causing Project Loss
- Browser Error Detection Fails in Containers
- [BUG] Cleanup sweep calls rmdir on every directory under ~/.claude/projects, deleting foreign empty directories and ignoring cleanupPeriodDays
- `claude update` fails with generic error when stale temp directory exists from previous failed update
- [Bug] Dual CLI sessions unintentionally switch git branches when working on same repository
- [Feature Request] Reduce response pacing to keep clarification questions near input prompt
- Invalid Base64 PDF Encoding in File Read Operation
- [Bug] Claude Code does not support Opus 4.8 and Fable models
- [BUG] Ran out of disk space in a session. Claude code now broken.
- [BUG]
- Proposed GitHub Issue Title: `/cost Command Reporting Unclear for Claude Max Subscribers` This title: - Directly identifies the specific feature/command - Highlights the core issue of reporting ambiguity - Uses technical terminology - Is concise and descr
- "Context Window Tracking Failure: Incorrect Zero Context Remaining" This title captures the technical nature of the issue (context window tracking), specifies the specific problem (showing zero context remaining), and indicates the unintended consequence
- [Bug] CLI hangs indefinitely during initialization or processing
- [BUG] v2.1.150 darwin-arm64: npm install silently truncates native binary (~213 MB → ~63 MB), causing "killed" on launch and auto-update infinite loop
- [BUG]
- [Bug] Auto-update mechanism fails silently
- [Bug] Data Loss: Claude Code deleted important files from user system
- [Bug] Auto-update failed with npm installation error
- Auto-updater has a design flaw that causes silent...
- [Feature Request] Add Chrome flag support for WSL environment
- [FEATURE] Failed auto-update leaves stale temp directory, blocks reinstall with opaque npm error
- [Bug] Auto-update failed with no diagnostic output from claude doctor
- [Bug] /usage command unavailable for Claude Max subscription users
- [Bug] Incorrect "low context" warning on fresh conversation start
- [Feature Request] Display git diff in VSCode when suggesting or validating edits
- [Bug] Anthropic API Error: Request exceeds maximum size (413)
- [Feature Request] Project-level plan file storage path configuration
- [Bug] Claude randomly inserts unexpected code during generation
- [Bug] Bug Report: Unable to process empty input
- Auto-update fails with ENOTEMPTY when multiple CLI instances are running
- [Bug] Anthropic API Error: Request Size Limit Exceeded (413)
- Limit Counter Fails to Reset Across Daily Cycle
- [Bug] Auto-update failure loop with persistent error message reappearing hourly
- [Bug] /usage Command Fails to Display Usage Information
- [Bug] Anthropic API Error: Invalid Request Parameters
- API Token Quota Tracking Inconsistency in Claude Code
- Anthropic API Usage Limit Error Triggered Incorrectly
- [Bug] Disk Space Exhaustion: File Write Failure (ENOSPC)
- [Bug] /status Command Fails to Display Usage Allocation Metrics
- Bug Report
- [Bug] Auto-update fails after configuration changes
- [BUG] Can't run, uninstall or run claude
- Missing Tool Result Block for Tool Use ID toolu_014jkovWfT7ErX1UxAKuxGPs
- Unhandled Exception in Diff Processing Triggered in cli.js
- Local Claude Installation Fails with Persistent Update Prompt
- Terminal Editing Broken in IntelliJ IDEA on macOS Sequoia
- Background auto-updater lacks a post-install effectiveness check — five identical same-version reinstalls in 109 min when the running copy isn't the prefix install
- [Bug Report] Unclear issue description
- You've hit your limit · resets 11:40am (Asia/Tokyo)
- [BUG] Auto-Update Fails and Corrupts Installation When Claude Sessions Are Running
- [Bug] VS Code Crash During Large Code Changes, Installation Failure
- [Bug] Claude Code: Ignores Specified Instructions in Configuration File
- [BUG] Upgrades via NPM fail
- NPM Installation Failure for Claude Code Package This title captures the core issue of the user experiencing an NPM installation error when trying to install or update the Claude Code package, specifically related to a directory rename operation.
- Concurrent `claude` sessions racing on npm-global auto-update causes ENOTEMPTY + missing native binary
- [Feature Request] Improve markup tool accuracy and performance
- [Bug] Auto-update failed - npm installation error
- [Bug] Unable to update Claude Code CLI
- [BUG]
- [BUG] /feedback command not working
- Inference Stall: Model Generates Plan but Fails to Execute Actions
- [BUG] npm global update leaves a stub binary and no bin/claude symlink — no rollback, and the error message is unreachable