[BUG] /commit-commands:commit doesn't work when there are no commits yet
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Reopening the same issue as before. It is still occurring with the latest version. https://github.com/anthropics/claude-code/issues/24881
The commit command doesn't work when there are no commits yet. Here's what happens:
/commit-commands:commit
⎿ Error: Shell 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.112
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗