Use --permission-mode to choose the default behavior for the current session:
Copy
qodercn --permission-mode defaultqodercn --permission-mode accept_editsqodercn --permission-mode plan # kept for backward compatibility; translates to default + entering the Plan working stateqodercn --permission-mode autoqodercn --permission-mode bypass_permissionsqodercn --permission-mode yolo # equivalent to bypass_permissionsqodercn --permission-mode dont_ask# Shortcutsqodercn --yolo # equivalent to --permission-mode bypass_permissionsqodercn --dangerously-skip-permissions # same as above
In an interactive session, you can also switch to YOLO mode quickly with Ctrl+Y.Multiple naming formats are supported (case-insensitive):
Canonical value (snake_case)
camelCase
Aliases
accept_edits
acceptEdits
—
bypass_permissions
bypassPermissions
yolo, YOLO
dont_ask
dontAsk
—
Example:
Copy
# The following are equivalentqodercn --permission-mode bypass_permissionsqodercn --permission-mode bypassPermissionsqodercn --permission-mode yoloqodercn --yoloqodercn --dangerously-skip-permissions
Non-default modes only take effect in trusted directories. If the current directory is not trusted, Qoder falls back to default.
Rules merge from multiple sources, from lowest to highest precedence:
Layer
Source
Description
1
userSettings
~/.qoder-cn/settings.json (user global)
2
projectSettings
<project>/.qoder/settings.json (project level, team shared)
3
localSettings
<project>/.qoder/settings.local.json (this machine, add to .gitignore)
4
flagSettings
The file specified by the --settings <path> CLI flag
5
cliArg
The --allowed-tools / --disallowed-tools command-line flags
6
command
The /allow and /deny in-session commands
7
session
Runtime temporary rules ("allow for this session" in the prompt)
Rules from higher-precedence sources override lower ones. If the organization policy enables allowManagedPermissionRulesOnly, only policy-managed rules are used.How to configure each source:
Layers 1-3 (settings files): write permissions.allow / permissions.deny / permissions.ask arrays in the JSON file at the corresponding path. settings.local.json suits per-machine personal approval rules; add it to .gitignore.
Layer 4 (flagSettings): qodercn --settings ./custom-settings.json specifies an extra settings file path. Its format is the same as a standard settings.json.
Layer 5 (cliArg): configure via command-line flags such as --permission-mode, --allowed-tools, --disallowed-tools, and --tools, effective for the current session only.
Layer 6 (command): type /allow Bash(npm test) or /deny WebFetch in a session; persisted to settings.local.json.
Layer 7 (session): temporary rules produced by choosing "allow for this session" in the prompt; gone when the process exits.
Auto-approve file edits; shell commands still require confirmation
acceptEdits
plan
Read-only mode (backward compatible; actually becomes default + the Plan working state)
—
auto
The AI classifier assesses operation safety
—
bypass_permissions
Skip permission prompts (YOLO)
yolo, bypassPermissions
dont_ask
Non-interactive; operations requiring confirmation are denied outright
dontAsk
Case-insensitive; all aliases work.Disabling YOLO mode — organization admins can block users from entering bypass_permissions mode with:
Copy
{ "security": { "disableYoloMode": true }}
Once set, --yolo, --permission-mode bypass_permissions, and Ctrl+Y are all unavailable, and the Shift+Tab cycle skips the mode. A subagent declaring bypass is also downgraded to acceptEdits.Disabling Plan mode — if you don't need the Plan workflow, turn it off:
Copy
{ "general": { "plan": { "enabled": false } }}
Once set, the /plan command is unavailable, --permission-mode plan falls back to default, and the EnterPlanMode/ExitPlanMode tools are not registered.Auto-mode classifier configuration — you can steer the AI classifier's leanings with natural-language rules:
Copy
{ "autoMode": { "allow": [ "running npm/yarn/pnpm scripts defined in package.json", "creating or editing test files" ], "soft_deny": [ "deleting files outside the test directory", "modifying CI/CD configuration" ], "environment": [ "This is a Node.js monorepo with pnpm workspaces", "The project uses Vitest for testing" ] }}
Field
Purpose
allow
Descriptions of operations the classifier should lean toward auto-approving
soft_deny
Descriptions of operations the classifier should lean toward denying
environment
Environmental context provided to the classifier
These rules are soft steering — injected into the classifier prompt as reference, with the final decision still made by the AI classifier. For security, autoMode configuration is read only from trusted sources (user global settings and localSettings); project settings are excluded to prevent malicious privilege escalation.
--allowed-tools and --disallowed-tools use the same rule syntax as settings. --tools restricts the set of built-in tools available for this run (unlisted tools are denied).
Some paths are protected because editing them could change execution behavior, credentials, or tool behavior. Examples include .git, .vscode, .idea, .husky, most .qoder configuration files, shell startup files like .bashrc/.zshrc, Git configuration, .mcp.json, and .ripgreprc. In regular interactive modes these paths require explicit approval; in auto mode they are denied.
Some path spellings can reach resources outside the local filesystem, or bypass path comparison. These are handled separately from rules, on two independent axes.
Network locations — paths beginning with two separators (\server\share, //server/share), extended UNC forms (\?\UNC\server\share), WebDAV spellings, and /net/<host>/… automount paths. On Windows, reading, searching, writing and shell access there ask for confirmation every time. The prompt offers no persistent rule, because a saved rule would permanently authorize disclosing your credentials to that host. A network location may be the working directory or an added directory; startup names it in a warning.
Local mounts — \wsl$\…, \wsl.localhost\…, \?\C:\… and \?\Volume{…}\… name local storage and follow the normal rules. A loopback host such as \127.0.0.1\share is still a network location.
Bypass-prone spellings — alternate data streams (file.txt:stream), 8.3 short names (PROGRA~1), device paths (\.\…), trailing dots or spaces, three or more consecutive dots, and reserved device names (CON, NUL, COM1) require explicit approval.
Path-scoped read rules use Read(...). Path-scoped write rules use Edit(...); they cover the file-write checks of Edit, Write, and NotebookEdit. An Edit(...) allow rule on a path also implicitly allows reading the same path.File rules use gitignore-style matching.
Pattern
Meaning
/src/**
A path based on the rule source's root. In project/local settings, relative to the project root; in user settings, relative to the home directory.
~/Documents/**
A path based on the home directory.
//tmp/data/**
An absolute path from the system /. Absolute paths require a double slash. In a rule pattern a leading // means "absolute from the filesystem root" and is unrelated to the network-location handling above.
*.secret
A rootless filename pattern that can match anywhere.
deny and ask rules see through common wrappers and environment-variable prefixes, so Bash(rm -rf:*) still intercepts wrapped destructive commands.
Prefix and wildcard allow rules do not silently approve compound commands unless every top-level command segment can be allowed independently.
Some provably read-only shell commands can be auto-allowed after deny, ask, and path checks.
Dangerous commands (such as destructive deletions or force pushes) may force confirmation even under a broad allow rule. In auto mode, dangerous shell commands are denied.
Unless you fully trust the current session, avoid broad rules like Bash or Bash(*).
Web tools can be controlled with tool-level rules. Use ask if all web fetches should require confirmation; use deny if a session or project should have network access disabled.
MCP server configuration can also set automatic allowance for a server's tools via alwaysAllow. To enable only specific MCP servers for a run, use --allowed-mcp-server-names.
Agent rules control Subagent launches. The rule content is a Subagent name, matched case-insensitively. All three behaviors are supported and evaluated in the order deny > ask > allow. When no matching rule is configured, the launch proceeds without a confirmation prompt.
Fires after the permission pipeline produces ask and before the prompt/callback. Suited to automated approval systems or external notifications (like Slack/email alerts):
A hook's permission decision takes precedence over the permission mode — even in bypass_permissions mode, a PreToolUse Hook returning deny still blocks execution. This provides organizations with non-bypassable enforcement for security policies.Execution order:
Hook PreToolUse → short-circuits if it returns allow/deny