feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728
feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#17280daryo wants to merge 3 commits into
Conversation
…iven prompts Maps a new AgentPermissionMode value 'auto' to Claude Code's '--permission-mode auto', letting Claude's built-in classifier decide per-tool whether to prompt — a safer middle ground between 'default' (prompts on every tool) and 'permissionless' (full bypass via --dangerously-skip-permissions, which also surfaces a non-interactive confirmation prompt that blocks tmux workers). The new value flows through the canonical type, both Zod config schemas (project + global), and the YAML config-instruction comment. Existing 'permissionless' and 'auto-edit' mappings are unchanged. Other agent plugins fall through to their default for 'auto' (documented in the AgentPermissionMode JSDoc).
…anch The if/else-if branches are self-explanatory; the JSDoc on AgentPermissionMode now matches the one-line style of the other modes.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is additive, all affected layers are updated consistently, and no existing behavior is modified. Every layer that encodes or validates permission modes — the TypeScript type, the normalizer function, three Zod schemas, and both CLI command builders — is updated in sync. The new No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/plugins/agent-claude-code/src/index.ts | Adds --permission-mode auto branch to both getLaunchCommand and getRestoreCommand — symmetrical implementation with no dangerously-skip-permissions overlap. |
| packages/core/src/types.ts | Adds auto to AgentPermissionMode type and updates normalizeAgentPermissionMode guard — changes are consistent and correct. |
| packages/core/src/config.ts | Adds auto to both AgentPermissionSchema and RoleAgentSpecificConfigSchema Zod enums — fully consistent with the type layer. |
| packages/core/src/global-config.ts | Adds auto to LocalProjectConfigSchema Zod enum — consistent with config.ts changes. |
| packages/plugins/agent-claude-code/src/index.test.ts | Adds two tests — one for getLaunchCommand and one for getRestoreCommand — both covering the new auto mode correctly. |
| packages/cli/src/lib/config-instruction.ts | Updates the inline comment on the permissions YAML key to document the new auto value. |
| .changeset/claude-code-permission-mode-auto.md | Changeset correctly marks the three affected packages as minor version bumps. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User config: permissions] --> B[Zod schema validation\nconfig.ts / global-config.ts]
B --> C[normalizeAgentPermissionMode\ntypes.ts]
C --> D{permissionMode}
D -->|permissionless\nauto-edit| E["--dangerously-skip-permissions"]
D -->|auto| F["--permission-mode auto"]
D -->|default\nsuggest| G[no permission flag]
D -->|skip legacy| H[→ permissionless]
H --> E
E --> I[Claude Code CLI]
F --> I
G --> I
Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/claude-code..." | Re-trigger Greptile
|
Hey @0daryo, could you please merge the latest main into the PR? @somewherelostt I’m unable to test this on Windows since the PR is behind the commit where Windows support was added. If @0daryo doesn’t continue with this, you should take over the PR. |
|
@Priyanchew |
btw @0daryo, you can hop on Discord too! |
Summary
Adds
autotoAgentPermissionMode, mapping to Claude Code's--permission-mode autoso users can opt into the classifier-driven mode instead of--dangerously-skip-permissions. Existingpermissionless/auto-editbehavior is unchanged. Other agent plugins fall through to their default forauto(documented in theAgentPermissionModeJSDoc).Closes #1729.
Test plan
pnpm typecheck— all packages passpnpm --filter @aoagents/ao-plugin-agent-claude-code test— 160/160 pass (includes newautotests for launch/restore)permissions: autoin a liveao spawn