Claude Code Tools
Every built-in tool Claude Code uses to read, edit, search, and manage your codebase. 23 tools across 6 categories — with real examples for each.
File Operations
Tools for reading, writing, searching, and editing files across your entire codebase. These are the most frequently used tools in any Claude Code session.
Read
Read loads file contents so Claude Code can understand your existing code before making changes. It handles text files, images, PDFs, and Jupyter notebooks, and supports reading specific line ranges for large files. Claude Code reads files automatically whenever it needs context — you rarely need to ask for it explicitly.
Claude Code reads files before every edit to make sure it has the latest version. If you have a massive file, it can read just a specific line range instead of loading the whole thing.
You: "Can you explain what the useAuth hook does?"
Claude Code: Claude Code reads src/hooks/useAuth.ts, then walks through the logic: how it manages token refresh, where it stores session state, and what the return type gives consuming components.
Write
Write creates new files from scratch or fully replaces the contents of an existing one. It's used when Claude Code needs to generate something entirely new — a config file, a new component, a migration script. For modifying existing files, Edit is preferred since it targets specific sections without touching the rest.
Write always reads the file first if it exists, so it won't accidentally overwrite something without knowing what's there. If you only need to change a few lines, Edit is the better choice.
You: "Create a Dockerfile for this Node.js project"
Claude Code: Claude Code reads the package.json to understand the project setup, then writes a Dockerfile with the right Node version, multi-stage build, proper COPY ordering for layer caching, and a production-ready CMD.
Edit
Edit performs exact string replacements in files — find the old text, replace it with new text. This is how Claude Code makes surgical changes to your code without rewriting entire files. It preserves everything else in the file exactly as-is, which means your formatting, comments, and surrounding code stay untouched.
Edit matches on exact strings, so it needs enough surrounding context to find a unique match. If your target text appears multiple times, include a few extra lines of context or use the replace_all flag to change every occurrence.
You: "Add error handling to the fetchUser function"
Claude Code: Claude Code reads the file, locates the fetchUser function, and uses Edit to wrap the fetch call in a try-catch block with proper error typing and a fallback return — changing only the lines that need to change.
Glob
Glob searches for files using patterns like **/*.tsx or src/**/test.*.js. It's fast even on huge codebases and returns results sorted by modification time. When Claude Code needs to find where something lives — a component, a config file, test files for a module — Glob is usually the first step.
Glob is the go-to for file discovery. It's much faster than running find in the shell, and Claude Code often fires off multiple Glob patterns in parallel to cast a wide net when exploring unfamiliar code.
You: "Find all the test files related to authentication"
Claude Code: Claude Code runs Glob with patterns like **/*auth*.test.{ts,tsx} and **/auth/**/*.spec.ts to locate every auth-related test file, then can summarize what's covered and what's missing.
Grep
Grep searches inside files for text matching a pattern — function names, error messages, imports, anything. It supports full regex, file type filtering, and context lines around matches. When you need to trace how something is used across a codebase, Grep finds every reference in seconds.
Grep supports ripgrep's file type filters, so searching only TypeScript files or only Python files is built in. Combine it with context lines to see the surrounding code without reading the full file.
You: "Where is the API_BASE_URL environment variable used?"
Claude Code: Claude Code runs Grep for API_BASE_URL across the whole project, showing every file and line where it appears — imports, assignments, references in config files — giving you the full picture of how that variable flows through the code.
NotebookEdit
NotebookEdit modifies individual cells in .ipynb files — replace a cell's contents, insert a new cell, or delete one. It works with both code and markdown cells. This is how Claude Code helps with data science workflows without mangling the notebook's JSON structure.
Cell numbers are 0-indexed. When inserting a cell, the new cell goes at the position you specify, pushing existing cells down. Claude Code reads the full notebook first to place new cells in a logical spot.
You: "Add a cell that visualizes the correlation matrix with a heatmap"
Claude Code: Claude Code reads the notebook to understand the existing dataframe, then inserts a new code cell with seaborn's heatmap using the right column names and a clean figure size, placed right after the data loading section.
Execution
Run shell commands directly from Claude Code to build, test, deploy, and manage your development environment.
Bash
Bash executes shell commands in your terminal, giving Claude Code the ability to run tests, install packages, manage git, spin up services, and do anything else you'd do from the command line. The working directory persists between calls, so multi-step workflows work naturally. Commands time out after 2 minutes by default, with an option to extend up to 10 minutes for longer operations.
Bash supports background execution for long-running processes like dev servers. Claude Code can start a server in the background and continue working while it runs, then check on it later.
You: "Run the test suite and fix any failures"
Claude Code: Claude Code runs npm test via Bash, reads the failure output, traces the issue back to the source, makes the fix with Edit, then re-runs the tests to confirm everything passes.
Web
Fetch live information from the internet — documentation, search results, API references, and more.
WebFetch
WebFetch grabs the content of a web page, converts it to clean markdown, and processes it with a prompt to extract what you need. It's useful for pulling in documentation, reading blog posts, checking API references, or grabbing any public web content. Results are cached for 15 minutes, so repeated fetches are fast.
WebFetch works on public URLs only — it can't access anything behind authentication like Google Docs or private Jira tickets. For GitHub content, the gh CLI through Bash is usually a better option.
You: "Check the Stripe docs for how to handle webhook signature verification"
Claude Code: Claude Code fetches the Stripe webhook documentation page, extracts the relevant section about signature verification, and explains the steps — then can implement the verification logic in your codebase using the documented approach.
WebSearch
WebSearch runs a web search and returns results that Claude Code can use to answer questions about recent events, new library versions, or anything beyond its training data. It supports domain filtering to focus results on specific sites or exclude others.
Use the allowed_domains filter to scope searches to trusted sources. For example, searching only on official documentation sites keeps results focused and reliable.
You: "What's the latest version of Next.js and what changed?"
Claude Code: Claude Code searches for the latest Next.js release, finds the version number and changelog, and summarizes the key changes — new features, breaking changes, and migration steps if you're upgrading.
Agent & Task Management
Spawn sub-agents for parallel work, create task lists to track progress on complex projects, and manage background operations.
Task
Task creates a sub-agent that runs independently with its own context window, perfect for parallelizing work that doesn't depend on each other. Need to research three different libraries, refactor two unrelated modules, or explore a large codebase? Spin up sub-agents and let them work simultaneously instead of doing everything sequentially.
Sub-agents protect your main context window from getting cluttered with intermediate research results. They're great for deep exploration tasks where you'd otherwise burn through context reading dozens of files.
You: "Compare the bundle size impact of date-fns vs dayjs vs luxon for our project"
Claude Code: Claude Code spawns three sub-agents in parallel — one per library — each analyzing bundle size, tree-shaking support, and the specific functions your codebase needs. Results come back together for a side-by-side comparison.
TaskCreate
TaskCreate builds a task list for complex, multi-step projects. Each task gets a subject, description, and active status label. This is how Claude Code organizes large refactors, multi-file changes, or any work that benefits from a visible progress tracker.
Tasks can have dependencies — use blockedBy to ensure tasks run in the right order. For example, "update database schema" should block "update API handlers" so the schema migration happens first.
You: "Migrate our REST API endpoints to use the new validation middleware"
Claude Code: Claude Code creates a task for each endpoint group — users, products, orders, auth — with descriptions of what validation changes each needs. Then it works through them one by one, marking each complete as it goes.
TaskGet
TaskGet fetches the complete details of a task by its ID — subject, description, status, and dependency information. It's used to understand exactly what a task requires before starting work on it, especially in team settings where tasks are assigned by a lead.
Always check blockedBy before starting a task. If a dependency hasn't been resolved yet, working on a blocked task usually means wasted effort or merge conflicts later.
You: An agent teammate receives a task assignment notification.
Claude Code: The agent calls TaskGet to read the full task description, checks that all blocking dependencies are resolved, then marks the task as in-progress and begins work.
TaskUpdate
TaskUpdate modifies task properties — mark it in-progress, completed, or deleted, change the description, add or remove dependencies. It's the primary way Claude Code tracks progress through a task list and signals to you (or teammate agents) what's done and what's next.
Only mark a task completed when it's actually done — tests pass, implementation is complete, no loose ends. If you hit a blocker, keep it as in-progress and create a new task for the unresolved issue.
You: Claude Code finishes migrating the user endpoints to the new validation middleware.
Claude Code: It marks the "Migrate user endpoints" task as completed, which automatically unblocks the "Integration test user endpoints" task that was waiting on it.
TaskList
TaskList shows every task in the current session — pending, in-progress, and completed — along with their dependencies and assigned owners. It's how Claude Code decides what to work on next and how it shows you overall progress on a multi-step project.
When multiple tasks are available, Claude Code prefers to work on them in ID order since earlier tasks often set up context that later tasks depend on.
You: Midway through a large refactor, you ask "What's left to do?"
Claude Code: Claude Code calls TaskList and shows you a clear summary: 4 tasks completed, 1 in progress, 2 remaining — with the in-progress task details and what's blocking the remaining ones.
TaskOutput
TaskOutput retrieves results from tasks running in the background — sub-agent research, long-running shell commands, or any async operation. It lets Claude Code check on work that's still running or collect results from work that's finished.
Background tasks are ideal for operations that take a while — running a full test suite, building a Docker image, or running a linter across a large codebase. Work on something else in the meantime.
You: Claude Code started a full test suite in the background while working on a different fix.
Claude Code: After finishing the fix, it calls TaskOutput to check the test results, sees two failures in an unrelated module, and reports them to you separately.
TaskStop
TaskStop terminates a background task that's no longer needed. If a sub-agent is doing research you no longer care about, or a background build is running against the wrong branch, TaskStop kills it so resources aren't wasted.
If a background process seems stuck or you've changed direction on a task, don't wait for it to time out — stop it and start fresh.
You: You realize the background linting task is running against an outdated config.
Claude Code: Claude Code stops the running lint task, updates the config file, then restarts the linting with the corrected settings.
Team Collaboration
Create multi-agent teams where specialized Claude Code agents work together on different parts of a project simultaneously.
TeamCreate
TeamCreate assembles a group of Claude Code agents, each with a defined role and set of capabilities. One agent might handle frontend components while another works on the API layer and a third writes tests. They coordinate through the task system and messaging, working simultaneously instead of sequentially.
Teams work best when the agents have clearly separated responsibilities with minimal overlap. Define each agent's scope tightly so they don't step on each other's changes.
You: "Build a new settings page with API endpoints and full test coverage"
Claude Code: Claude Code creates a three-agent team: a frontend agent building the React settings page, a backend agent implementing the settings API endpoints, and a testing agent writing integration and unit tests as the code comes together.
TeamDelete
TeamDelete shuts down a multi-agent team when the work is done. It sends shutdown signals to all agents on the team and cleans up resources. This is typically called by the team lead once all tasks are completed and results have been collected.
Always verify that all agents have finished their work before deleting a team. Deleting a team while agents are mid-task can leave files in a partially modified state.
You: All three agents have finished their tasks for the settings page feature.
Claude Code: The team lead verifies all tasks are marked complete, collects any final output, then calls TeamDelete to gracefully shut down the team.
SendMessage
SendMessage is how agents on a team communicate — sharing progress updates, asking questions, reporting blockers, or coordinating handoffs. It supports direct messages to specific teammates and broadcasts to the whole team. This keeps multi-agent workflows coordinated without agents overwriting each other's work.
Use direct messages for almost everything — broadcasts go to every agent on the team and are expensive. Reserve broadcasts for critical blockers that genuinely affect everyone.
You: The backend agent finishes the settings API and needs the frontend agent to know the endpoint shape.
Claude Code: The backend agent sends a direct message to the frontend agent with the API response types and endpoint URLs, so the frontend agent can build the fetch calls against the actual contract.
Planning & Interaction
Tools for designing implementation plans, gathering input, and invoking specialized workflows before writing code.
EnterPlanMode
EnterPlanMode puts Claude Code into a planning state where it outlines an approach before writing any code. This is valuable for complex changes where you want to review the strategy first — architectural decisions, multi-file refactors, or features that touch several systems. No code gets written until you approve the plan.
Plan mode is great for high-stakes changes where a wrong approach would be costly to undo. Use it whenever you'd normally spend time whiteboarding before coding.
You: "I want to add real-time notifications to the app. Plan this out before implementing."
Claude Code: Claude Code enters plan mode and outlines the approach: WebSocket connection setup, notification store design, UI component structure, backend event emission points, and a migration plan for existing polling code. You review, suggest changes, and approve before implementation starts.
ExitPlanMode
ExitPlanMode presents the completed plan for review. In a solo session, the user approves or requests changes. In a team setting, the team lead reviews the plan. Once approved, Claude Code switches from planning to implementation and starts writing code according to the agreed-upon approach.
Don't skip straight to approval if something feels off. Plans are cheap to revise; implementations are expensive to rewrite.
You: Claude Code has outlined a plan for the real-time notification system.
Claude Code: It calls ExitPlanMode, presenting the plan to you for review. You approve it with one modification — use Server-Sent Events instead of WebSockets for simpler infra. Claude Code acknowledges the change and begins implementation.
AskUserQuestion
AskUserQuestion pauses work to ask you something when Claude Code doesn't have enough information to make a confident decision. Instead of guessing and potentially going down the wrong path, it asks — with suggested options when applicable. This saves time by catching misunderstandings early.
Getting a clarifying question is a good sign — it means Claude Code identified an ambiguity that could have led to wasted effort. Quick answers here save significant rework later.
You: You ask Claude Code to "add caching to the API" but there are multiple caching strategies that could work.
Claude Code: Claude Code asks: "Should I add in-memory caching with node-cache, Redis-based caching, or HTTP cache headers? Your current setup has Redis in docker-compose, so Redis would integrate easily." It gives you options with context to make a quick decision.
Skill
Skill triggers a pre-defined workflow that's been registered with Claude Code. Skills like /commit, /review-pr, or custom project-specific skills package up common multi-step operations into a single command. They're shortcuts for things you do repeatedly.
Skills can be customized per project. If your team has specific workflows — like a deploy checklist or a PR template — they can be packaged as skills that Claude Code executes consistently every time.
You: "/commit"
Claude Code: Claude Code invokes the commit skill, which checks git status, reviews staged changes, generates a descriptive commit message following your project's conventions, and creates the commit — all from a single command.
Frequently Asked Questions
Common questions about Claude Code's built-in tools.
What tools does Claude Code have?
Claude Code has 23 built-in tools spanning file operations, shell execution, web research, task management, multi-agent collaboration, and planning. Each tool is purpose-built for a specific part of the development workflow — from reading and editing files to spawning parallel sub-agents for complex tasks.
Which Claude Code tools need permission?
Tools that modify files or execute code require your approval: Bash, Edit, Write, NotebookEdit, WebFetch, WebSearch, and Skill. Read-only tools like Read, Grep, Glob, and all Task management tools run without prompting. You can customize permission rules in your project settings.
Can Claude Code search the web?
Yes. Claude Code has two web tools: WebSearch for running searches and getting results from across the internet, and WebFetch for loading and extracting content from specific URLs. Both are useful for checking documentation, finding recent library updates, or researching solutions to problems.
How does Claude Code edit files?
Claude Code uses the Edit tool for targeted changes — it finds an exact string in the file and replaces it with new text, leaving everything else untouched. For creating new files, it uses Write. It always reads a file first to understand the current state before making any changes.
What are Claude Code sub-agents?
Sub-agents are independent Claude Code instances spawned via the Task tool. Each runs in its own context window and can work in parallel. They're useful for parallelizing research, exploring large codebases, or working on independent parts of a project simultaneously without cluttering the main conversation.
How can I monitor what Claude Code tools are doing?
You can use krabb to log every tool call Claude Code makes. It records WebFetch, WebSearch, Bash, Read, Write, and Edit calls to a local SQLite database, and provides a dashboard at localhost:4242 for live monitoring. Install it with pip install krabb && krabb init.
Claude Code also supports MCP (Model Context Protocol) servers for custom tools beyond what's listed here. Want to monitor what these tools are actually doing? Try krabb.