Bash tool leaks 'mkdir: Permission denied' to stdout on every command (Linux, bwrap sandbox)

Resolved 💬 2 comments Opened Feb 10, 2026 by xdddddddx Closed Mar 11, 2026

Description

Every Bash tool invocation appends mkdir: Permission denied to its output on Linux. The error is cosmetic — all commands execute correctly — but it pollutes every single command result.

Environment

  • Claude Code version: 2.1.38 (native install, Bun binary)
  • OS: Ubuntu, Linux 6.17.0-14-generic (x86_64)
  • Platform: Wayland/GNOME, running in Terminator terminal
  • Sandbox: bwrap (bubblewrap) enabled, seccomp enabled

Reproduction

Every Bash tool call produces the extra line:

$ echo "hello"
hello
mkdir: Permission denied

Even with a completely clean environment:

$ env -i /bin/bash --norc --noprofile -c "echo clean"
clean
mkdir: Permission denied

Investigation

  • The error does not come from any shell config (.bashrc, .profile, hooks, aliases, etc.) — it persists with env -i bash --norc --noprofile.
  • It does not come from /usr/bin/mkdir — a PATH-intercepting wrapper and strace -f -e trace=mkdirat on the bash process show zero mkdir syscalls from the user shell.
  • The error format (mkdir: Permission denied without a path) matches Bun's built-in shell mkdir implementation, not the system mkdir (which would say mkdir: cannot create directory '/path': Permission denied).
  • The error originates from the Claude Code parent process (the Bun binary), likely during sandbox (bwrap) setup or teardown for each Bash tool invocation.
  • ptrace on the Claude process is blocked, so the exact failing path could not be determined.
  • Setting CLAUDE_TMPDIR and pre-creating /tmp/claude did not resolve the issue.

Expected behavior

Bash tool output should not contain internal sandbox setup errors.

Workaround

None found. The error is cosmetic and does not affect command execution.

View original on GitHub ↗

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