In this categoryClaude Code ยท 45
- How to Install Claude Code on macOSStart
- How to Install Claude Code on Windows Natively (No WSL)
- How to Install Claude Code on Windows with WSL
- How to Start Your First Project with Claude Code
- How to Create a CLAUDE.md File for Your Project
- How to Configure Claude Code with settings.json
- How to Layer Global, Project, and Local CLAUDE.md Files
- How to Set Up a Permissions Allowlist in Claude Code
- How to Use Claude Code Inside VS Code
- How to Add a Custom Slash Command in Claude Code
- How to Create a Custom Slash Command in Claude Code
- How to Pass Arguments to a Claude Code Slash Command
- How to Use Claude Code Slash Commands (Full List + Examples)
- How to Add Custom Slash Commands to Claude Code (Arguments + Frontmatter)
- How to Fix command not found After Installing Claude Code
- How to Add Any MCP Server to Claude Code
- How to Connect an MCP Server to Claude Code
- Best MCP Servers for Coding in 2026
- How to Add a Filesystem MCP Server to Claude Code
- How to Connect the GitHub MCP Server to Claude Code
- How to Create Your First Subagent in Claude Code
- Context7 Alternatives: MCP Servers for Up-to-Date Docs
- How to Manage MCP Server Scopes in Claude Code
- How to Restrict the Tools a Subagent Can Use
- How to Debug a Failing MCP Server in Claude Code
- How to Generate Unit Tests for a Function with Claude Code
- How to Refactor a Long Function Safely with Claude Code
- How to Debug a Failing Test with Claude Code
- How to Review Your Own Diff Before Committing with Claude Code
- How to Rename a Symbol Across the Codebase with Claude Code
- How to Review a Teammate's Pull Request with Claude Code
- How to Raise Test Coverage on a Specific File with Claude Code
- How to Debug a Runtime Error from a Stack Trace with Claude Code
- How to Add an Integration Test for an API Route with Claude Code
- How to Teach Claude Code Your Test Conventions with CLAUDE.md
- How to Find Which Commit Broke a Test with Claude Code
- How to Set Up Hooks for Automation in Claude Code
- Claude Code Hooks Explained: Events, Config, and Blocking
- How to Block Risky Commands with a Claude Code Hook
- How to Auto-Format Files After Edits with a PostToolUse Hook
- How to Get a Notification When Claude Code Finishes a Task
- How to Give a Coding Agent a Clear Stop Condition
- How to Make an Agent Plan Before It Edits
- How to Keep an Agent Session Focused by Clearing Context
- How to Pin a Specific Model for One Project
How to Restrict the Tools a Subagent Can Use
Lock a subagent down to a minimal, safe tool set so it can only do the one job it was built for.
By default a subagent inherits the same tools the main session has, including Bash and file editing. For a read-only analyst or a planner you almost never want that. Restricting the tools list reduces blast radius and makes the subagent more predictable. This guide shows how the tools field works and how to verify it.
- An existing subagent file in .claude/agents
- A clear idea of which tools the job truly needs
- Claude Code open in the project
Step 1: Decide the minimum tool set
Start from nothing and add back only what the job requires. A documentation summarizer needs to read and search but should never edit or run shell commands. Leaving out Bash and Edit removes whole categories of mistakes.
| Subagent type | Reasonable tools |
|---|---|
| Read-only reviewer | Read, Grep, Glob |
| Planner that runs tests | Read, Grep, Glob, Bash |
| Refactor worker | Read, Edit, Grep, Glob |
Step 2: Set the tools field
List the allowed tools as a comma-separated value in the frontmatter. If you omit the field entirely, the subagent inherits all tools, so being explicit is the safer default.
---
name: doc-summarizer
description: Summarizes documentation files on request. Read only.
tools: Read, Grep, Glob
---
You summarize documentation. You never edit files and never run shell commands.
Return a short bullet summary plus the source file path for each point.Step 3: Verify in the agents manager
Open the agents command and inspect the subagent. The manager shows the resolved tool list so you can confirm the restriction took effect before you rely on it.
Result: the doc-summarizer subagent can read and search but has no path to edit files or run commands, so you can hand it untrusted documents without worrying about side effects.
Watch related tutorials
12:36
22:40
7:18
14:05
1:42:18
28:14New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.