claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Authorize all read-only commands on files like find and grep

Open mquandalle opened this issue 8 months ago • 3 comments

Sometimes Claude Code searches for some text in the directory using various combinaisons of grep, find, head, tail, etc. Since every bash command is different I have to manually authorize each one, but I really don't mind about these read-only commands without side effects and would like Claude to pursue them without my authorization on each single variation.

mquandalle avatar May 16 '25 12:05 mquandalle

You can do this by using the --allowed-tools argument when running Claude IIRC

benny-yamagata avatar May 23 '25 13:05 benny-yamagata

All of the usual tools (grep, find, head, tail) are already in the "allowed tools" section of the tool. But still, it asks for permission each time. I think that it might be because it's using some kind of pipe chain, like find . | grep

*Edit: Here is a command that it asks permission for (it's also not one where I can select "Yes, and don't ask again") find /home/skerit/someproject -type d -name "somestring" 2>/dev/null | head -1

Even though both find & head are allowed tools.

skerit avatar May 25 '25 10:05 skerit

Yes, any pipes or redirects seem to throw the permission system off.

vojtapol avatar May 29 '25 15:05 vojtapol

Thanks for the issue. This is now supported, please update to the latest version of Claude Code.

bogini avatar Sep 07 '25 16:09 bogini

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.

github-actions[bot] avatar Sep 15 '25 14:09 github-actions[bot]