Skip to content
BENIBIX Learn

Tool and Settings Flags

Level 5 · Scripts and servers

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 contentsLesson 15 of 17

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

12 mincovers 10 glossary entries

Worth reading first: Print Mode Output Flags

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

    --tools

    Reach for it when a run should have a short list of built-in tools and nothing else.

  2. 2

    --allowedTools

    Reach for it when the tools may stay, but a few calls should run without a question.

  3. 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.
--settings sits just under managed. --setting-sources picks which of the three files below it load.

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

The words for this lesson10

Check yourself

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

Finished this lesson?

Marking it complete also marks its 10 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.