[BUG] PermissionRequest hook `permission_suggestions` inconsistencies with UI

Resolved 💬 4 comments Opened Feb 25, 2026 by Crazytieguy Closed Mar 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

While testing PermissionRequest hooks, I found two cases where the permission suggestions shown in the UI don't match the permission_suggestions data in the hook input:

1. git add -A && git stash

  • git add is already allowed, git stash is not
  • Hook input correctly suggests git stash
  • UI shows "don't ask again for: git add:*" (wrong command)

2. bash -c "echo hello"

  • UI shows "don't ask again for: bash:*" (wildcard prefix)
  • Hook input suggests the exact command: bash -c "echo hello" (no wildcard)

What Should Happen?

Use the same algorithm for permission_suggestions in the hook and the actual permission suggestions in the ui.

Error Messages/Logs

Steps to Reproduce

  1. Add a PermissionRequest hook to .claude/settings.json that dumps stdin to a file:
{
  "hooks": {
    "PermissionRequest": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "bash -c 'cat >> /tmp/permission-request-debug.jsonl'",
        "timeout": 5
      }]
    }]
  }
}
  1. Set up permissions where git add is allowed but git stash is not (e.g. via Bash(git add *) in allow list)
  1. Run git add -A && git stash — UI suggests "git add:*", hook data suggests "git stash"
  1. Run bash -c "echo hello" — UI suggests "bash:*", hook data suggests exact command bash -c "echo hello"
  1. Compare UI suggestions with permission_suggestions in /tmp/permission-request-debug.jsonl

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.55

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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