# --disallowedTools Flag

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --disallowedTools, --disallowed-tools, --disallowedTools "mcp__*"

## Think of it like

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

## 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

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

## Example code

```bash
claude --disallowedTools "Bash(rm *)" "mcp__*"
```

Block rm commands and every MCP tool.

## Why it matters

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

## 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.

## Three principles

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

## Related terms

- [Permission Rule](https://learn.benibix.com/term/ai/permission-rule)
- [--tools Flag](https://learn.benibix.com/term/ai/tools-flag)
- [--allowedTools Flag](https://learn.benibix.com/term/ai/allowed-tools-flag)
- [MCP Tool](https://learn.benibix.com/term/ai/mcp-tool)

## Taught in

- [Tool and Settings Flags](https://learn.benibix.com/learn/ai-claude-code-commands/tool-and-settings-flags): Claude Code Commands, 15/17

![--tools sets which tools exist, --allowedTools which skip asking, --disallowedTools which go.](https://learn.benibix.com/diagrams/flag-tools.svg)

---

Source: https://learn.benibix.com/term/ai/disallowed-tools-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
