Core System

Tool System

45 tools, 3 execution modes — AI's Swiss Army knife

~7 min read

0+

Built-in tools

0

Categories

0

Implementation LOC

Imagine Claude is a handyman and the tool system is its toolbox.

When you say 'help me fix this bug', Claude opens the toolbox: uses search tools to find relevant code, file read tools to view content, edit tools to modify code, and Bash to run tests. It picks the right tools in the right order.

Even smarter: it can search multiple files simultaneously (parallel), but must modify files one at a time (serial) to avoid messing things up.

Tool Catalog #

Hover to see what each tool does

Shell Execution

3
Bash
PowerShell
REPL

File Operations

6
Read
Write
Edit
NotebookEdit
EnterWorktree
ExitWorktree

Search & Discovery

3
Glob
Grep
ToolSearch

Web Access

2
WebFetch
WebSearch

Agent & Coordination

6
Agent
SendMessage
TeamCreate
TeamDelete
Skill
RemoteTrigger

Task Management

7
TaskCreate
TaskUpdate
TaskList
TaskGet
TaskOutput
TaskStop
TodoWrite

MCP Protocol

4
MCPTool
ListMcpResources
ReadMcpResource
McpAuth

Configuration & IDE

11
Config
AskUserQuestion
CronCreate
LSP
EnterPlanMode
ExitPlanMode
CronDelete
CronList
Sleep
StructuredOutput
Brief

Execution Flow #

A tool call's complete journey from parsing to result

allowed

Scheduling Strategy #

Read parallel, write serial — click Run to see it in action

Tool Scheduling Simulator

Phase 1 — Read Operations (Parallel)

Glob('*.ts')
Grep('TODO')
Read('main.tsx')

Phase 2 — Write Operations (Serial)

Edit('main.tsx')
Write('test.ts')
Bash('npm test')

Core Code #

Simplified tool scheduling implementation

src/tools.tsTool Registration
Step 1 of 5
1// src/tools.ts — Tool registration with feature gates
2export function getAllBaseTools(): Tool[] {
3 return [
4 // File system tools (always enabled)
5 new ReadTool(),
6 new WriteTool(),
7 new EditTool(),
8 new GlobTool(),
9 new GrepTool(),
10
11 // Bash execution
12 new BashTool(),
13
14 // Feature-gated tools
15 ...(feature("notebooks") ? [new NotebookEditTool()] : []),
16 ...(feature("mcp") ? [new McpTool()] : []),
17
18 // Internal-only tools (runtime check)
19 ...(process.env.USER_TYPE === "internal"
20 ? [new DebugTool(), new ProfileTool()]
21 : []),
22 ];
23}

All tools are registered in a single array. Feature flags like feature('X') are evaluated at bundle time — disabled tools are stripped from production. Runtime checks (process.env) gate internal-only tools.

← → arrow keys to navigate