claude-code - 💡(How to fix) Fix [FEATURE] Monitor needs to respect `sandbox.excludedCommands` and have a `dangerouslyDisableSandbox` option [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56030Fetched 2026-05-05 05:59:59
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2renamed ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The Monitor tool cannot be run outside the sandbox, which makes it unusable for monitoring commands that require host access. Specifically:

  • Bash accepts a dangerouslyDisableSandbox parameter and honors sandbox.excludedCommands from settings.json. Monitor honors neither — there is no
    per-call escape hatch and no way to allowlist a command.
  • Concrete use case: I want a Monitor that tails GCP logs via gcloud logging read / gcloud beta run services logs tail. gcloud only authenticates
    correctly when run outside the sandbox (I have it in excludedCommands for exactly this reason, and it works fine via Bash).
  • The result is that any "watch this stream" workflow that depends on host auth, host networking, or a credential helper has to be done with Bash run_in_background polling instead of Monitor, which defeats the purpose of the tool.

Proposed Solution

Bring Monitor to parity with Bash for sandbox handling:

  1. Accept a dangerouslyDisableSandbox: true parameter on Monitor calls, with the same approval/prompting UX as Bash.
  2. Honor sandbox.excludedCommands from settings.json — if the monitored command matches the allowlist, run it outside the sandbox automatically (same
    matching rules as Bash).
  3. Document this in the Monitor tool description so the model knows it's an option (currently the tool docs don't mention sandboxing at all).

Alternative Solutions

  • Bash with run_in_background + polling — works, but loses Monitor's streaming/notification semantics; I have to read the log file periodically instead of reacting to new lines, and it eats more context.
  • Piping gcloud output to a file from a sandbox-disabled Bash call, then Monitor-ing the file — fragile (auth refresh, partial writes, file rotation) and adds a moving part for something that should be one call.
  • Running claude itself with the sandbox disabled globally — overkill and removes the safety I want for everything else.
  • Skipping Monitor entirely and using a separate terminal with gcloud ... tail — works but defeats the point of having Claude watch the stream

Priority

Low - Nice to have

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I add gcloud to sandbox.excludedCommands in settings.json so it can authenticate against GCP.
  2. Running gcloud logging read ... via Bash works — the excludedCommands rule kicks in and the command runs outside the sandbox with valid credentials.
  3. I try to set up a Monitor on gcloud beta run services logs tail my-service to watch a Cloud Run service while I work.
  4. Monitor runs the command inside the sandbox anyway, ignoring excludedCommands, so gcloud fails to authenticate and the monitor produces no useful
    output.
  5. There is no dangerouslyDisableSandbox parameter on Monitor to force it out of the sandbox per-call either, so I have no escape hatch.
  6. I fall back to Bash run_in_background + polling a log file, which loses Monitor's streaming/notification semantics.

Additional Context

No response

extent analysis

TL;DR

To fix the issue, the Monitor tool needs to be modified to accept a dangerouslyDisableSandbox parameter and honor sandbox.excludedCommands from settings.json, similar to Bash.

Guidance

  • The proposed solution involves adding a dangerouslyDisableSandbox parameter to Monitor calls, which would allow it to run outside the sandbox when necessary.
  • The Monitor tool should also be updated to honor sandbox.excludedCommands from settings.json, allowing certain commands to run outside the sandbox automatically.
  • To verify the fix, test the Monitor tool with a command that requires host access, such as gcloud logging read or gcloud beta run services logs tail, and ensure it runs outside the sandbox when dangerouslyDisableSandbox is set to true or the command is in sandbox.excludedCommands.
  • Consider documenting the new sandbox handling behavior in the Monitor tool description to inform users of the option.

Notes

The fix requires modifications to the Monitor tool, which may involve updating the tool's code and configuration. The proposed solution is based on the existing behavior of the Bash tool, which already handles sandboxing in a similar way.

Recommendation

Apply the proposed workaround by modifying the Monitor tool to accept a dangerouslyDisableSandbox parameter and honor sandbox.excludedCommands from settings.json, as this would bring the Monitor tool to parity with Bash for sandbox handling.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Monitor needs to respect `sandbox.excludedCommands` and have a `dangerouslyDisableSandbox` option [1 participants]