[BUG] /commit-commands:commit does not work in sandbox

Resolved 💬 3 comments Opened Mar 11, 2026 by chrikoch Closed Mar 15, 2026

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?

Calling /commit-commands:commit when sandbox is activated fails. Disabling the sandbox and calling it again works. It probably get's confused by a "HEAD" file? I'm running claude in WSL.

 /commit-commands:commit
  ⎿  Error: Bash command failed for pattern "!git diff HEAD": [stderr]
     fatal: ambiguous argument 'HEAD': both revision and filename
     Use '--' to separate paths from revisions, like this:
     'git  [...] -- [...]'

❯ /sandbox
  ⎿  ○ Sandbox disabled

❯ /commit-commands:commit

● Bash(git add xxxxxxx)
  ⎿  [main xxxxxxx] xxxxxxx
      9 files changed, 425 insertions(+), 454 deletions(-)
      delete mode 100644 xxxxxxx
      delete mode 100644 xxxxxxxx

What Should Happen?

create a commit

Error Messages/Logs

Steps to Reproduce

  1. user sandbox
  2. make it change some files
  3. run /commit-commands:commit

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.72

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗