NachschlagenQuellenregister

Dokumentationerreichbar

Anthropic, Configure permissions

code.claude.com (externe Seite)

Die Her­stel­ler­do­ku­men­ta­tion zu den Rechteregeln. Sie enthält den Satz, der die Grenze zwischen einer Projektanweisung und einem Riegel zieht: Durchgesetzt wird von der Umgebung, und was im Auftrag steht, beeinflusst nur den Versuch. Dazu die Rangfolge der drei Regelarten und eine Falle, die still bleibt: Pfadregeln werden allein gegen Edit und Read geprüft, eine auf Write geschriebene Regel nimmt die Umgebung an und schlägt sie nie nach.

geprüft 22.11.2026

Worauf sich diese Seite beruft, wörtlich, abgerufen am 28.08.2026:

  • Permission rules are enforced by Claude Code, not by the model.bestätigt 22.11.2026
  • Rules are evaluated in order: deny, then ask, then allow.bestätigt 22.11.2026
  • An allow rule can’t carve an exception out of a deny rule.bestätigt 22.11.2026
  • They don't apply to a command that reads files without naming them, such as grep -r pattern . run from the directory that holds the file, or to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself.steht dort nicht mehr
  • Claude Code runs npm scripts and git commits without asking and refuses commands that begin with git pushbestätigt 22.11.2026
  • A push written another way, such as git -C . pushbestätigt 22.11.2026
  • Content-scoped ask rules like Bash(git push *) still force a promptbestätigt 22.11.2026
  • Your other rules and the permission mode decide the commands in the last column.bestätigt 22.11.2026
  • a deny or ask rule covers the invocation Claude usually produces and isn't a security boundary around the programbestätigt 22.11.2026
  • For filesystem and network enforcement that doesn't depend on the command text, use sandboxing.bestätigt 22.11.2026
  • The hook output can deny the tool call, force a prompt, or skip the prompt to let the call proceed.bestätigt 22.11.2026
  • Claude Code evaluates deny and ask rules regardless of what a PreToolUse hook returnsbestätigt 22.11.2026
  • The first match in that order determines the outcome, and rule specificity doesn’t change the order.bestätigt 22.11.2026
  • A file-modification approval isn’t saved to the filebestätigt 22.11.2026
  • Claude Code offers those options only when the prompt can show you everything they would allowbestätigt 22.11.2026
  • You can attach a note to Claude when you approve or deny a single action.bestätigt 22.11.2026
  • If you select No without a comment on a prompt from the main conversation, Claude Code stops the turn.bestätigt 22.11.2026
  • A bare tool name like Bash removes the tool from Claude’s context entirely, so Claude never sees it.bestätigt 22.11.2026
  • The dialog lists all permission rules and the settings.json file each rule comes from.bestätigt 22.11.2026
  • when you add or remove a rule, Claude Code applies the change starting with Claude’s next tool call in the same turnbestätigt 22.11.2026
  • A * in a Bash rule matches any text, including spaces, so one rule covers a family of commands.bestätigt 22.11.2026
  • Claude Code matches everything before the first * as written, so those words are what limit the rulebestätigt 22.11.2026
  • Claude Code warns at startup about an allow rule with a * before the subcommandbestätigt 22.11.2026
  • The space before a trailing * is part of the rule.bestätigt 22.11.2026
  • Every subcommand must be allowed for a compound command to run without a promptbestätigt 22.11.2026
  • Deny and ask rules apply when any subcommand matches thembestätigt 22.11.2026
  • Up to 5 rules may be saved for a single compound command.bestätigt 22.11.2026
  • Before matching Bash rules, Claude Code strips a fixed set of wrappersbestätigt 22.11.2026
  • This wrapper list is built in and is not configurable.bestätigt 22.11.2026
  • Because these tools execute their arguments as a commandbestätigt 22.11.2026
  • Deny and ask rules can match a top-level input parameter on any built-in tool with Tool(param:value)bestätigt 22.11.2026
  • An allow rule for one parameter value wouldn’t establish that the call is safe overallbestätigt 22.11.2026
  • A parameter the model omits is never matchedbestätigt 22.11.2026
  • You can’t match a tool’s primary content field this waybestätigt 22.11.2026
  • To match a parameter on an MCP tool, pass a deny rule with --disallowedToolsbestätigt 22.11.2026
  • it skips any mcp__ rule that has parenthesesbestätigt 22.11.2026
  • Deny and ask rules also accept glob patterns in the tool-name position.bestätigt 22.11.2026
  • Allow rules accept tool-name globs only after a literal mcp__<server>__ prefix.bestätigt 22.11.2026
  • allow rules for that tool don’t take effectbestätigt 22.11.2026
  • A deny or ask rule whose tool name matches no known tool produces a startup warning to catch typos.bestätigt 22.11.2026
  • If a tool is denied at any level, no other level can allow it.bestätigt 22.11.2026
  • a managed settings deny can’t be overridden by --allowedToolsbestätigt 22.11.2026
  • Permanently per repository and commandbestätigt 22.11.2026
  • A hook that exits with code 2 stops the tool call before permission rules are evaluatedbestätigt 22.11.2026
  • register a PreToolUse hook that rejects those specific commandsbestätigt 22.11.2026
  • A mod you install that handles the tool.check event gives its answer after the PreToolUse hooks have run.steht dort nicht mehr
  • a call the mod approves runs without a classifier checksteht dort nicht mehr
  • Your setup might lack managed settings, a managed-mcp.json file, and a Team or Enterprise /login as the session’s credential. In that setup, the mod can approve a call that a deny rule refuses or a PreToolUse hook blocked.steht dort nicht mehr
  • A session that runs on an API key or a long-lived CLAUDE_CODE_OAUTH_TOKEN instead isn’t using that login, even when that login is stored.bestätigt 22.11.2026
  • You can check permission settings into version control to share them with every developer in your organizationbestätigt 22.11.2026
  • Edit rules apply to all built-in tools that edit files.bestätigt 22.11.2026
  • For OS-level enforcement that blocks all processes from accessing a path, enable the sandboxsteht dort nicht mehr
  • The single leading slash anchors at the settings source, not the filesystem root.bestätigt 22.11.2026
  • Read and Edit deny rules apply to Claude’s built-in file tools, to file commands Claude Code recognizes in Bash, such as catsteht dort nicht mehr
  • and to the targets of Bash redirections such assteht dort nicht mehr
  • Paths and domains from both sandbox settings and permission rules are merged into the final sandbox configurationbestätigt 22.11.2026
  • Claude Code recognizes a built-in set of Bash commands as read-only and runs them without a permission prompt in every modebestätigt 22.11.2026
  • A * at the end, with a space before it, also matches the bare command.bestätigt 22.11.2026
  • The * stands in for whatever text is in its place.bestätigt 22.11.2026
  • When a command redirects output or input, Claude Code checks the redirect target against your file rules as if Claude wrote or read that file directlybestätigt 22.11.2026
  • Claude Code checks tee targets in v2.1.269 and later.bestätigt 22.11.2026
  • A /path pattern anchors at a directory associated with the settings source that defines it, so the same rule matches different locations depending on where you put itbestätigt 22.11.2026
  • edits in <primary working directory>/docs/bestätigt 22.11.2026
  • CLI flags or session rules <primary working directory>/pathbestätigt 22.11.2026
  • apply only when both the requested path and the file it resolves to matchbestätigt 22.11.2026
  • apply when either the requested path or the file it resolves to matchesbestätigt 22.11.2026
  • you’re prompted for it instead of the classifier decidingbestätigt 22.11.2026
  • the Edit and Write tools refuse the write and direct Claude to the link’s targetbestätigt 22.11.2026
  • A prefix rule like Bash(watch *) or Bash(find *) can't auto-approve the following commands, so in Manual mode they promptbestätigt 22.11.2026
  • To approve a specific invocation that has no * in it, write an exact-match rule for the full command stringbestätigt 22.11.2026
  • Claude Code reads the rule as a wildcard pattern, not an exact match, so the command still promptsbestätigt 22.11.2026
  • Approve it each time it prompts, or use a PreToolUse hookbestätigt 22.11.2026
  • A network path is one that can reach another computerbestätigt 22.11.2026
  • Looking up such a path can contact the host it names, and on Windows that contact can send the host your credentials.bestätigt 22.11.2026
  • In Claude Code v2.1.292 and later, each of these leaves the prompt in placebestätigt 22.11.2026
  • a rule doesn't pre-approve the read, including a rule for the whole tool, such as Readbestätigt 22.11.2026
  • the prompt comes to you, and the classifier doesn't decide the readbestätigt 22.11.2026
  • In dontAsk mode, Claude Code denies the read instead of prompting.bestätigt 22.11.2026
  • In bypassPermissions mode, and in interactive terminal sessions in plan mode with bypass permissions available, the read runs without this prompt.bestätigt 22.11.2026
  • To read files on a network share without this prompt, give the share a local path firstbestätigt 22.11.2026
  • In plan mode, a mod that handles tool.check also can’t approve a file edit or another call that isn’t read-only, though it can still block such a call.bestätigt 22.11.2026
  • With managed settings or a managed-mcp.json file, or a Team or Enterprise /login as the session’s credential, these outcomes stay in place by default when the mod approves a callsteht dort nicht mehr
  • A session that runs on an API key or a long-lived CLAUDE_CODE_OAUTH_TOKEN instead isn’t using that login, even when that login is stored.bestätigt 22.11.2026
  • dontAsk mode: the mod can approve a call that nothing but the mode would deny.bestätigt 22.11.2026
  • There the classifier checks the call first.steht dort nicht mehr
  • It accepts a rule with a path other than * for one of the tools below but doesn’t match a read, search, or edit against it.bestätigt 22.11.2026
  • with an action that runs commands, deletes files, or writes files, such as -exec, -delete, -rm, or -fprint, or with -files0-frombestätigt 22.11.2026
  • That includes -c, which makes git run a program you name.bestätigt 22.11.2026
  • Use both for defense-in-depth, since sandbox restrictions still apply even if a prompt injection bypasses Claude’s decision-making.bestätigt 22.11.2026
  • To make Claude’s file tools refuse paths outside the working directories in every permission mode, including bypassPermissionsbestätigt 22.11.2026
  • the file tools refuse reads there, apart from files Claude Code itself needsbestätigt 22.11.2026
  • file commands Claude Code recognizes in Bash, such as cat, head, tail, sed, and teesteht dort nicht mehr
  • has no effect on a file edit or another call that isn’t read-onlybestätigt 22.11.2026
  • In one settings file’s deny list, Read(*.env) followed by Read(!sample.env) blocks every file whose name ends in .env at any depth, except files named sample.env.bestätigt 22.11.2026
  • The carve-out reaches only rules from the same source.bestätigt 22.11.2026
  • A call that a deny rule refuses stays refused.bestätigt 22.11.2026
  • A session that runs on an API key or a long-lived CLAUDE_CODE_OAUTH_TOKEN instead isn’t using that login, even when that login is stored.bestätigt 22.11.2026

Erst der rote Test02 Die Werkzeuge04 Die Werkzeuge des Agenten08 Berechtigungen und Rechtemodi11 Eine Wissensbasis aufbauen12 Rechner und Netz pflegen16 Rechte und Sandbox18 Hooks und Mods26 Git und Forges31 Der Harness

Alle Quellen

↑↓ auswählenEnter öffnenDie Suche läuft im Browser. Nichts wird übertragen.