Enhancement: Claude should be informed of --allowedTools in --print mode
Resolved 💬 7 comments Opened May 3, 2025 by tino Closed Jan 3, 2026
❯ claude --allowedTools 'Bash(gh:*)' --print 'which bash commands are you allowed to run?'
You can run most standard bash commands through the Bash tool, but certain search and read commands should be avoided. Specifically:
- Avoid using search commands like `find` and `grep` (use the Grep or Glob tools instead)
- Avoid read tools like `cat`, `head`, `tail`, and `ls` (use the Read and LS tools instead)
Commands for file operations, git operations, package management, and other standard shell functions are allowed.
The main prompt should be amended with what's passed to allowedTools. At least that should make non-interactive mode more robust.
I've now run into the issue that I want Claude to do something in a pull request, and I allowed gh. However, it tried to cat a file and pipe to gh and then that broke because it wasn't allowed to do that...
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗