AC Bridge

Claude Code permissions: safer alternatives to skipping approvals

Last updated

The short answer To stop Claude Code from interrupting you on safe commands without disabling all guardrails, add narrow permissions.allow and permissions.deny rules to .claude/settings.json (or switch to acceptEdits mode) and wire an alert hook so approval prompts never sit unnoticed while you step away. Reserve --dangerously-skip-permissions and Codex approval_policy = "never" for isolated containers or throwaway sandboxes only.

Scoped permissions.allow and deny rules in settings.json

Most permission fatigue comes from approving read-only test, lint and git status commands over and over. Pre-approving only those safe prefixes in .claude/settings.json (per repo) or ~/.claude/settings.json (user-wide) removes repetitive prompts while keeping writes, network pushes and destructive shell commands gated. See the Claude Code settings reference for full rule syntax.

.claude/settings.json

{
  "permissions": {
    "allow": [
      "Bash(npm test:*)",
      "Bash(npm run lint:*)",
      "Bash(git status)",
      "Bash(git diff:*)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Bash(rm -rf:*)",
      "Bash(git push --force:*)"
    ]
  }
}

Why narrow allow lists beat full bypass

permissions.allow matches exact tool prefixes, so Claude runs your test runner or diff check without pausing, yet still stops before modifying credentials, pushing branches or deleting directories. permissions.deny takes precedence over allow rules.

Project rules vs personal rules

Commit safe team rules in .claude/settings.json, keep personal overrides in .claude/settings.local.json (gitignored), and reserve ~/.claude/settings.json for read-only utilities you trust in every repository.

Official Claude Code permission modes and bypass risks

Claude Code ships five permission modes documented in Claude Code permission modes. Choosing the right middle ground avoids turning off safety checks on your main development machine.

Mode What runs without asking When it fits
default Read-only file inspection and any matching permissions.allow rules. Day-to-day work on production repositories or shared hosts.
acceptEdits File edits inside the working directory; shell commands still ask unless allowed. Refactors and docs sweeps where you review the git diff afterwards.
plan Read-only exploration and planning only; no file writes or mutating commands. Investigating unfamiliar code or agreeing on a change before editing.
dontAsk Only pre-approved tools; anything unapproved is denied rather than prompting. Unattended scripts and CI jobs that must stay inside a fixed allow list.
bypassPermissions Every tool call without prompting (also enabled via --dangerously-skip-permissions). Disposable containers or VMs with no internet access or host credentials.

What --dangerously-skip-permissions puts at risk

Running --dangerously-skip-permissions on your main laptop gives the session unrestricted access to your home directory, SSH keys, cloud CLI profiles and browser tokens. Prompt injection inside a fetched web page, dependency README or issue comment can trigger arbitrary shell commands with zero confirmation. Keep bypass mode inside an isolated sandbox with no personal secrets.

Codex CLI approval_policy and YOLO mode

OpenAI Codex CLI separates approval prompts from filesystem sandboxing in ~/.codex/config.toml. Setting approval_policy = "never" (often called YOLO mode) skips approval prompts, so check both approval_policy and sandbox settings before enabling it. See the Codex config reference and the Codex hooks and config.toml reference for file structure.

Policy Behaviour Recommended use
untrusted Runs only known safe read-only commands automatically; asks before anything else. Strict review on sensitive repositories.
on-request Runs routine workspace work inside the sandbox and asks when escalating outside it. Default interactive balance for local development.
never Never pauses for interactive approval (Codex YOLO mode). Isolated CI runners or disposable sandboxes only.

Keep approvals on with a PermissionRequest hook

Many developers reach for bypass mode only because they walk away to make coffee and come back ten minutes later to a silent prompt. Keeping approvals enabled and firing a quiet PermissionRequest hook gives you the best of both worlds: safety stays on, and you hear or see the prompt right away. See the Claude Code hooks reference and Claude Code notifications guide for Linux and Windows variants.

~/.claude/settings.json

{
  "hooks": {
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Ping.aiff",
            "async": true
          }
        ]
      }
    ]
  }
}

Questions people ask

How do I make Claude Code stop asking for permission?

Add the specific safe commands you run repeatedly to permissions.allow in .claude/settings.json and switch to acceptEdits mode during refactors. That eliminates repetitive prompts without turning off checks on destructive shell commands.

How do you enable bypass permissions in Claude Code safely?

Only pass --dangerously-skip-permissions (or set bypassPermissions) inside an ephemeral container or VM that holds no SSH keys, cloud tokens or production credentials, and restrict outbound network access where possible.

What is Codex CLI YOLO mode and approval_policy?

Codex YOLO mode refers to setting approval_policy = "never" (or launching with full-bypass flags) so Codex stops asking for command confirmation. On a personal workstation, prefer on-request paired with a PermissionRequest notification hook in ~/.codex/hooks.json.

How do I know when Claude Code needs approval while away from the desk?

Wire a quiet PermissionRequest or Notification hook (with "async": true) to play a loud chime, send a desktop alert or trigger a room status light so you can step back and approve risky actions manually instead of skipping permissions altogether.

Or let a light show it

Keeping approvals on is easy when a smart bulb in your room changes colour when a session pauses for permission, so you never come back to a stalled terminal and never have to run YOLO mode on your main machine.

What it does

AC Bridge turns the smart lights and plugs you already own (Philips Hue, LIFX, Govee, WiZ, Home Assistant and more) into a quiet status light for Claude Code and Codex. In the example colours from our homepage, the light breathes blue while working, flashes red when approval is needed and turns green when finished; you choose every colour per repo.

What it follows

On Claude Code, needs permission follows Claude Code's permission_prompt notification across all 29 agent states (including bypass-permissions mode as its own state so you can see at a glance if a session is running unguarded). On Codex, needs permission follows PermissionRequest across 19 states. See how the Claude Code status light works and the setup docs.

What it costs

AC Bridge is free to use: one Claude Code profile and one Codex profile, each lighting one device on one repo at a time, with as many devices as you like switched on or off from the app. Pro is £12.99 once, not a subscription: as many profiles as you want for each agent, several devices in a profile, profiles on every repo at once, and your agent can control your devices. It works with the Claude Code or Codex you already run, on Windows, macOS or Linux, with no model API key to buy.

What it collects

LAN devices are driven straight from your machine and their keys never leave it; your account, settings, device list, usage counts and session states sync through our servers. Your prompts, code and session transcripts are never collected. Privacy policy.

Try it on your own lights Turn the lights you already own into a status light for Claude Code and Codex, and see from across the room when a session needs you. Get started free, or read the setup docs first. On Pro, ask Claude Code or Codex in plain English to switch, dim or recolour your lights, plugs and more. How MCP device control works