What tools are
Tools are the actions Claude Code can take autonomously: reading files, running shell commands, searching codebases, spawning sub-agents, and more. The model requests a tool call; Claude Code checks permissions, executes the tool, and returns the result to the model. The tool interface is defined inTool.ts. The full tool pool is assembled at runtime in tools.ts. Individual tool implementations live under tools/.
The Tool interface
Every tool — built-in or from an MCP server — satisfies theTool<Input, Output> generic type defined in Tool.ts:
inputSchemais a Zod schema. Claude Code callstool.inputSchema.parse(input)before everycheckPermissionsandcallinvocation to validate the model’s arguments.maxResultSizeCharscontrols when a result is too large to return inline. Results that exceed this limit are persisted to a temp file and Claude receives a path-based preview instead.isConcurrencySafedetermines whether the tool can run in parallel with other tools within the same model turn.isDestructiveis checked by the permission system to decide whether to prompt before execution.
Built-in tool categories
File tools
Read, write, and edit files on disk.
FileReadTool— reads files with optional line-range supportFileEditTool— AI-powered targeted editsFileWriteTool— full file creation or overwrite
Shell tools
Execute commands in a shell process.
BashTool— runs arbitrary shell commands (with sandbox support)PowerShellTool— Windows PowerShell execution (feature-flagged)
Search tools
Search file contents and directory trees.
GrepTool— ripgrep-powered code searchGlobTool— file pattern matching
Agent tools
Spawn and communicate with sub-agents.
AgentTool— spawns a sub-agent with its own query loopTaskCreateTool— creates background tasksTeamCreateTool— creates a named team of agentsSendMessageTool— sends messages between agents (mailbox)
Web tools
Access the internet.
WebSearchTool— web searchWebFetchTool— fetches and returns URL content
MCP tools
Proxy tool calls to MCP servers.
MCPTool— executes a tool on a connected MCP serverListMcpResourcesTool— lists available resources from MCP serversReadMcpResourceTool— reads a specific MCP resource
Utility tools
Miscellaneous helpers.
TodoWriteTool— manages a structured todo listSleepTool— timed delay (Kairos/proactive mode)ScheduleCronTool— creates, deletes, and lists cron triggersSkillTool— invokes a skill/workflow definitionNotebookEditTool— edits Jupyter notebook cellsLSPTool— queries the Language Server Protocol for diagnostics, definitions, and references
Plan mode tools
Control plan mode transitions.
EnterPlanModeTool— switches the session to plan modeExitPlanModeV2Tool— exits plan mode and resumes execution
Tool assembly (tools.ts)
tools.ts exports a function that builds the active tool pool at session start. It applies several filters:
- Feature flags — tools gated behind
bun:bundlefeature flags (e.g.SleepToolrequiresPROACTIVEorKAIROS) are excluded from public builds via dead-code elimination. - Environment flags — some tools are restricted to
USER_TYPE === 'ant'(internal Anthropic builds). - Runtime capability checks —
tool.isEnabled()is called to exclude tools whose dependencies are not available (e.g.LSPToolwhen no LSP server is running). - Deny rules — tools matched by an
alwaysDenypermission rule are removed from the pool before the model sees them.
Tools array is passed into ToolUseContext and made available to every tool’s call() and checkPermissions() methods.
Permission checking
Before Claude Code calls a tool, theuseCanUseTool hook runs the full permission pipeline (see Permissions). The pipeline signature is:
allow, deny, or ask (which surfaces an interactive dialog in the REPL).
Tool result storage
When a tool returns a result larger thantool.maxResultSizeChars, Claude Code writes the content to a temporary file and sends Claude a truncated preview with the file path. This prevents oversized tool results from consuming the context window.
MCP tools
When an MCP server is connected, Claude Code dynamically createsMCPTool instances for each tool the server advertises. These tools proxy calls to the MCP server over the MCP protocol.
MCP tools set isMcp: true and populate mcpInfo.serverName / mcpInfo.toolName. The permission system uses these fields for server-level allow/deny rules (e.g. the rule mcp__my_server covers all tools from my_server).
To add MCP servers, configure them in your project’s .claude/settings.json or via the /mcp slash command.