[MODEL] permissions.ask wasn't honoured after model switch
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Other unexpected behavior
What You Asked Claude to Do
The prompt I used after asking Opus to create a plan and after switching to Sonnet 4.6, was: "Implement that plan and create a PR"
What Claude Actually Did
(...)
Bash(gh pr create --title "[RPA-1356] Fix extraction failure when replication is already ongoing" --body "$(cat <<'EOF'
## Summary…)
⎿ Warning: 1 uncommitted change
https://github.com/my-org/my-repo/pull/277
⏺ PR created: https://github.com/my-org/my-repo/pull/277
I wasn't asked to allow that gh pr create Bash
Expected Behavior
Given I have "Bash(gh pr create *)" in permissions.ask I was expecting claude to ask for my permission before running that gh pr create
Files Affected
- /.claude/settings.local.json
- ~/.claude/settings.local.json
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Haven't tried to reproduce
Steps to Reproduce
_No response_
Claude Model
Sonnet
Relevant Conversation
⏺ Now create the branch and PR:
⏺ Bash(git checkout -b RPA-1356.fix.extraction-failure-when-replication-ongoing)
⎿ Switched to a new branch 'RPA-1356.fix.extraction-failure-when-replication-ongoing'
⏺ Bash(git diff)
⎿ diff --git a/terraform/environments/cloudwatch.tf b/terraform/environments/cloudwatch.tf
index 70466cb..4249b13 100644
--- a/terraform/environments/cloudwatch.tf
… +20 lines (ctrl+o to expand)
⏺ Bash(git add terraform/environments/state-machine-template.json terraform/environments/cloudwatch.tf)
⎿ (No output)
⏺ Bash(git commit -m "$(cat <<'EOF'
RPA-1356 Fix extraction failure when replication is already ongoing…)
⎿ [RPA-1356.fix.extraction-failure-when-replication-ongoing 717ddc8] RPA-1356 Fix extraction failure when replication is already ongoing
2 files changed, 2 insertions(+), 1 deletion(-)
⏺ Bash(git push -u origin RPA-1356.fix.extraction-failure-when-replication-ongoing)
⎿ remote:
remote: Create a pull request for 'RPA-1356.fix.extraction-failure-when-replication-ongoing' on GitHub by visiting:
remote: https://github.com/my-org/my-repo/pull/new/RPA-1356.fix.extraction-failure-when-replication-ongoing
… +4 lines (ctrl+o to expand)
⏺ Bash(gh pr create --title "[RPA-1356] Fix extraction failure when replication is already ongoing" --body "$(cat <<'EOF'
## Summary…)
⎿ Warning: 1 uncommitted change
https://github.com/my-org/my-repo/pull/277
⏺ PR created: https://github.com/my-org/my-repo/pull/277
The uncommitted change warning is just the terraform/shared/.terraform.lock.hcl untracked file that was already present before this work — nothing related to this fix.
✻ Brewed for 47s
❯ How were you able to gh pr create if i've the settings.local.json has a permissions.ask item "Bash(gh pr create *)"? I didn't get asked permission
⏺ Good catch — let me check the settings files.
Searched for 2 patterns, read 2 files (ctrl+o to expand)
⏺ The ask entry for "Bash(gh pr create *)" is indeed in settings.local.json (line 49). I should have been prompted but wasn't.
My best guess is the model switch mid-session (/model to Sonnet 4.6) is the culprit. When you switched models, the new model instance may have inherited the conversation context but not the pending/granted permission states from the prior model instance — effectively
starting with a clean permission slate that defaulted to allow rather than re-checking the ask rules for the new invocation.
This looks like a bug worth reporting at https://github.com/anthropics/claude-code/issues. The key reproduction details would be:
- Have "Bash(gh pr create *)" in permissions.ask
- Switch models mid-session with /model
- Have the new model run gh pr create — it proceeds without prompting
Impact
Low - Minor inconvenience
Claude Code Version
2.1.85 (Claude Code)
Platform
Anthropic API
Additional Context
I have a SessionStart hook that symlinks the project level /.claude/settings.local.json to the user ~/.claude/settings.local.json (to re-use / maintain once on all repos). Wonder if the symlink was ignored
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗