gh api permission not working despite being in settings.json

Resolved 💬 7 comments Opened Aug 4, 2025 by kaovilai 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

  1. Add "Bash(gh api:*)" to the approvedTools array in ~/.claude/settings.json
  2. Try to run any gh api command, for example:

``bash
gh api /user
`
or
`bash
gh api -X GET /repos/owner/repo/issues
``

  1. 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.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗