Claude Code “Permission Denied” — Causes & Fixes

Start with the exact resource that failed. EACCES or EPERM plus a local path points to operating-system access; “publickey” or a remote URL points to Git or SSH authentication; an approval or sandbox message points to Claude Code policy. Fix only that layer instead of widening permissions everywhere.

2494 related issues · 481 open · 2013 resolved · peaked at 481 open (2026-08)

Fast diagnosis

What to do now

  1. Classify the error: Copy the complete message and identify whether it names a local path, a Git remote or SSH key, or a Claude Code approval or sandbox rule.
  2. Reproduce outside Claude Code: Run the same read-only check or failing command in your normal terminal. If it fails there too, investigate the operating system or Git; if it fails only inside Claude Code, inspect the tool permission and sandbox decision.
  3. Repair the narrowest access boundary: For a local path, verify the owner and required read, write, or execute bit on that path and its parent directories. For Git or SSH, verify the selected remote and key. Grant only the access the operation needs.
  4. Retry without privilege escalation: Repeat the original operation as your normal user. Avoid running Claude Code with sudo or applying recursive world-writable permissions, which can hide the cause and create a larger security problem.

Reference: Claude Code troubleshooting

Backlog trend over time

0 120 241 361 481 2025-022025-082026-022026-08
2025-02 — First reports2026-04 — Most new reports (456)2026-08 — Peak backlog (481 open)

The line shows how many issues in this topic were open at the end of each month, derived by counting each issue from its creation date until it was closed. First-party data from the anthropics/claude-code tracker.

Common questions

Why does Claude Code say “permission denied”?
The message can come from three different layers: filesystem ownership or mode bits, Git or SSH authentication, or Claude Code tool and sandbox policy. The resource named in the complete error identifies which layer to test first.
Should I run Claude Code with sudo to fix EACCES?
No. Running the whole agent as root gives every command more access than it needs. Correct ownership or the specific permission on the failing path, then retry as your normal user.
Is “Permission denied (publickey)” a filesystem error?
Usually not. That wording comes from SSH authentication. Verify the Git remote, account access, and selected SSH key independently in a normal terminal before changing local file permissions.

All permission denied errors issues

Ranked by community engagement (reactions and comments).