[BUG] commit-commands plugin: allowed-tools missing git commands used in dynamic context injection
Bug Description
The official commit-commands plugin's /commit command fails with a permission error because the allowed-tools list doesn't include all the git commands used in the dynamic context injection.
Steps to Reproduce
- Ensure you're on the
mainbranch (or any branch) - Make some changes to files
- Run
/commit - Observe the error
Expected Behavior
The /commit command should successfully gather git context via dynamic context injection and create a commit.
Actual Behavior
Error message:
Error: Bash command failed for pattern "!\`git branch --show-current\`": main
Root Cause
In plugins/commit-commands/commands/commit.md:
allowed-tools (line 2):
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
Dynamic context injection commands (lines 8-11):
- ✓
!\git status\`` (allowed) - ✗
!\git diff HEAD\`` (NOT allowed) - ✗
!\git branch --show-current\`` (NOT allowed - causes the error) - ✗
!\git log --oneline -10\`` (NOT allowed)
The dynamic context injection commands are blocked because they're not in the allowed-tools list.
Suggested Fix
Update the allowed-tools in commit.md to include all git commands used:
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git diff:*), Bash(git branch:*), Bash(git log:*)
Environment
- Claude Code CLI (latest)
- Plugin: commit-commands@claude-plugins-official
- This affects all users of the
/commitcommand
Impact
The /commit command is currently non-functional for all users due to this permissions mismatch.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗