Skip to content

feat: support Claude Code auto permission mode (default) - #306

Open
mm-zacharydavison wants to merge 5 commits into
mainfrom
feat/permission-mode
Open

mm-zacharydavison wants to merge 5 commits into
mainfrom
feat/permission-mode

Conversation

@mm-zacharydavison

Copy link
Copy Markdown
Collaborator

Summary

deer previously hardcoded claude --dangerously-skip-permissions for every sandboxed agent. Claude Code has since added --permission-mode auto — a classifier-based mode (allow / soft-deny / hard-deny) that is safer than blanket-bypassing all permission checks while remaining suitable for unattended sandbox runs.

This PR makes auto mode the default and lets users opt back into bypass via config.

Changes

  • New config key defaults.permission_mode"auto" (default) or "bypassPermissions", configurable in global ~/.config/deer/config.toml and repo-local deer.toml (repo-local wins). Values mirror Claude Code's own --permission-mode vocabulary. Invalid values are rejected on both the global and repo-local paths, falling back to the merged/default value.
  • Command construction (session.ts) — new exported permissionModeArgs(config) helper drives all three claudeCmd branches (continue / prompt / no-prompt): --permission-mode auto by default, --dangerously-skip-permissions when configured.
  • TUI (agent.ts) — the tmux bypass-dialog dismissal now runs only in bypassPermissions mode; auto mode has no startup dialog.
  • Docsdeer.toml.example and CLAUDE.md.

No new CLI argument or JSON-contract field — the value rides the existing merged-config flow. No per-task override (config-file only, by design).

Testing

  • New unit tests: 5 config load/merge/validation cases + 3 permissionModeArgs cases (default→auto, bypass, undefined→auto). All pass.
  • bun run build compiles both binaries cleanly.
  • Pre-existing SRT sandbox security tests fail in this environment (bwrap unavailable) — confirmed identical on the base commit, unrelated to this change.

Design spec: docs/superpowers/specs/2026-07-15-permission-mode-design.md
Implementation plan: docs/superpowers/plans/2026-07-15-permission-mode.md

🤖 Generated with Claude Code

deer-agent added 5 commits July 15, 2026 11:11
Also add the matching permissionMode field to the TUI-side DeerConfig
type (src/types.ts), which task 1 only added to packages/deerbox's
config type — needed for options.config.defaults.permissionMode to
typecheck in src/agent.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant