Claude Code permissions. Keep control of the work.

Choose a permission mode, scope an allowlist, understand permission hooks, and investigate repeated prompts without granting blanket access.

A permission prompt is a decision about a particular action. Read the command, target and expected effect before deciding whether it belongs in the task. If the same harmless operation keeps interrupting you, narrow the rule for that operation. If the agent is reaching a deployment account or a shared database, the interruption may be useful evidence that your task boundary needs to be clearer.

Official documentation checked October 15, 2026. Examples below are illustrative; inspect your installed CLI’s help and existing project settings before applying them.

Choose the mode deliberately

In current terminology, Manual mode uses the configuration value default. acceptEdits permits file edits and common filesystem operations; plan supports exploration before implementation; bypassPermissions removes most ordinary approval checks. These are distinct choices, not progressively better settings. The official mode reference documents their exceptions.

Recent versions also have auto and dontAsk. In supported interactive environments, auto became the built-in starting mode in version 2.1.283. Consequently, a plain claude launch does not universally mean Manual. Pin the mode when a reproducible review workflow matters. These are separate launch examples, each starting a session:

claude --permission-mode default
claude --permission-mode acceptEdits
claude --permission-mode plan

For an unfamiliar repository, start by reading its scripts and configuration. For a known local change, acceptEdits may remove repetitive file prompts while you review the diff. Plan mode is useful for agreeing on scope, but it is not an operating-system sandbox; current versions may allow classifier-approved commands. Bypass is intended for externally isolated environments. Worktree separation alone does not provide that isolation.

Separate the request from the rule

Suppose the agent requests npm test. The visible string is only the entry point: your repository controls the script it invokes. Before allowing it persistently, read the script, its setup and any environment it reaches. A test runner that uses a disposable local fixture is a different decision from a script that seeds a shared service.

Write a short operating brief: the files in scope, which checks may run, and which external actions require another decision. Keep that brief separate from the configuration. A prose instruction helps the agent understand the task; it does not turn a broad tool permission into a technical restriction. If the task changes, reassess whether the saved permission still makes sense.

Use a small project allowlist

Merge a reviewed fragment into your existing settings rather than overwriting the file. The following example allows one exact test command and asks about the common push spelling:

{
  "permissions": {
    "allow": ["Bash(npm test)"],
    "ask": ["Bash(git push *)"]
  }
}

The permission-rule reference explains exact matches, wildcards and deny/ask/allow precedence. A rule naming git push * does not cover every way to invoke Git; for example, an intervening -C changes the command shape. Do not present a command pattern as a complete network policy. Avoid broad patterns such as Bash(*) simply to silence a prompt.

Keep personal experiments in local settings until you have reviewed them for the team. Shared project settings and user-wide settings have different reach; managed policy may constrain both. Anthropic’s settings and precedence guide describes those layers. When behavior surprises you, inspect the effective rule and its source before adding another exception.

Know what each permission hook observes

PreToolUse runs before a tool call; PermissionRequest handles an action that would need a permission decision. Their response formats differ. A PreToolUse hook can request a prompt using the following JSON response:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "ask",
    "permissionDecisionReason": "Review this action's target."
  }
}

PermissionRequest instead uses hookSpecificOutput.decision.behavior for an allow or deny result. Check the event contract before implementing a decision hook. A script that emits valid JSON in the wrong shape is still a broken integration. Our practical hooks guide starts with smaller examples and failure-path checks.

A useful first hook reports or requests review; it need not grant anything. Choose one narrow decision you can explain in a sentence. If the rule depends on parsing arbitrary shell programs, consider whether an exact reviewed script or a restricted execution environment would be easier to reason about. Never splice tool input into a shell command to inspect it.

Test failure as carefully as success

Use a disposable fixture with no external credentials. Try an expected permitted action, an action that should prompt, and an action that should be denied. Then remove the hook executable or make the fixture handler fail. Observe what happens in the installed CLI, rather than assuming a hook error stops work. Keep the fixture output and version with the configuration review.

Heavy builds and many concurrent sessions can delay a hook until its timeout. Treat that as an uncertain check, not as evidence that the action was approved or completed. Keep permission decisions small, local and bounded. If a hook reports status to another system, make retrying that report idempotent and reconcile the original result before issuing another action.

Permissions and isolation solve different problems

Anthropic’s sandbox documentation describes filesystem and network boundaries for Bash. Those boundaries help limit what a process can reach after it starts. Approval rules govern whether a tool action proceeds. A separate worktree isolates working files, while a separate test database isolates test data; neither follows automatically from opening another terminal.

For sensitive work, list the concrete resources a command can touch: local checkout, other folders, network services and inherited credentials. Remove unnecessary access from the execution environment. The security guide is a starting point for understanding repository trust and prompt injection. Do not treat text found in a dependency or webpage as authorization to change those resources.

Make waiting sessions easy to find

When several agents run together, name each session by its task and check waiting prompts before launching more work. In XAgents, Needs you shows which agent is waiting. Read the exact request. For supported Claude tool permissions, choose Approve once or Deny in Needs you or the agent tab. Otherwise choose Open tab and respond through the provider’s prompt. A workspace indicator helps you find the decision; the action still deserves the same review it would get in a standalone terminal.

Keep a short note of recurring interruptions. After a few tasks, you can distinguish a genuinely repetitive local command from a new external target. Tune the former narrowly and keep the latter explicit. See XAgents help for navigating sessions, and the worktree guide for separating concurrent edits.

Common questions

Is acceptEdits the same as bypassPermissions?

No. acceptEdits automatically permits file edits and some filesystem operations. It does not grant blanket approval for arbitrary commands or external actions.

Does XAgents approve a Claude permission request?

The Needs you view shows which agent is waiting. Read the exact request. For supported Claude tool permissions, choose Approve once or Deny in Needs you or the agent tab. Otherwise choose Open tab and respond through the provider’s prompt.

Keep reading

The XAgents team