◉CLAUDE LABJP
●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through
Articles/Claude Code
⟐ Claude Code/2026-07-16Advanced

The Permission Rules You Added for Safety Are Taxing Every Turn — Auditing the Ruleset Without Loosening It

Version 2.1.209 fixed the per-turn slowdown from large deny/ask rulesets, but the design debt in your rules is still yours. Here are the audit scripts, a shadowing detector, a turn-timing harness, and how to fold enumerated rules into prefix rules safely.

Claude Code295Permissions10settings.json11MCP63Performance4

✦ Premium Article

I opened the settings.json for the publishing pipeline I run as an indie developer and found 140-plus lines in the deny array.

Every line had a story. A command that scared me during an overnight run. A path I did not want read by accident. A new "just in case" entry every time I connected another MCP server. Six months of that.

And every one of those sessions felt vaguely slow. I never found a cause, so I filed it under "the model is having a day."

The 2.1.209 release notes named it. Sessions with many deny/ask rules were losing seconds on every turn, and the fix was to compile the matchers once and cache them. The settings I had stacked up in the name of caution were quietly costing me speed.

What the fix removed, and what it left on your desk

Worth separating clearly: 2.1.209 removed a runtime recompilation cost. It did not remove your ruleset design debt.

CostAfter 2.1.209Whose problem
Compiling rule strings into matchers (per turn)Cached — goneClaude Code
Assembling the MCP tool pool (per round)Cached — up to 7x fasterClaude Code
The rule count itself (how much to match against)Still grows linearlyYou
Shadowed and contradictory rulesStill thereYou
How many MCP servers you attachStill growsYou

The top two arrive with an update. The bottom three stay until you deal with them.

There is a twist here. Now that the compile cost is gone, the pain that used to signal the problem is gone too. Debt grows fastest when it stops hurting, which is exactly why I wanted to count mine now.

Count first — auditing the ruleset

Deleting rules on a hunch is a bad idea, so I let a script do the counting. It reads your settings files and reports the rule count, duplicates, and distribution per tool.

#!/usr/bin/env python3
"""audit_permissions.py — inventory the permission rules in your settings files.
 
Usage:
    python3 audit_permissions.py ~/.claude/settings.json .claude/settings.json
"""
import json
import re
import sys
from collections import Counter, defaultdict
from pathlib import Path
 
BUCKETS = ("allow", "ask", "deny")
 
# "Bash(rm -rf:*)" -> ("Bash", "rm -rf:*") / "Read" -> ("Read", None)
RULE_RE = re.compile(r"^(?P<tool>[A-Za-z_][\w-]*)(?:\((?P<arg>.*)\))?$")
 
 
def parse_rule(rule: str):
    m = RULE_RE.match(rule.strip())
    if not m:
        return None, rule.strip()
    return m.group("tool"), m.group("arg")
 
 
def load(path: Path) -> dict:
    if not path.exists():
        print(f"  skip (not found): {path}")
        return {}
    with path.open(encoding="utf-8") as fh:
        return json.load(fh)
 
 
def audit(paths):
    total = Counter()
    by_tool = defaultdict(lambda: defaultdict(list))
    seen = defaultdict(list)  # rule -> [(bucket, file), ...]
 
    for p in paths:
        data = load(Path(p).expanduser())
        perms = data.get("permissions", {})
        for bucket in BUCKETS:
            for rule in perms.get(bucket, []):
                total[bucket] += 1
                tool, arg = parse_rule(rule)
                by_tool[tool][bucket].append(arg)
                seen[rule].append((bucket, str(p)))
 
    print("=== Totals ===")
    for b in BUCKETS:
        print(f"  {b:5s}: {total[b]:4d}")
    print(f"  total: {sum(total.values())}")
 
    print("\n=== Per tool (most rules first) ===")
    rows = sorted(by_tool.items(), key=lambda kv: -sum(len(v) for v in kv[1].values()))
    for tool, buckets in rows:
        counts = " ".join(f"{b}={len(buckets[b])}" for b in BUCKETS if buckets[b])
        print(f"  {tool:28s} {counts}")
 
    print("\n=== Exact duplicates and bucket conflicts ===")
    dup = 0
    for rule, hits in seen.items():
        if len(hits) < 2:
            continue
        dup += 1
        buckets = {b for b, _ in hits}
        mark = "CONFLICT" if len(buckets) > 1 else "dup"
        print(f"  [{mark}] {rule}")
        for b, f in hits:
            print(f"        {b:5s} <- {f}")
    if dup == 0:
        print("  none")
    return sum(total.values())
 
 
if __name__ == "__main__":
    args = sys.argv[1:] or ["~/.claude/settings.json", ".claude/settings.json"]
    n = audit(args)
    sys.exit(0 if n else 1)

On my machine it printed 141 deny, 22 ask, and 63 allow — 226 rules total. Nine exact duplicates, and two conflicts where a project setting put something in allow while my user setting denied it. Both conflicts resolved to the safe side, which is precisely why I had never noticed them.

Before running it I would have guessed around 60. Being off by an order of magnitude is a useful place to start.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦An audit script that counts, dedupes, and surfaces bucket conflicts across your settings files
✦A turn-timing harness using claude -p, with the two details that make the comparison trustworthy
✦How to fold enumerated deny rules into prefix rules without opening a hole
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-10-19
If You Wrote MCP Allow Rules as Just `mcp__servername` — After v2.1.299, Only Servers With `__` in Their Names Need a Recheck
Claude Code v2.1.299 changed MCP allow rules to match only the server they name. A bare mcp__servername is affected only when the server name contains __ or ends in _. Includes a short audit script.
⟐ Claude Code2026-11-26
My Hook Ran in VS Code but Never in Android Studio — Keep One Settings File and Start Claude Code at the Repo Root
Same repository, same Mac, yet hooks and allow rules only worked when Claude Code was opened from VS Code. The cause was the launch directory, not the editor. Here is a script that lists which settings files load from a given folder, plus how I decide what goes in which file.
⟐ Claude Code2026-11-22
When a Remote MCP Server Goes Silent After Its Token Expires, Check for mcp-remote First
A remote MCP tool call hangs with no error. How to tell an expired token from a slow tool, a script that finds servers bridged through mcp-remote, and how to switch to the native HTTP transport or cap the wait.