Start Debugging

permissions

7 posts

How to Let Sandboxed Bash Run Without Permission Prompts in Claude Code With sandbox.autoAllowBashIfSandboxed

Claude Code 2.1.324/2.1.325 flipped sandbox.autoAllowBashIfSandboxed to false, so sandboxed Bash commands prompt again. How to turn auto-allow mode back on with /sandbox or settings.json, what still prompts (deny and content-scoped ask rules, critical rm paths, env-prefix forms, plan mode, unknown hosts), how to keep the sandbox strict enough to trust, and how to pin the setting for an organization.

How to Turn On Code Mode in Claude Code With CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 (and Block It Org-Wide)

Code Mode, added in Claude Code v2.1.323, lets Claude write JavaScript that calls Bash, Edit and MCP tools in one step through a tool named REPL. How to turn it on in your shell or ~/.claude/settings.json, why project settings cannot, how to block it for an organization with a managed-settings env value of 0, what the requirements are, how permission rules and PreToolUse hooks see calls made from code, and the resume and hook gotchas.

How to Stop Claude Code From Writing Outside the Repo With permissions.blockWritesOutsideWorkingDirectories

Set permissions.blockWritesOutsideWorkingDirectories to true and Claude Code 2.1.314+ makes Write, Edit and NotebookEdit refuse any path outside the working directories in every permission mode, bypassPermissions included. What it refuses, what stays writable, why allow rules cannot open it, how /add-dir and additionalDirectories do, what it does to worktrees, and how to pair it with the Bash sandbox so shell commands are fenced too.

How to Keep Unattended Claude Code Runs From Stalling on Permission Prompts With permissions.denyInsteadOfPrompting

Set permissions.denyInsteadOfPrompting to true in user, managed or --settings scope and Claude Code 2.1.319+ denies any tool call that would wait on a permission prompt, then keeps the turn going. Where it applies, how it differs from dontAsk mode and --permission-prompts none, what it also switches off, how to approve calls from a PermissionRequest hook, and the two dialogs it cannot skip.