claude-code - 💡(How to fix) Fix [Bug] Permission matcher ignores piped commands, breaking Bash(cmd:*) allowlist rules [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52720Fetched 2026-04-24 10:41:27
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at TWH (/$bunfs/root/src/entrypoints/cli.js:2736:30496)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T03:33:53.938Z"},{"error":"Error: Tool mcp__PAL__listmodels not found\n at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.083Z"},{"error":"Error: Tool mcp__debate__listmodels not found\n at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.084Z"},{"error"…

Root Cause

Real-world impact: SIT v5.6 sleeve teammates commonly pipe Python/SQL output through head/tail/grep for readable output. Every such command hits a permission prompt. On v2.1.119 + --teammate-mode tmux, some of those prompts trigger the Ink nesting crash and kill the teammate pane. Pre-allowlisting is impractical because the combinatorial space of pipe variants is huge.

Code Example

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at TWH (/$bunfs/root/src/entrypoints/cli.js:2736:30496)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T03:33:53.938Z"},{"error":"Error: Tool mcp__PAL__listmodels not found\n    at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n    at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n    at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n    at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n    at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n    at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n    at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n    at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n    at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n    at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.083Z"},{"error":"Error: Tool mcp__debate__listmodels not found\n    at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n    at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n    at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n    at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n    at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n    at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n    at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n    at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n    at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n    at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.084Z"},{"error"
RAW_BUFFERClick to expand / collapse

Bug Description Title: Permission matcher doesn't handle piped commands — Bash(cmd:*) misses cmd … | tail, forcing unnecessary permission prompts (v2.1.119, Agent Teams)

Version: 2.1.119 Platform: macOS 15.5, iTerm2 stable, zsh Related to: The <Box> can't be nested inside <Text> Ink crash bug (filed separately) — this bug makes that one fire more often than it needs to.

Summary: .claude/settings.local.json permissions.allow entries like Bash(python3:) or Bash(/abs/path/to/python3:) match direct invocations but NOT piped variants. A teammate that pre-allowlisted python3:* still triggers a permission prompt when it calls python3 -c "..." 2>&1 | head -50. The user already trusted python3; piping its output to head shouldn't re-gate it. Combined with the Ink rendering bug, every unnecessary permission prompt is a potential teammate crash.

Repro:

  1. .claude/settings.local.json has "allow": ["Bash(python3:)", "Bash(/Users/.../venv/bin/python3:)"]
  2. Spawn a teammate with --permission-mode auto
  3. Teammate runs: python3 -c "print(1)" — ✅ no prompt (matches)
  4. Teammate runs: python3 -c "print(1)" 2>&1 | head -50 — ❌ permission prompt fires
  5. Teammate runs: python3 -c "print(1)" > /tmp/out — ❌ permission prompt fires

Real-world impact: SIT v5.6 sleeve teammates commonly pipe Python/SQL output through head/tail/grep for readable output. Every such command hits a permission prompt. On v2.1.119 + --teammate-mode tmux, some of those prompts trigger the Ink nesting crash and kill the teammate pane. Pre-allowlisting is impractical because the combinatorial space of pipe variants is huge.

Related observations:

  • Read also needs permission for any path outside the project cwd, with no simple wildcard. Allowlisting Read(/tmp/**) works but shouldn't be needed for files the agent writes itself in the same turn.
  • With --permission-mode auto, MCP tool calls are auto-approved when pre-allowlisted (good), but Bash isn't — creating a strong incentive to use MCP tools even when shell would be more natural.

Requests:

  1. Extend Bash(cmd:*) matching to pipelines and simple redirects. If all commands in the pipeline are allowlisted (or are common safe utilities like head, tail, grep, wc, sort, uniq, jq, awk, sed), the whole pipeline should auto-approve. Denied commands in the pipeline still block.
  2. Consider a Bash(*:allow-pipes) modifier so users can explicitly opt into pipeline-safe handling per rule, instead of guessing an ever-growing pattern list.
  3. Document the matcher semantics. Current behavior (pipeline breaks prefix match) is not documented anywhere I could find, and nothing in the UI explains why a pre-allowlisted command still prompted.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.119
  • Feedback ID: c682269b-aa50-4c8b-a40e-c5d66a111719

Errors

[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at TWH (/$bunfs/root/src/entrypoints/cli.js:2736:30496)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T03:33:53.938Z"},{"error":"Error: Tool mcp__PAL__listmodels not found\n    at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n    at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n    at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n    at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n    at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n    at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n    at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n    at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n    at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n    at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.083Z"},{"error":"Error: Tool mcp__debate__listmodels not found\n    at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n    at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n    at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n    at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n    at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n    at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n    at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n    at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n    at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n    at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.084Z"},{"error"

Note: Content was truncated.

extent analysis

TL;DR

The permission matcher in Bash commands does not handle piped commands, causing unnecessary permission prompts when a pre-allowlisted command is used in a pipeline.

Guidance

  1. Extend Bash matching to pipelines: Modify the permission matcher to handle piped commands, allowing the whole pipeline to auto-approve if all commands are allowlisted or are common safe utilities.
  2. Introduce a Bash modifier for pipeline-safe handling: Consider adding a Bash(*:allow-pipes) modifier to enable pipeline-safe handling per rule, giving users explicit control over pipeline handling.
  3. Document matcher semantics: Clearly document the current behavior and any changes made to the permission matcher to avoid confusion and unexpected prompts.
  4. Verify pipeline handling: Test the modified permission matcher with various pipeline scenarios to ensure it correctly handles allowlisted commands and common safe utilities.
  5. Review error logs: Examine the provided error logs to identify any potential issues unrelated to the permission matcher that may be contributing to the problem.

Example

No code snippet is provided as the issue description does not include specific code that needs modification. However, an example of how the Bash(*:allow-pipes) modifier could be used in a settings.local.json file might look like:

{
  "allow": [
    "Bash(python3:*:allow-pipes)",
    "Bash(/abs/path/to/python3:*:allow-pipes)"
  ]
}

This would enable pipeline-safe handling for python3 commands.

Notes

The provided issue description lacks specific details about the implementation of the permission matcher, so the guidance is based on the described behavior and requested changes. The introduction of a new modifier or changes to the matcher's logic may require additional development and testing.

Recommendation

Apply a workaround by explicitly allowlisting common safe utilities like head, tail, grep, etc., until a permanent fix is implemented. This will

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Permission matcher ignores piped commands, breaking Bash(cmd:*) allowlist rules [1 comments, 2 participants]