Skip to content

[BUG] Permission prompt incorrectly triggers on cd instead of the actual command in compound bash statements #28240

@prezzz

Description

@prezzz

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?

When Claude Code generates a compound bash command using && (e.g.: cd /some/path && git add file && git commit -m "msg"), the permission approval prompt incorrectly identifies cd as the action requiring approval, showing a cd:* permission request instead of prompting for the meaningful actions (git add, git commit).
The problem repeats on every execution. The cd:* prompt keeps appearing and cannot be whitelisted for the session, making the workflow unusable.

What Should Happen?

In earlier versions, the same compound command correctly prompted for git add and git commit as the actions requiring permission, and allowed the user to whitelist them for the session.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code in a project
  2. Ask Claude to stage and commit a specific file (e.g. CLAUDE.md)
  3. Claude generates a command like: cd /path/to/repo && git add CLAUDE.md && git commit -m "update"
  4. Observe the permission prompt . It asks for approval of cd:* instead of git add / git commit
  5. Approve it. The prompt appears again on the next execution, it cannot be whitelisted

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Around 2.1.40 it was working fine

Claude Code Version

2.1.52

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows 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