Claude Code Bash tool hits E2BIG when sandbox profiles scale with large git worktrees

jkMLnop · ghdev · 2026-07-17

A Claude Code bug report shows Bash tool calls failing with spawn E2BIG whenever the working directory is inside a non-trivial git repository.

Main finding

The command itself is not the problem. The compiled sandbox filesystem policy grows with the repository's working-tree file count until the OS argument-length limit is exceeded. The report says the error mentions around 187 filesystem deny paths and a compiled profile around 1–1.1 MB.

Repro pattern

The failure appears to require both of these conditions:

Observed behavior:

What was ruled out

The reporter says they tested and eliminated several plausible causes, including:

The report concludes that the pattern is robust, but the exact internal code path still needs source access to identify.

Original post →

More from coding & agent

coding & agent channel →