[BUG] Sandbox silently prevents cmake/ninja builds without error on Linux

Resolved 💬 3 comments Opened Mar 24, 2026 by marbub Closed Apr 22, 2026

Description

When running cmake --build via the Bash tool with sandbox enabled, the build silently produces no output and skips compilation of changed source files. No error message is shown — the command exits successfully with exit code 0. Running the same command with dangerouslyDisableSandbox: true compiles correctly.

Steps to Reproduce

  1. Have a cmake project with a build directory under /tmp/claude-1000/ (which is in the sandbox write allowlist)
  2. Edit a source file using the Edit tool (file mtime is updated)
  3. Run cmake --build --preset gcc-debug --target <target> via Bash tool (sandbox enabled)
  4. Observe: no output, no compilation, exit code 0
  5. Run the same command with dangerouslyDisableSandbox: true
  6. Observe: files compile correctly

Expected Behavior

Either:

  • The build works within the sandbox (the build directory is in the write allowlist), OR
  • A clear permission/sandbox error is shown so the user knows compilation was blocked

Actual Behavior

The command silently succeeds with no output, as if nothing needed to be compiled. This is misleading because:

  • The source file was modified (mtime updated by Edit tool)
  • cmake/ninja should detect the change and recompile
  • No error is reported

Environment

  • Platform: Linux (Fedora 43, kernel 6.19.8)
  • Build system: cmake + ninja
  • Build directory: /tmp/claude-1000/designer/ (in sandbox write allowlist)
  • Source directory: /var/home/marco/dev/design_studio/designer/ (in sandbox read allowlist)
  • Claude Code model: claude-opus-4-6

Notes

  • The sandbox filesystem write allowlist includes /tmp/claude-1000/ and . (current working directory)
  • The ninja build subprocess may be spawning child processes that are blocked by the sandbox without propagating errors
  • This may be related to #35699 (sandbox silently reverting writes) but occurs on Linux with build tools rather than macOS with Edit tool

View original on GitHub ↗

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