[BUG] cargo not working in allowed tools

Resolved 💬 1 comment Opened May 23, 2025 by mattmaslin Closed May 23, 2025

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.2
  • Operating System: Ubuntu WSL
  • Terminal: Windows Terminal

Bug Description

I cannot get cargo commands to work in allowed tools. It could be related to Claude chaining commands together.

I have these rules set up in ~/.claude/settings.json:
"Bash(cargo test:*)",
"Bash(cargo:*)",
"Bash(cargo clippy:*)",

I am always prompted to allow "cargo test" and "cargo clippy" commands like:
cargo clippy --all-targets --all-features -- -D warnings 2>&1 | head -200
cargo test --doc 2>&1 | grep -A10 "FAILED"

Steps to Reproduce

  1. Set up rules to allow "cargo"
  2. Have Claude work on tasks that require "cargo test" or "cargo clippy"

Expected Behavior

"cargo test" and "cargo clippy" can run without prompting for permissions

Actual Behavior

"cargo test" and "cargo clippy" prompt for additional permissions

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗