[BUG] Sandboxed Bash output corruption during git operations; direct git ref reads remain correct

Open 💬 2 comments Opened Jun 27, 2026 by yo1t

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?

Sandboxed Bash tool output becomes corrupted during git operations and compound commands.

The underlying git/filesystem state remains correct, but the output shown to Claude is sometimes polluted with unrelated strings, truncated mid-stream, or rejected by the dispatcher. This happened during git history operations such as git log, git rebase, git cherry-pick, and git push, especially with pipes, loops, xargs, or larger outputs.

One observed error was:

command not recognized by the dispatcher

for git cherry-pick.

What Should Happen?

The Bash tool should return the actual stdout/stderr from the command, or clearly report a tool-internal failure.

Valid git commands such as git cherry-pick should not be rejected by the dispatcher, and Bash output should not contain unrelated injected strings or misleading/truncated git history output.

Error Messages/Logs

command not recognized by the dispatcher

Other observed symptoms:
- unrelated push-error fragments appeared in unrelated git output
- unrelated text such as "PADDING handling etc." appeared in output
- git output was truncated mid-stream
- commit hashes shown in Bash output became misleading

Steps to Reproduce

I do not yet have a minimal deterministic repro, but the issue was observed under these conditions:

  1. Start Claude Code with sandboxed Bash enabled on darwin.
  2. Work in a git repository for a long session.
  3. Run git history operations such as:
   git log
   git rebase
   git cherry-pick
   git push
  1. Use compound command shapes such as:git log ... | tail
   git log ... | tail
   for ...; do ...; done
   ... | xargs ...
  1. After enough output / late-session usage, Bash tool output may become polluted with unrelated strings or truncated.
  2. In one case, git cherry-pick was rejected with:command not recognized by the dispatcher

command not recognized by the dispatcher

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude 1.15962.1 (1e236d) 2026-06-26T19:44:44.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Possibly related issues, but not exact duplicates:

  • #63825
  • #63966
  • #64135
  • #66804
  • #62418

This report seems distinct because direct git ref reads remained correct, redirect-to-file readback was intact, and disabling the sandbox largely normalized the Bash output. That points to the sandboxed Bash dispatcher / output post-processing path rather than git or the filesystem.

View original on GitHub ↗

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