Skip to content

[BUG] /commit-commands:commit doesn't work when there are no commits yet #24881

@mulka

Description

@mulka

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The commit command doesn't work when there are no commits yet. Here's what happens:

/commit-commands:commit
⎿ Error: Bash command failed for pattern "!git log --oneline -10": [stderr]
fatal: your current branch 'main' does not have any commits yet

What Should Happen?

It should help the user create an initial commit.

Error Messages/Logs

Steps to Reproduce

Create a new repo with git init
Run Claude Code
Make sure commit-commands plugin is installed
Run /commit-commands:commit

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.39 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions