Skip to content

[BUG] Bash comments break permissions #29582

@jnjaeschke

Description

@jnjaeschke

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?

Since a few days ago Claude Code sometimes adds comments to tool executions, like this:

# Check the diff
git diff ....

Even if the allowlist contains Bash(git:*), I need to manually approve.

The same happens if the comment is after the command, or if the command itself uses the # sign for whatever reason.

What Should Happen?

If Claude Code runs a command, it should not add comments around it, so that tools from the allowlist execute without manual approval.

Error Messages/Logs

Steps to Reproduce

This mostly happens when I try to let it do a large task autonomously, which involves lots of external tool calls, for example reworking a coding task from one approach to another, which involves heavy git work.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.34 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    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