OmniscioGuidesClaude Code read-only permissions
Claude Code read-only permissions for safe exploration
Sometimes you want Claude to read the repository and tell you what it thinks, with no chance of it editing anything: a review, an audit, a second opinion on a bug.
This block is that session. It removes the editing tools, pre-approves the reading commands, and names the writes that stay refused.
Checked against Anthropic’s Claude Code permission documentation. By the Omniscio team. Updated .
The block
{
"permissions": {
"deny": [
"Edit",
"Write",
"NotebookEdit",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(rm *)",
"Bash(mv *)"
],
"allow": [
"Bash(rg *)",
"Bash(git status)",
"Bash(git log *)",
"Bash(git diff *)",
"Bash(git show *)"
]
}
}The seven deny rules are the whole point. Three are bare tool names, and a bare tool name in deny does more than block matching calls: it removes the tool from Claude’s context, so Claude never sees it and cannot try. A scoped rule such as Bash(rm *) works the other way: the tool stays available and the matching calls are refused when Claude attempts them.
Allow rules are evaluated last. They add commands that run without a prompt; they cannot reopen anything the deny list refuses, because deny is checked before allow and specificity never reorders them. The block leaves ask empty: nothing here needs a middle tier between allowed and refused.
What the main rules match
| Rule | Effect |
|---|---|
Edit | The Edit tool is removed from Claude’s context. Edit rules are also the ones that cover the built-in file-editing tools |
Write | The Write tool is removed. A path rule such as Write(docs/**) would match nothing, so the bare name is the shape that works |
NotebookEdit | Jupyter notebook edits are removed by its bare name. A Read deny does not cover NotebookEdit; an Edit(path) rule is the other shape that does |
Bash(git commit *) | Refuses git commit -m "x", and bare git commit too, because a trailing wildcard with a space also matches the bare command |
Bash(git push *) | Refuses git push and git push origin main. It does not match git -C . push |
Bash(rm *) | Refuses rm -rf build/. It does not match /bin/rm or sh -c 'rm ...' |
Bash(mv *) | Refuses mv src old/, and bare mv too, because a trailing wildcard with a space also matches the bare command |
Bash(rg *) | Allows ripgrep without a prompt. The built-in read-only set covers grep, not rg, so this one is worth its line |
Bash(git diff *) | Allows every diff form: git diff, git diff --stat, git diff main...HEAD. The git log and git show rules work the same way |
Claude Code already runs a built-in set of read-only commands without a permission prompt in every mode: ls, cat, echo, pwd, head, tail, grep, find, wc, which, diff, stat, du, cd and read-only forms of git. The allow list here is not what makes those work; it covers the reader you actually use, and keeps the intent visible in a committed file.
Every Bash rule in the deny list is scoped rather than a bare Bash, so Claude can still run the readers you allowed; and every wildcard sits after its subcommand, which is where a Bash rule has to put it.
What this does not stop
Be clear about the boundary before you rely on it.
- A Bash deny is not a wall around the program.
Bash(rm *)stops the invocation Claude normally writes./bin/rm -rf build/,bash -c 'rm -rf build/'and a script that callsrmitself are different command texts. Anthropic says these rules cover the invocation Claude usually produces and are not a security boundary. - A script that opens files writes them without a rule noticing. Permission rules apply to Claude’s tools. A Python or Node script that opens a file itself is not a Read or Edit call.
- Output redirection is its own check. For
> file,>> fileand2> file, Claude Code checks the target against your Edit allow and deny rules, protected paths, and the working directories. That is a check on the target, separate from the tool being removed. - Commands you did not name still prompt. That is the useful half: this block does not need to enumerate every write, because anything outside the allow list waits for you.
If you need enforcement that does not depend on the command text, Anthropic points to two tools: sandboxing, which restricts a shell command’s filesystem and network access at the OS level, and a PreToolUse hook, which can inspect the full command and refuse it. Plan mode is the other lever: it keeps Claude to reading and read-only shell commands and will not let it edit your source files, and the permission modes page covers what it asks.
Where the block goes
Put this in ~/.claude/settings.json if the read-only habit is yours, or in .claude/settings.local.json if it is for this project only. Do not commit it to a shared .claude/settings.json unless the whole team wants it: deny rules apply to everyone who loads the file.
Deny rules apply in every session, trusted or not, unlike a project’s allow rules, which wait for the workspace trust dialog. Lists merge across files, so a teammate’s allow entry in the shared file still applies unless one of these deny rules matches it first.
For a one-off run, --disallowedTools "Edit" "Write" "NotebookEdit" adds those three tool denies for that session only; the Bash denies need their own entries on the same flag. A deny from any settings file still blocks a tool --allowedTools names as allowed.
Confirm it took effect
- Run
/permissionsand read the list: the three bare tools should appear as deny rules, and the dialog names the file each rule came from. - Ask Claude to edit a file. With the tool removed from its context, it should say it cannot edit rather than offering an edit.
- Ask it to run
rm -rf build. It should be refused. Then ask forgit diff --stat: no prompt.
Edits to a settings file reach a running session without a restart; a rule you add applies from Claude’s next tool call. If a rule seems to do nothing, /status shows which settings files loaded and claude doctor lists entries Claude Code rejected.
The common mistake
Writing a path rule for a tool that does not read one. Write(docs/**), Grep(docs/**) and Glob(docs/**) are accepted but match nothing. File permissions are checked against Edit(path) and Read(path) rules, so a read-only intent written as Write(**) silently approves nothing and blocks nothing.
The second mistake is expecting the deny list to make the shell read-only. It does not: a deny rule matches a command text, and a different spelling of the same program is a different text. If that gap matters, pair the block with plan mode or a sandbox rather than adding more prefixes.
Where these answers come from
- Bare tool names versus scoped rules, the deny-first order, and the limits of Bash rules: Configure permissions, read November 25, 2026.
- The built-in read-only command set and the redirection check: the same page, the “Read-only commands” and “Redirections” sections.
- That
Write,GlobandGreppath rules do not match: the same page, “Write(path),Glob(path), andGrep(path)rules don’t match”. - Where the files live and what wins: Settings files and precedence.
Common questions
Does a bare Edit deny stop Bash from writing files?
Partly. The editing tools are gone, and Claude Code also checks the target of >, >> and 2> against Edit rules, protected paths and the working directories. A write through a command it does not recognize, or a script that opens files itself, is not stopped.
Is plan mode the same as read-only permissions?
No. Plan mode keeps Claude to reading and read-only shell commands and will not let it edit your source files until you approve a plan. These rules refuse the tools outright, in every mode, which is a difference that shows up in a session nobody is watching.
Why allow commands Claude Code already runs without a prompt?
The built-in read-only set covers grep, find and read-only forms of git, not rg. Only the rg entry adds a command; the git entries mainly keep a form with an unquoted glob from prompting, and they make a committed file say what the session is for.
Can one teammate override these deny rules?
No. Deny rules from any scope are evaluated before allow rules, and an allow rule cannot carve an exception out of a deny. A teammate can add allow entries, but not reopen what this list refuses.