Skip to content
BENIBIX Learn

--disallowedTools Flag

Also known as claude --disallowedTools, --disallowed-tools, --disallowedTools "mcp__*"

It lists tools, or uses of them, that are not allowed.

Think of it like

It is like a sign on a door that says this room is closed.

Example

Emma lets Claude run tests but not delete files. She adds --disallowedTools "Bash(rm *)", so Bash still works for everything else.

Why it matters

You can block one risky use and keep the rest of a tool.

Definition

--disallowedTools lists deny rules that hold for this one session. A bare tool name, such as Edit, takes that tool away from Claude. "*" takes away every tool, and "mcp__*" every MCP tool. A rule with a pattern, such as "Bash(rm *)", keeps the tool but blocks the calls that match it.

Example code

bash
claude --disallowedTools "Bash(rm *)" "mcp__*"
Block rm commands and every MCP tool.
This flag is the last gate. It takes tools away or shuts them.

Common mistake

Trusting a pattern to catch every form. "Bash(rm *)" matches as written, so a command that deletes some other way can slip past.

Key takeaways

  1. 1
    Bare name. Removes the tool.
  2. 2
    A pattern. Blocks matching calls.
  3. 3
    mcp__*. All MCP tools.

Learn it properly