Skip to content

Add permission scope toggle (this project / all projects)#177

Open
magiak wants to merge 1 commit intoandrepimenta:mainfrom
magiak:feature/permission-scope-toggle
Open

Add permission scope toggle (this project / all projects)#177
magiak wants to merge 1 commit intoandrepimenta:mainfrom
magiak:feature/permission-scope-toggle

Conversation

@magiak
Copy link

@magiak magiak commented Feb 20, 2026

Summary

  • Adds a toggleable scope selector to the "always allow" permission button, matching the native Claude Code CLI behavior
  • When the CLI provides permission_suggestions with scope info, users can click underlined text to switch between "this project (just you)" and "all projects"
  • Suggestions are filtered by destination field (projectSettings/localSettings vs userSettings) before being sent back to the CLI
  • Button labels updated to match native CLI: "No" / "Yes" instead of "Deny" / "Allow"

Changes

  • src/extension.ts — Compute hasProjectScope/hasUserScope from suggestions, accept scope from UI, filter suggestions by destination before sending control_response
  • src/script.ts — Scope toggle UI with togglePermissionScope(), updated respondToPermission() to include scope, decision text shows selected scope
  • src/ui-styles.ts.scope-toggle and .scope-suffix styles, adjusted .always-allow button for text wrapping

Test plan

  • Trigger a Bash permission request — verify scope toggle appears if CLI sends scope-bearing suggestions
  • Click the underlined "this project" text — verify it toggles to "all projects" without submitting
  • Click the button — verify it submits with the correct scope and updates .claude/settings.json or ~/.claude/settings.json
  • Trigger a non-Bash permission (e.g., ExitPlanMode) — verify fallback behavior when CLI sends no suggestions
  • Verify "No" and "Yes" buttons still work correctly

Add toggleable scope selector to the "always allow" permission button,
matching the native Claude Code CLI behavior. When the CLI provides
permission suggestions with scope info, users can click to switch
between "this project (just you)" and "all projects". Suggestions
are filtered by destination before being sent back to the CLI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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