feat(claude): add permission mode on the Agents settings page - #497
feat(claude): add permission mode on the Agents settings page#497Adam-Dalloul wants to merge 2 commits into
Conversation
|
Thanks for putting this together — the mechanics here are genuinely well done, and I want to say that up front before I get into the two things I'd like to sort out. What I verified as correct:
So the plumbing is solid. The two issues are about how this interacts with machinery that already exists. 1. We already have a persistent default mode for Claude, and it silently wins over this oneThis is the blocker. The composer's mode dropdown is already a sticky per-agent default for new chats, and it overrides
So for a user with no saved preference, your setting works. For a user who has picked a mode in the composer even once, the adapter reads your value and then codeg immediately overwrites it — the Settings page and the composer end up showing different things with no explanation. Two follow-on notes:
I'd also push back gently on "safe because it fails closed": the override lands on the saved value, not the more restrictive one. Settings = The fix isn't obvious and I don't want to hand you a design by fiat, but the shape is: pick one source of truth and make the other follow it. Either this panel writes through to the selector pref (and the composer reads it back), or connect stops sending 2.
|
Claude Code had no Settings toggle for the start-of-session permission mode, unlike Grok and Cursor. Write the official permissions.defaultMode key in ~/.claude/settings.json and skip the bypass confirmation dialog when Always approve is selected.
Settings save writes the chosen mode into codeg:selector-prefs so connect cannot keep a stickier last-used composer mode. Do not stamp skipDangerousModePermissionPrompt. Preserve plan/dontAsk on disk instead of showing Use default. Labels match the composer.
d9110c6 to
12e5c08
Compare
|
You were right about the two stores. I went with write-through: saving a chosen mode also updates Dropped Tests cover Settings=default vs saved bypass and the inverse. |
Grok and Cursor already have a permission-mode control on Settings -> Agents. This adds the same kind of dropdown for Claude Code.
It writes the official
permissions.defaultModekey and keeps existing allow/deny rules. It does not writeskipDangerousModePermissionPrompt. That flag is Claude Code's own bypass-dialog consent, not a CodeG switch.On save, a chosen mode is also written to CodeG's composer default (
codeg:selector-prefs) so connect cannot keep a stickier last-used mode. Leaving Use default does not touch the composer last-used.Labels match the composer: Manual / Accept Edits / Auto / Bypass Permissions.
plananddontAskalready on disk stay as-is instead of being shown as Use default.New chats only. Extra custom Claude slots still use their isolated settings.json because they do not get this panel.