Docs: Explicit `Bash` tool restriction against `find` and `grep` is undocumented
Title: Docs: Explicit Bash tool restriction against find and grep is undocumented
Body:
Hi Anthropic Team,
I'm writing to report a significant discrepancy between the public documentation for the Bash tool and its actual, hard-coded behavior, which can lead to user confusion.
Problem Description
The public documentation implies that the Bash tool can be configured to run any standard shell command. However, Claude Code's internal system prompt explicitly forbids the model from using file-searching commands like find and grep, directing it instead to use the native Glob and Grep tools.
This is not a soft preference; it is a direct and capitalized instruction within the tool's own definition.
Evidence from the internal system prompt:
Within the instructions for the Bash tool, it states:
VERY IMPORTANT: You MUST avoid using search commands likefindandgrep. Instead use Grep, Glob, or Task to search.
This is further reinforced in the instructions for the Grep tool:
USAGE: ALWAYS use Grep for search tasks. NEVER invokegreporrgas a Bash command. The Grep tool has been optimized for correct permissions and access.
This core limitation is not mentioned anywhere in the public-facing documentation.
Impact on User Experience
This omission creates a frustrating and confusing user experience. A developer might follow the documentation precisely:
- They read about the
Bashtool on the Settings and IAM pages. - They configure their
settings.jsonto permitBashcommands (e.g.,"allow": ["Bash"]). - They ask Claude to perform a standard search, like
grep -r "my-function" .. - Claude refuses, appearing to ignore its explicit permissions.
This makes the tool feel unpredictable and broken, as it is operating on a set of internal rules that are invisible to the user. While the documentation correctly lists curl and wget as blocked for security, the silence regarding find and grep implies they should be usable.
Relevant Documentation Pages
- Settings: The "Tools available to Claude" table lists
Bash,Glob, andGrepseparately but does not describe the mandatory relationship between them. - IAM: The guide for configuring
Bashpermissions gives no indication that certain common commands are restricted by design.
Suggested Solution
To align the documentation with the tool's actual behavior, I strongly recommend adding a clarifying note where the Bash tool is discussed. The IAM and Settings pages are the most logical locations.
Example Text for Documentation:
Note on Search Commands: For file and content searching, Claude Code is heavily optimized to use its dedicatedGrepandGlobtools. The model is explicitly instructed to avoid using shell commands likefindandgrepvia theBashtool. For all search-related tasks, please configure permissions for and rely on the nativeGrepandGlobtools.
Adding this simple clarification would set clear expectations, prevent user confusion, and guide users toward the intended and most effective use of Claude Code's tools.
Thank you for creating such a powerful tool. I believe this change will significantly improve the user experience.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗