# Tool and Settings Flags

> The launch flags that decide which tools a session has and who answers its questions. Also which settings files it reads, for one run only.

**Course:** [Claude Code Commands](https://learn.benibix.com/learn/ai-claude-code-commands)  
**Time:** 12 min

**After this lesson you can:**

- Take tools away with --tools or --disallowedTools
- Load one settings file for a CI run
- Start a locked-down session with --restricted

## How launch flags change the tools and settings of one run

Three flags shape the tools in a session, and each does a different job. --tools sets which built-in tools exist at all, such as Read, Grep and Glob. --allowedTools lists permission rules that run without asking. --disallowedTools takes tools away, or blocks the calls that match a pattern. None of them changes a settings file.

--tools only touches built-in tools. An empty pair of quotes turns them all off, and default gives the usual set. MCP tools stay, so add --disallowedTools with mcp__* to take those too. A bare name such as Edit removes that tool. A rule such as Bash(rm *) keeps the tool and blocks only the matching calls.

In a -p run, nobody can answer a permission question. --permission-prompts says who does. host, the default, sends it to the program running Claude Code, or to an MCP tool named with --permission-prompt-tool. That tool says yes or no to each call. none denies every such call instead.

--allow-dangerously-skip-permissions adds bypass mode to the modes Shift+Tab steps through. It does not start you in it. You can begin in a safer mode and switch later. Bypass mode runs each step with no question at all. Keep it to a sandbox or a machine you can throw away.

--settings loads extra settings for this run from a JSON file or string. Its values beat the same keys in your settings files, and keys it leaves out keep their usual values. Your admin's managed settings still win. --setting-sources picks which files load at all: user, project, local, or a mix.

--restricted is for a test harness on a shared machine. It removes the tools that run commands or code, and WebFetch, unless you name each one in --tools. File tools stay inside the working folders. It reads only managed settings and --settings, and it refuses bypass mode and cloud sessions.

--betas adds beta headers to the requests Claude Code sends. You use it to try an API feature still being tested, such as interleaved-thinking. It works only when you sign in with an API key, not with a Claude plan. Like every flag here, it lasts one run and leaves your files alone.

## Which tool flag to reach for

1. **--tools.** Reach for it when a run should have a short list of built-in tools and nothing else.
2. **--allowedTools.** Reach for it when the tools may stay, but a few calls should run without a question.
3. **--disallowedTools.** Reach for it to take one tool away or block a risky pattern. It can also remove every MCP tool.

```bash
claude --tools "Read,Grep,Glob" --disallowedTools "mcp__*"
claude -p "Run the checks" --setting-sources project --settings ./ci-settings.json
claude --restricted -p "Answer the question in task.md"
claude --permission-mode plan --allow-dangerously-skip-permissions
```
A tool list that can only read, with no MCP tools. Then a CI run on known settings, a locked run, and bypass offered but not on.

![Five layers stacked, highest first: managed, your admin's rules; --settings, this session only; local, .claude/settings.local.json; project, .claude/settings.json; and user, ~/.claude/settings.json. An arrow says higher wins. A bracket marks the bottom three as the files --setting-sources picks from.](https://learn.benibix.com/diagrams/flag-settings-layers.svg)

### Example: Lucy's CI run stops acting like her laptop

Lucy's CI job behaved one way on her laptop and another on the runner. Her own user settings allowed 12 extra commands.

She adds --setting-sources project and --settings ./ci-settings.json to the job. Now both machines read the same 2 files, and the runs match.

**Words in this lesson:** [--tools Flag](https://learn.benibix.com/term/ai/tools-flag), [--allowedTools Flag](https://learn.benibix.com/term/ai/allowed-tools-flag), [--disallowedTools Flag](https://learn.benibix.com/term/ai/disallowed-tools-flag), [--permission-prompts Flag](https://learn.benibix.com/term/ai/permission-prompts-flag), [--permission-prompt-tool Flag](https://learn.benibix.com/term/ai/permission-prompt-tool-flag), [--allow-dangerously-skip-permissions Flag](https://learn.benibix.com/term/ai/allow-dangerously-skip-permissions-flag), [--settings Flag](https://learn.benibix.com/term/ai/settings-flag), [--setting-sources Flag](https://learn.benibix.com/term/ai/setting-sources-flag), [--restricted Flag](https://learn.benibix.com/term/ai/restricted-flag), [--betas Flag](https://learn.benibix.com/term/ai/betas-flag)

> **Exist, skip the question, or go.** --tools decides which built-in tools exist. --allowedTools decides which calls skip the question. --disallowedTools takes tools away or blocks calls. That includes MCP tools.

**Question:** A session starts with --tools set to Read and Grep only. Can Claude still call an MCP tool?

**Answer:** Yes, --tools does not touch MCP tools. --tools only limits the built-in tools. To take MCP tools away too, add --disallowedTools with mcp__*.

---

Source: https://learn.benibix.com/learn/ai-claude-code-commands/tool-and-settings-flags
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-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
