gh api permission not working despite being in settings.json
Status Closed — not planned
Maintainer reply None cached
Activity 7 comments · opened Aug 4, 2025 · closed Jan 13, 2026
Description
The gh api command is prompting for user approval despite having the permission "Bash(gh api:*)" in ~/.claude/settings.json.
Steps to Reproduce
- Add
"Bash(gh api:*)"to theapprovedToolsarray in~/.claude/settings.json - Try to run any
gh apicommand, for example:
``bash`
gh api /user
`
or
bash``
gh api -X GET /repos/owner/repo/issues
- Claude Code still prompts for approval despite the permission being set
Expected Behavior
Commands matching gh api:* should execute without prompting, similar to how other gh permissions work (e.g., gh pr view:*)
Actual Behavior
The user is prompted to approve the command execution
Environment
- Platform: darwin
- OS Version: Darwin 24.5.0
Additional Context
Other similar permissions in the same settings.json file work correctly:
"Bash(gh pr checkout:*)""Bash(gh pr checks:*)""Bash(gh pr diff:*)""Bash(gh pr view:*)"
The permission format appears correct and consistent with working permissions.
7 Comments
Found 3 possible duplicate issues:
If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
I have this same issue with
gh issuecommands. I have to approvegh issue createevery single time.I have
Bash(gh issue:*)in the project'sallowarray insettings.local.jsonand I have tried to add the same to theallowedToolsarray in~/claude.jsonbut the array gets emptied every time I open Claude CLI.Same problem here. I eventually found out that the issue is with the backtick "`" character. Creating an issue without having the backtick (either single or triple) worked for me.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I think I'm experiencing a slightly different variation of this issue -
gh apicommands are not auto-authorized when allowed via a slash-command's allowed-tools section.This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.