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.

  1. Read the first path in the error and verify that it exists and belongs to the expected user.
  2. Check disk space, permissions, symlinks and whether another process holds the target.
  3. 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.

0 5 11 16 21 2025-032025-092026-032026-08
2025-03 — First reports2025-09 — Most new reports (14)2025-12 — Peak backlog (21 open)

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:

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

Related aggregations

  1. ENOENT: no such file or directory

    1,200 issues
  2. EISDIR: illegal operation on a directory

    495 issues
  3. EACCES / EPERM: permission denied

    415 issues
  4. EEXIST: file already exists

    138 issues
  5. EBUSY: resource busy or locked

    127 issues
  6. EXDEV: cross-device link not permitted

    91 issues