From c27f8913650207a110b1d52dd30a36645489702b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 9 Feb 2026 00:12:16 +0000 Subject: [PATCH] fix(claude/commands): add missing tool permissions to rebase command Context template commands go through the tool permission system, so all git subcommands used in context and task steps need allowed-tools entries. Add git status, git branch, and git rev-parse. Replace piped git symbolic-ref|sed with git rev-parse --abbrev-ref to avoid needing a sed permission. Co-Authored-By: Claude Opus 4.6 --- claude/commands/rebase.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/claude/commands/rebase.md b/claude/commands/rebase.md index 3770599..3f49b7b 100644 --- a/claude/commands/rebase.md +++ b/claude/commands/rebase.md @@ -1,12 +1,12 @@ --- -allowed-tools: Bash(git fetch:*), Bash(git rebase:*), Bash(git stash:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Read, Edit +allowed-tools: Bash(git fetch:*), Bash(git rebase:*), Bash(git stash:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git branch:*), Bash(git rev-parse:*), Read, Edit description: Rebase current branch onto upstream main/master --- ## Context - Current branch: !`git branch --show-current` -- Default branch: !`git remote show origin | sed -n 's/.*HEAD branch: //p'` +- Default branch: !`git rev-parse --abbrev-ref origin/HEAD 2>/dev/null` - Uncommitted changes: !`git status --short` ## Your Task @@ -17,7 +17,7 @@ Rebase the current branch onto the upstream default branch (main or master). `git stash push -m "auto-stash before rebase"`. 2. Fetch the latest from origin: `git fetch origin`. 3. Rebase onto the default branch using the value from context above: - `git rebase origin/`. + `git rebase `. 4. If the rebase succeeds and changes were stashed in step 1, run `git stash pop`. 5. Show the result with `git log --oneline -10`.