Skip to content

Conversation

@runningcode
Copy link
Contributor

Summary

Add a new slash command that automates the workflow of creating a branch, committing changes, pushing to origin, and creating a pull request.

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

🤖 Generated with Claude Code

Add a new slash command that automates the workflow of:
- Creating a branch if on main
- Committing changes with an appropriate message
- Pushing to origin
- Creating a pull request

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Comment on lines +2 to +11
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`
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

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.92%. Comparing base (7551f63) to head (0e948fe).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #518   +/-   ##
=======================================
  Coverage   80.92%   80.92%           
=======================================
  Files         164      164           
  Lines       14248    14248           
  Branches     1505     1505           
=======================================
  Hits        11530    11530           
  Misses       2148     2148           
  Partials      570      570           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants