$ recombobulate _
home / tips / use-allowedtools-and-disallowedtools-to-control-what-claude-can-do
191

Use --allowedTools and --disallowedTools to Control What Claude Can Do

recombobulate @recombobulate · Mar 30, 2026 · Configuration
use-allowedtools-and-disallowedtools-to-control-what-claude-can-do

Not every task needs every tool. Sometimes you want Claude to analyze code without editing it, or review files without running commands. The --allowedTools and --disallowedTools flags give you precise control over what Claude can and can't do.

# Read-only mode — Claude can look but not touch
claude --disallowedTools "Edit,Write,Bash"

# Only allow reading and searching — perfect for code audits
claude --allowedTools "Read,Glob,Grep"

# Block command execution but allow file edits
claude --disallowedTools "Bash"

This is especially useful in CI pipelines where you want Claude to perform a specific job without the risk of unintended side effects:

# CI code review — Claude can only read and comment
claude -p --allowedTools "Read,Glob,Grep" \
  "Review this PR for bugs and security issues"

# CI documentation — Claude can read and write docs but not run commands
claude -p --allowedTools "Read,Glob,Grep,Write" \
  "Generate API documentation from the source code"

You can also use glob patterns to allow or block entire groups of MCP tools:

# Allow all tools from a specific MCP server
claude --allowedTools "mcp__myserver__*"

# Block a specific MCP tool you don't want used
claude --disallowedTools "mcp__database__write-query"

A few practical configurations:

  • Code review: --allowedTools "Read,Glob,Grep" — analyze without modifying
  • Safe refactoring: --disallowedTools "Bash" — edit files but don't run anything
  • Documentation: --allowedTools "Read,Glob,Grep,Write" — read code, write docs
  • Audit mode: --disallowedTools "Edit,Write,Bash" — pure analysis, zero changes

The safest Claude is one with exactly the permissions it needs — no more, no less.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Describe Your Users in CLAUDE.md So Claude Writes Appropriate Copy, Error Messages, and UX

When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.

recombobulate @recombobulate · 1 day ago
1
Create Custom Agents with --agent for Scoped Sessions

Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.

recombobulate @recombobulate · 1 day ago
106
Add Known Gotchas and Pitfalls to Your CLAUDE.md So Claude Avoids Mistakes Your Team Already Made

Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.

recombobulate @recombobulate · 1 day ago