Compound command re-prompts in same session after approval

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Apr 2, 2026 · closed Apr 3, 2026

Description

When a compound Bash command using && is approved in a session, the same exact command re-prompts later in the same session. The approval doesn't appear to persist for compound commands.

Steps to reproduce

  1. Have Bash(source:*) and Bash(python3:*) in settings.json allowlist
  2. Run a compound command like: source ../venv/bin/activate && python3 -m pytest tests/test_file.py -x -q
  3. Get prompted with: 'source' evaluates arguments as shell code
  4. Approve it (option 1: Yes)
  5. Later in the same session, the exact same command runs again
  6. Get prompted again with the identical message

Expected behavior

After approving a command once in a session, the same command should not re-prompt in that session.

Observed behavior

The compound command re-prompts every time it's invoked, even within the same session.

Notes

  • Individual commands (source ... alone, python3 ... alone) do not re-prompt after approval
  • The issue appears specific to compound commands joined with &&
  • Both Bash(source:*) and Bash(python3:*) are in the allowlist, but the compound form still prompts
  • Observed across multiple sessions (different engineers/worktrees, same machine)

Environment

  • macOS (Darwin 24.2.0)
  • Claude Code CLI

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/27688
  2. https://github.com/anthropics/claude-code/issues/41940
  3. https://github.com/anthropics/claude-code/issues/28240

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

jeffAuston · 6 months ago

Adding data from our logging. We built a PermissionRequest hook that captures every permission prompt to a database.

35 prompts in 2 days for the same pattern across 3 concurrent sessions:

| Session | Prompts | Period |
|---------|---------|--------|
| Jordan | 26 | Apr 2 |
| Justin | 8 | Apr 2-3 |
| John | 1 | Apr 2 |

All are source ../venv/bin/activate && python3 <script> — the most common compound command in our workflow (every test run, every research script). Both Bash(source:*) and Bash(python3:*) are in the allowlist. The approval does not persist within a session — same command re-prompts multiple times.

This is a significant friction cost for multi-session workflows.

jeffAuston · 6 months ago

Closing as duplicate of #27688 (same root cause: compound && commands don't persist approvals). Added our quantified data (35 prompts in 2 days) to that issue.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.