️ Claude Code Tools System

Intermediate Guide · 20 min read

Based on source code analysis

Overview: 54 Tools

Claude Code provides 54 tools organized into functional groups. Each tool implements a unified interface with execute, permission check, and system prompt description.

Tool Groups

File Operations (6 tools)

ToolFunction
FileReadToolRead files with line range, PDF pages, Notebook rendering
FileWriteToolWrite/create files with pre-checks
FileEditToolPrecise string replacement with unique match
GlobToolFile pattern matching (e.g., **/*.ts)
GrepToolContent search via ripgrep
NotebookEditToolJupyter Notebook cell editing

Execution (3 tools)

ToolFunction
BashToolShell commands with 25 security checks
PowerShellToolWindows PowerShell execution
REPLToolVM sandbox execution (ANT only)

Agent (2 tools)

ToolFunction
AgentToolSpawn sub-agents with 3 isolation modes
SendMessageToolInter-agent messaging

Web (2 tools)

ToolFunction
WebSearchToolWeb search via Anthropic API
WebFetchToolURL fetching with HTML→Markdown

MCP (3 tools)

ToolFunction
MCPToolMCP tool call template
ListMcpResourcesToolList MCP server resources
ReadMcpResourceToolRead specific MCP resource

Task Management (6 tools)

ToolFunction
TaskCreateToolCreate background tasks
TaskGetToolGet task status
TaskListToolList active tasks
TaskOutputToolGet task output
TaskStopToolStop running task
TaskUpdateToolUpdate task parameters

Mode Switch (4 tools)

ToolFunction
EnterPlanModeToolEnter read-only plan mode
ExitPlanModeToolExit plan mode
EnterWorktreeToolEnter Git worktree isolation
ExitWorktreeToolExit worktree

KAIROS Exclusive (4 tools)

ToolFunction
SleepToolAI主动睡眠 (non-blocking)
SendUserFileToolProactively send files to user
PushNotificationToolPush notifications to device
SubscribePRToolGitHub PR subscription

Other Tools (12+ tools)

  • SkillTool - Execute custom skills
  • LSPTool - Language Server Protocol operations
  • BriefTool - KAIROS concise interaction
  • TodoWriteTool - Task list management
  • ToolSearchTool - Lazy loading hub for deferred tools
  • ScheduleCronTool - Cron scheduling
  • TeamCreateTool / TeamDeleteTool - Multi-agent teams

Tool Interface

All tools implement unified interface:

interface Tool {
  name: string;
  description: string;
  inputSchema: JSONSchema;
  execute(input, context): AsyncGenerator;
  isAllowed(input, context): PermissionDecision;
  prompt(): string;
  needsPermission(input): boolean;
}

Lazy Loading Mechanism

Model initially sees only ~15 core tools. Remaining tools loaded via ToolSearchTool:

  • Keyword search: "notebook jupyter" → NotebookEditTool
  • Exact selection: "select:MCPTool,LSPTool" → Direct load
💡 Pro Tip: See Tools Reference for complete source code analysis of all 54 tools.