How to Fix Claude Cowork Common Errors (Permission Denied, Exit Code 127)

Published July 9, 2026

If you've been using Claude Cowork to automate your local tasks, write code, or manage your Obsidian notes, you've likely experienced the sheer magic of delegating a multi-step task and coming back to finished work.

But because Cowork runs inside a secure, sandboxed environment on your local machine, it is heavily dependent on system paths, shell execution policies, and operating system permissions. When things go wrong, you are often hit with cryptic shell warnings or permission prompts.

In this guide, we break down the most common Claude Cowork errors—from macOS sandboxing alerts to tool execution crashes—and provide exact, step-by-step instructions to fix them and keep your workflows running smoothly.


1. macOS Error: "Claude can't read this folder"

One of the most frequent errors macOS users face occurs right after clicking Add Folder in the Claude Desktop app:

"Claude can't read this folder. Grant access in System Settings → Privacy & Security → Files and Folders."

Why It Happens

macOS utilizes a strict security framework called TCC (Transparency, Consent, and Control). By default, applications cannot read sensitive user directories—including Desktop, Downloads, Documents, or external network drives—without explicit user consent. If Claude attempts to scan a folder inside these directories before receiving permission, the operating system blocks the request, resulting in a read failure.

How to Fix It

  1. Click the Apple menu in the top-left corner of your screen and select System Settings.
  2. Scroll down and click on Privacy & Security in the left sidebar.
  3. In the right panel, find and click on Files and Folders.
  4. Locate Claude (or Claude Desktop) in the list of applications.
  5. Click the toggle next to the directory you want Claude to access (e.g., Documents Folder or Downloads Folder) to turn it ON.
  6. Restart the Claude Desktop app for the changes to take effect.

[!TIP] Tired of repeated prompts? If you frequently work with files across various directories, go to System Settings → Privacy & Security → Full Disk Access, click the + icon, and add Claude to the list. This grants Claude permission to read/write across all local directories without repeatedly triggering OS prompts.


2. Command Error: "zsh: permission denied: claude"

If you try to trigger Claude from the command line or run a script inside a Cowork session, you might encounter the following shell exception:

zsh: permission denied: claude

Why It Happens

This error typically points to one of two root causes:

  1. Executable Permissions: The CLI file or wrapper script being invoked does not have executable (+x) permissions set in its Unix file metadata.
  2. Directory Ownership: The folder where you are trying to install or execute the tools is owned by the root user, meaning your current terminal session user cannot write to or execute binaries within that space.

How to Fix It

Step 1: Grant Executable Rights

If you are running a local script or tool wrapper, navigate to the target directory in your terminal and run:

chmod +x /path/to/claude

Replace /path/to/claude with the actual path to the binary or script you are executing.

Step 2: Fix Global NPM Directory Permissions

If you installed the command-line interface globally via npm and run into permissions warnings, avoid using sudo. Instead, fix the directory ownership so your user owns the npm directories:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

3. Tool Crash: "Exit Code 127" (Command Not Found)

During automated tasks, Cowork might attempt to run a command (such as npm install, python, or git commit) and suddenly crash with this message:

"Tool execution failed with exit code 127."

Why It Happens

In Unix-based operating systems, Exit Code 127 is the standard system exit status for "Command not found". It means the shell tried to run a tool, but that tool was not installed on your system, or its executable path was not included in the environment's PATH variable when Cowork spun up its execution sandbox.

This is particularly common if you use version managers like nvm (Node.js), pyenv (Python), or rbenv (Ruby) — these add binaries to your $PATH via .zshrc, which may not be sourced inside a sandboxed sub-shell.

How to Fix It

Step 1: Verify the Tool is Installed Locally

Open your system terminal and check if the command exists by typing:

which git
# or
which npm
# or
which python3

If the command returns blank, the tool is not installed on your computer. You must install it (e.g., install Git, Node.js, or Python) before Claude Cowork can use it.

Step 2: Find the Absolute Path

Once confirmed installed, get the exact path:

which npm
# → /Users/you/.nvm/versions/node/v20.11.0/bin/npm

Step 3: Pass the Correct PATH in Your Brief

If the tool is installed but Claude still outputs exit code 127, it means the sandbox cannot locate it. You can explicitly guide Claude in your prompt:

Run the build script. Note that my local node binary is located at /usr/local/bin/node. Ensure you invoke it using the absolute path.

[!TIP] Apple Silicon Mac? Homebrew installs to /opt/homebrew/bin/ instead of /usr/local/bin/. If Claude can't find Homebrew tools, use the full /opt/homebrew/bin/your-tool path in your prompt.


4. Context Overflow: "Stale Context Warning"

As your automation task grows larger—especially when scanning massive codebases or large Obsidian vaults—you might receive a warning that the context is stale or that you have exceeded the prompt limit.

Why It Happens

Claude Desktop Cowork operates within a large but finite token window. Every time Claude reads a file, lists a directory, or executes a terminal tool, that input history is appended to the current conversation context. If you let Claude run on a complex task for 40+ steps, the token history builds up, causing slower responses, higher resource usage, or a context block.

How to Fix It: The Context Loop Pattern

Instead of letting Claude guess its progress or re-read files repeatedly, implement a progress-tracking file named context.md in the root of your workspace folder.

  1. Create a context.md file.
  2. In your brief, instruct Claude:

    "At the end of each sub-task, read and update context.md with: 1) What you have accomplished, 2) Current state of the files, and 3) Next actions. If the session times out, I will restart the task by pointing you to read this file."

  3. If the conversation hits a token limit, you can simply open a fresh Cowork window, point it to the same directory, and prompt:

    "Read context.md to restore your state, and continue execution from where you left off."

See the full Context Loop Pattern guide for more advanced techniques.


5. Frequently Asked Questions (FAQ)

Q: When I point Cowork at a working folder, what does that enable?

When you add a folder to Claude Cowork, it allows Claude to read, create, and edit files there directly, without an upload or download step. The files are modified in place on your local system inside a secure, monitored sandboxed session. Your contents are not copied to Anthropic servers for model training.

Q: What is the difference between Cowork and Claude Code?

  • Claude Code is a developer-focused CLI tool that runs directly inside your developer terminal.
  • Claude Cowork is a user-friendly GUI interface built directly into the Claude Desktop App. It is designed for knowledge workers to automate document organization, research summaries, and second-brain management.

Q: Where can I find more specific error fixes?

For deeper dives into individual errors, visit the Error Code Library which covers git merge conflict loops, npm dependency hell, rate limit errors, and more.