工具
Claude Code 有 45 个内置工具,分为 9 个类别。系统提示词明确指示 Claude 尽可能优先使用专用工具而不是通用 Bash 命令。
专用工具规则
系统提示词明确告诉 Claude 使用专用工具而不是 Bash 进行常见操作。 这提高了透明度并使工具调用可审查。
| 代替 | 使用 |
|---|---|
| cat / head / tail / sed | Read |
| sed / awk | Edit |
| echo > / heredoc | Write |
| find / ls | Glob |
| grep / rg | Grep |
按类别列出所有工具
Files
Read, write, edit and search the filesystem
Shell
Execute commands in the terminal
Web
Fetch URLs and search the internet
Agents
Spawn and communicate with sub-agents
Planning
Enter plan mode and manage git worktrees
Tasks
Create and track work items in the current session
Scheduling
Create cron jobs and remote triggers
UI
Interact with the user and invoke skills
MCP
Model Context Protocol: connect external tools
条件工具(功能标志)
某些工具仅在启用特定功能标志时出现。它们在标准 Claude Code 安装中不可用。
Pauses execution in autonomous mode. Required when there is nothing useful to do. Claude must never respond without calling sleep.
CronCreate, CronDelete, CronList: only available when the scheduling feature flag is enabled.
Performance and observability monitoring. Behind a separate feature flag.
Full browser automation (beyond WebFetch). Available when the browser tool flag is on.
Interactive REPL execution. Not available to external users.