[BUG] Sandbox cwd tracking still causes "Exit code 1" on successful commands (regression from #11480)

Resolved 💬 4 comments Opened Feb 3, 2026 by dmordovskoy Closed Mar 3, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Issue #11480 was marked as completed on Dec 6, 2025, but the bug still persists. Successful bash commands display
"Error: Exit code 1" because zsh writes working directory tracking files to paths outside the sandbox-allowed
directory.

## Actual Behavior

● Bash(git status)
└ Error: Exit code 1
zsh:1: operation not permitted: /tmp/claude-501/cwd-xxxx

On branch main
nothing to commit, working tree clean

The command succeeds, but shows "Error: Exit code 1" due to zsh failing to write to /tmp/claude-501/cwd-*.

What Should Happen?

Successful commands should show success, not error. Either:

  • Allow writes to /tmp/claude-*/ patterns (not just /tmp/claude/)
  • Or suppress the misleading error when command output indicates success

Error Messages/Logs

Error: Exit code 1
     zsh:1: operation not permitted: /tmp/claude-501/cwd-2714

     [main ...] fix(data): remove destructive dataVersion reset logic
      1 file changed, 3 insertions(+), 12 deletions(-)

Steps to Reproduce

  1. Enable sandbox mode (default)
  2. Run any bash command (e.g., git status, git commit)
  3. Observe error output despite command succeeding

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.29

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Related Issues

  • #11480 (marked completed but issue persists)
  • #15150 (similar sandbox permission denied issues)

View original on GitHub ↗

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