Git commit permission prompt appears repeatedly despite allow tools configuration

Resolved 💬 17 comments Opened May 31, 2025 by noughts Closed Jan 26, 2026
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

Issue Description

Git commit permission prompt appears every time despite properly configuring git commit in BOTH global and project-local settings files.

Steps to Reproduce

  1. Configure git commit in both global and project settings files
  2. Attempt to commit changes using git commit
  3. Permission prompt appears every time despite the configuration

Expected Behavior

Permission prompt should not appear when git commit is listed in permissions.allow.

Actual Behavior

Permission prompt appears repeatedly for every git commit operation, ignoring both global and project-local settings.

Environment

  • Platform: macOS
  • OS Version: Darwin 24.5.0
  • Date observed: 2025/5/31
  • Claude Code model: claude-opus-4-20250514

Current Configuration

claude config list output:

{
  "allowedTools": [],
  "dontCrawlDirectory": false,
  "hasTrustDialogAccepted": true,
  "hasCompletedProjectOnboarding": true
}

Global settings (~/.claude/settings.json):

{
  "permissions": {
    "allow": [
      "Bash(git for-each-ref:*)",
      "Bash(git branch:*)", 
      "Bash(rg:*)",
      "Bash(grep:*)",
      "Bash(pnpm run check:*)",
      "Bash(git add:*)",
      "Bash(git push:*)",
      "Bash(pnpm test:*)",
      "Bash(npx vitest:*)",
      "Bash(find:*)",
      "Bash(pnpm run test:unit:*)",
      "Bash(rm:*)",
      "Bash(mv:*)",
      "Bash(git commit:*)",
      "Bash(git checkout:*)",
      "Bash(gh pr create:*)",
      "Bash(git fetch:*)",
      "Bash(git reset:*)",
      "Bash(pnpm install:*)",
      "Bash(cat:*)",
      "Bash(curl:*)"
    ],
    "deny": []
  },
  "model": "opus"
}

Project-local settings (.claude/settings.local.json):

{
  "permissions": {
    "allow": [
      "Bash(git for-each-ref:*)",
      "Bash(git branch:*)",
      "Bash(rg:*)",
      "Bash(grep:*)",
      "Bash(pnpm run check:*)",
      "Bash(git add:*)",
      "Bash(git push:*)",
      "Bash(pnpm test:*)",
      "Bash(npx vitest:*)",
      "Bash(find:*)",
      "Bash(pnpm run test:unit:*)",
      "Bash(rm:*)",
      "Bash(mv:*)",
      "Bash(git commit:*)",
      "Bash(git checkout:*)",
      "Bash(gh pr create:*)",
      "Bash(git fetch:*)",
      "Bash(git reset:*)",
      "Bash(pnpm install:*)"
    ],
    "deny": []
  },
  "enableAllProjectMcpServers": false
}

Additional Context

  • Git commit is explicitly listed in BOTH global and project-local settings files as "Bash(git commit:*)"
  • Other git commands (like add, push, checkout) work without permission prompts
  • The legacy claude config add allowedTools shows a deprecation warning, confirming settings.json is the correct method
  • Settings are being read correctly as other allowed commands work without prompts
  • This appears to be a bug specific to git commit command permissions

Steps to Verify

  1. Both configuration files exist and contain valid JSON
  2. Both files explicitly include "Bash(git commit:*)" in permissions.allow
  3. Other git commands in the same allow lists work correctly
  4. Only git commit triggers permission prompts despite proper configuration

View original on GitHub ↗

17 Comments

Satal · 1 year ago

I hate to ask, but did you manage to figure out how to get this to work as expected?

noughts · 1 year ago

I am using the latest version of Claude Code and the situation remains the same.

ishowshao · 1 year ago

I also encountered this bug. I think this bug can be solved by Claude Code himself.

ishowshao · 1 year ago

They should build automated processes to identify and fix issues automatically.

sijiaoh · 1 year ago

Asking Claude Code to use single quotes instead of double quotes in the git commit command should fix the issue.

Edit: If this alone doesn't resolve the issue, forbidding the use of $() should further improve things.

dfdeagle47 · 1 year ago
Asking Claude Code to use single quotes instead of double quotes in the git commit command should fix the issue.

Indeed, works on my end:

Can you commit the staged files? Be sure to use single quotes instead of double quotes like git commit -m '<message>' instead of git commit -m "<message>".

Thanks for the tip!

wolffiex collaborator · 1 year ago

Seems like a prompt-improvement-tunity

cafesao · 1 year ago

Same problem

codella · 11 months ago

Same issue

reorx · 11 months ago

same here, tried many things including specify git permissions in both .claude/settings.loca.json and ~/.claude/settings.json, tell the agent not to confirm git commit message in prompt or slash command

Flamenco · 11 months ago

@sijiaoh How on earth did you figure that out? Amazing. 👏

github-actions[bot] · 7 months ago

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.

GeoLi23 · 7 months ago

Still occuring

BenjaminKobjolke · 6 months ago

Still occuring

github-actions[bot] · 5 months ago

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.

marcindulak · 5 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 5 months ago

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.