Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By technicalpicklesv0.3.0MITIn 1 marketplace
Turns Claude Code sandbox permission errors from failed Bash commands into advice to either re-run unsandboxed or fix the problem inside the sandbox. It runs automatically after each failed Bash command, only adds a message, and stays silent for other failures.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A PostToolUseFailure hook that, when a Bash command fails, tells you whether it
failed because of a known Claude Code sandbox limitation, and what to do about
it. The message is advisory, not a directive.
Knowledge lives in a failure-mode registry. When a Bash command fails, the hook identifies the mode in two passes:
The advice prefers a fix that works inside the sandbox. Unsandboxing is named only for modes with no in-sandbox fix.
| Mode | Example failure | Advice |
|---|---|---|
git-path-deny | unable to create file .mcp.json: Operation not permitted | Re-run unsandboxed. These paths (.git/config, .git/hooks/*, .claude/agents/*, .claude/commands/*, .mcp.json, .vscode/*, .idea/*, .gitmodules, shell rc files) are denied regardless of allowWrite. A worktree create that died partway already made the branch, so retry without --create/-b. |
git-cwd-scope | Unable to create '/other/repo/.git/index.lock': Operation not permitted | EnterWorktree into that repo, then re-run sandboxed. Write access is anchored to the session's working directory, and a shell cd or git -C doesn't move it. Detected by the lock path (or cd/-C target) falling outside the hook payload's cwd. |
git-worktree-delete | failed to delete '.../worktrees/x': Operation not permitted | Re-run unsandboxed; if the directory survives, /bin/rm -rf it (plain rm is often a trash alias). |
git-write | any other git write EPERM | Identify the case first: EnterWorktree if the repo is outside the working directory, unsandbox if it's a denied path. |
git-ssh | ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535, port 22: Operation not permitted | Raw TCP to port 22 is blocked. If agent SSH goes through a local relay (an ssh ProxyCommand to an allowlisted localhost proxy), check and restart the relay. With no relay, re-run unsandboxed. Don't switch the remote to HTTPS: that pushes with a different credential than the SSH key. |
srb | mdb_error="Operation not permitted" | Re-run unsandboxed. Sorbet's LMDB store uses SysV semaphores the sandbox denies, even with no cache dir. |
keychain-write | writing destination keychain, SecKeychainItemCreateFromContent ... Operation not permitted | Re-run just the write step unsandboxed; reads work sandboxed afterward. |
bun-tmpdir | bun is unable to write files to tempdir: EPERM | Re-run with BUN_TMPDIR="$TMPDIR". No unsandbox needed. |
gem-spec-cache | Operation not permitted @ dir_s_mkdir - ~/.cache/gem/specs | Re-run with GEM_SPEC_CACHE="$TMPDIR/gemspecs". No unsandbox needed. |
ps-top | operation not permitted: ps | Re-run unsandboxed (setuid binaries; read-only and safe). |
Otherwise it stays silent. Adding a mode is a registry entry (fingerprints, optional command matcher, advice) plus a corpus case.
A command-name guard mis-fires: git add fails sandboxed only a few percent of
the time. Acting on the actual failure means a command that succeeds sandboxed
is never touched, so the hook can never cause a false sandbox bypass.
Auto-mode already retries unsandboxed for you. That's the problem this hook works against: a reflexive unsandbox retry "works" for a cwd-scope mismatch or a down SSH relay too, and hides the real fix. The advice lands at the moment of failure, which is when that reflex kicks in. It also covers contexts where a hard EPERM is a stall instead of a recovery: subagents, cron/headless runs, and sessions not on auto-mode.
tests/fixtures/replay-corpus.jsonl is the regression corpus: failure shapes
taken from real sandboxed sessions (paths rewritten), each labeled with the mode
the hook should pick or null for silence. It includes the false positives the
replay turned up, like an index.lock: File exists from a concurrent git
process.
To check a change against your own sessions, export failed sandboxed Bash calls
as JSONL ({"command", "error", "cwd", "unsandboxed"}, one per line) and run:
python3 tools/replay.py failures.jsonl # counts per mode
python3 tools/replay.py failures.jsonl --show git-cwd-scope # the calls behind one mode
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub technicalpickles/pickled-claude-plugins --plugin sandbox-advisorPlugins from other owners that cover similar ground