Docs: Explicit `Bash` tool restriction against `find` and `grep` is undocumented

Resolved 💬 3 comments Opened Sep 1, 2025 by coygeek Closed Jan 5, 2026

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 like find and grep. 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 invoke grep or rg as 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:

  1. They read about the Bash tool on the Settings and IAM pages.
  2. They configure their settings.json to permit Bash commands (e.g., "allow": ["Bash"]).
  3. They ask Claude to perform a standard search, like grep -r "my-function" ..
  4. 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, and Grep separately but does not describe the mandatory relationship between them.
  • IAM: The guide for configuring Bash permissions 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 dedicated Grep and Glob tools. The model is explicitly instructed to avoid using shell commands like find and grep via the Bash tool. For all search-related tasks, please configure permissions for and rely on the native Grep and Glob tools.

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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗