claude-code - 💡(How to fix) Fix Permission Prompt and doc Gap [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52132Fetched 2026-04-23 07:35:48
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Feature request and doc gap: The permission prompt "Yes, don't ask again" button writes a pattern to settings.local.json using an algorithm that strips to the leading binary. For example, running "git status -s" generates a Bash pattern matching all git commands, not just git status. This is:

(a) undocumented - the settings.json schema describes the pattern format but not how the UI generates patterns from approvals, (b) one wildcard-step broader than users typically intend, creating silent over-permissioning, and (c) not editable - the UI appears to offer no way to narrow the suggested pattern before accepting.

Requests:

  1. Document the pattern-generation algorithm in the Claude Code settings docs.
  2. Add an edit-pattern or narrow-pattern option to the permission prompt UI.
  3. Consider defaulting to subcommand-preserving patterns rather than binary-only patterns. Subcommands carry semantic intent that arguments do not.

Proposed Solution

Three options, any of which would address the issue:

  1. Document the pattern-generation algorithm in the Claude Code settings docs, so users know what pattern will be written when they click "Yes, don't ask again."

  2. Add an "edit pattern" field to the permission prompt UI, letting users narrow the suggested pattern before accepting. Default the field to the auto-generated pattern, let users tighten it.

  3. Change the pattern-generation default to preserve the subcommand, not just the binary. For "git status -s" generate a pattern matching "git status <args>" rather than "git <anything>". Subcommands carry semantic intent that arguments do not.

Option 2 is the most flexible. Option 3 is the lowest-effort fix with the biggest safety win - no UI change, just a different default.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

The most likely fix is to modify the pattern-generation algorithm to preserve subcommands, providing a safer default without requiring UI changes.

Guidance

  • Review the current pattern-generation algorithm to understand how it strips leading binaries and consider revising it to preserve subcommands.
  • Evaluate the proposed solutions, focusing on the trade-offs between documentation, UI changes, and default pattern generation.
  • Consider the security implications of the current "one wildcard-step broader" pattern generation and how preserving subcommands could mitigate silent over-permissioning.
  • Assess the feasibility of adding an "edit pattern" field to the permission prompt UI as a flexible solution.

Example

No code snippet is provided as the issue focuses on the algorithm and UI design rather than specific code implementation.

Notes

The issue highlights a critical problem with the current implementation, emphasizing the need for a solution that balances usability and security. The proposed solutions offer different approaches, but modifying the default pattern generation to preserve subcommands appears to be the most straightforward fix with significant safety benefits.

Recommendation

Apply workaround: Modify the pattern-generation default to preserve the subcommand, as it offers the lowest-effort fix with a substantial safety win without requiring UI changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING