[Bug] Permission denied error on every Bash command after macOS upgrade

Resolved 💬 3 comments Opened Oct 4, 2025 by TheLazyIndianTechie Closed Oct 7, 2025

Bug Report: Permission Denied Error on Every Bash Command

Description

Every bash command execution displays a permission denied error for a temporary working directory file, even though commands execute successfully. This error appeared after upgrading macOS.

Error Message

zsh:1: permission denied: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/claude-XXXX-cwd

This error appears on every single bash command execution, making the terminal output cluttered and difficult to read.

Environment

  • Claude Code Version: 2.0.5
  • macOS Version: 15.7.1 (Build 24G231)
  • Shell: zsh (/bin/zsh)
  • Temp Directory: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/

Steps to Reproduce

  1. Upgrade macOS to version 15.7.1
  2. Run any bash command through Claude Code's Bash tool
  3. Observe permission denied error appears before command output

Example

# Command
pwd

# Output
zsh:1: permission denied: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/claude-c0e6-cwd

/Users/vinayvidyasagar/Dev/LazyGameDevs/LazyLearners

Expected Behavior

Commands should execute without permission errors.

Actual Behavior

Every bash command shows a permission denied error for the temporary claude-XXXX-cwd file before showing the actual command output.

Analysis

  • The /var/folders/.../T/ directory exists and is accessible
  • The error occurs when Claude Code's Bash tool tries to create/write to a tracking file claude-XXXX-cwd
  • Commands still execute successfully despite the error
  • The issue appears to be with the temporary directory permissions after macOS upgrade

Impact

  • High annoyance factor - every command shows the error
  • Makes terminal output difficult to read
  • Reduces developer productivity due to visual clutter
  • No functional impact - commands execute successfully

Possible Root Cause

Claude Code's Bash tool implementation creates a temporary file to track the current working directory. After macOS upgrade, permissions on the system temp directory may have changed, preventing write access to these tracking files.

Suggested Fix

  1. Add proper error handling to suppress permission errors for the cwd tracking file
  2. Use an alternative method for tracking working directory that doesn't require writing to system temp directories
  3. Fall back to a user-writable temp location if system temp is unavailable
  4. Make the cwd tracking file creation optional with graceful degradation

Workarounds Attempted

  • None currently available without sudo access to system directories
  • Restarting Mac may help but not confirmed
  • The error is cosmetic and doesn't prevent functionality

Additional Context

This appears to be a Claude Code internal implementation detail that users cannot modify. The error message format suggests it's written directly to stderr before the bash command executes.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗