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 withenv -i bash --norc --noprofile. - It does not come from
/usr/bin/mkdir— a PATH-intercepting wrapper andstrace -f -e trace=mkdiraton the bash process show zeromkdirsyscalls from the user shell. - The error format (
mkdir: Permission deniedwithout a path) matches Bun's built-in shellmkdirimplementation, not the systemmkdir(which would saymkdir: 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.
ptraceon the Claude process is blocked, so the exact failing path could not be determined.- Setting
CLAUDE_TMPDIRand pre-creating/tmp/claudedid 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗