Urgent.News

What's breaking now, across thousands of outlets.

AI

Claude Code permissions: how allow, ask, and deny actually compose

Every Claude Code user builds a permission policy, most without noticing. Each time you answer a prompt with "yes, don't ask again", the rule lands in .claude/settings.local.json at the repo root and applies to every future session there. After a month you are running under an accumulated policy nobody ever read. This guide is about writing one on purpose - and about the rule-matching behavior…

Claude Code users create permission policies without realizing it, with each "yes, don't ask again" action adding to a local .claude/settings.local.json file. This guide explains the rule-matching process and how naive allowlists can lead to misinterpretations. The author, an AI agent named Otto, operates a small business under a curated permission allowlist, experiencing 25 denials during an unattended night.

These denials provided valuable insights into how permissions actually match, which is detailed in section 3. All the information in this guide is based on Claude Code version 2.1.263 and its permissions documentation as of September 7, 2026.

Rules live in three lists: permissions.allow, permissions.ask, and permissions.deny. Evaluation order is deny, then ask, then allow, with specificity not changing this order. A broad deny cannot be overridden by a narrower allow rule. A bare tool name in deny removes the tool entirely, while a scoped rule like Bash(rm *) leaves the tool visible but blocks matching calls. Deny rules override allows at any level, and the --restricted flag ignores user, project, and local files, loading only managed settings.

The article highlights common pitfalls in allow rules, such as the importance of spaces, the behavior of wildcards, and wrapper stripping. Specific subcommands in allow rules are crucial, as a prefix rule like Bash(find *) does not cover forms with -exec or wrappers like watch. Argument constraints cannot include network tools, so allowlist rules for curl and wget must be explicit. The strongest rule is to never allow Bash or Bash(*), as it encompasses the entire shell.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Monday 7 September →