Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .claude/commands/commit-push-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*)
description: Commit, push, and open a PR
---

<!-- Source: https://github.com/anthropics/claude-code/blob/main/.claude/commands/commit-push-pr.md -->

## Context

- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
Comment on lines +2 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The allowed-tools specification for the commit-push-pr command uses the invalid git flag git checkout --branch, which will cause the command to fail.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The .claude/commands/commit-push-pr.md file specifies allowed-tools: Bash(git checkout --branch:*). The --branch flag is not a valid option for the git checkout command; the correct flag to create a new branch is -b. When the command is invoked, it will attempt to execute git checkout --branch <branchname>, which will fail with a git error about an unrecognized flag. This failure at the first step prevents the entire workflow of creating a branch and pull request from completing.

💡 Suggested Fix

In the allowed-tools section of .claude/commands/commit-push-pr.md, replace the invalid git checkout --branch:* with the correct syntax, git checkout -b *. This will allow the tool to correctly create new branches as intended.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .claude/commands/commit-push-pr.md#L2-L11

Potential issue: The `.claude/commands/commit-push-pr.md` file specifies `allowed-tools:
Bash(git checkout --branch:*)`. The `--branch` flag is not a valid option for the `git
checkout` command; the correct flag to create a new branch is `-b`. When the command is
invoked, it will attempt to execute `git checkout --branch <branchname>`, which will
fail with a git error about an unrecognized flag. This failure at the first step
prevents the entire workflow of creating a branch and pull request from completing.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6872053

- Current branch: !`git branch --show-current`

## Your task

Based on the above changes:
1. Create a new branch if on main
2. Create a single commit with an appropriate message
3. Push the branch to origin
4. Create a pull request using `gh pr create`
5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
Loading