首页 教程 常见问题

内置工具参考

## Documentation Index

Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Tools reference

Complete reference for the tools Claude Code can use, including permission requirements.

Claude Code has access to a set of built-in tools that help it understand and modify your codebase. The tool names are the exact strings you use in permission rules, subagent tool lists, and hook matchers. To disable a tool entirely, add its name to the deny array in your permission settings.

To add custom tools, connect an MCP server. To extend Claude with reusable prompt-based workflows, write a skill, which runs through the existing Skill tool rather than adding a new tool entry.

ToolDescriptionPermission Required
AgentSpawns a subagent with its own context window to handle a taskNo
AskUserQuestionAsks multiple-choice questions to gather requirements or clarify ambiguityNo
BashExecutes shell commands in your environment. See Bash tool behaviorYes
CronCreateSchedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on --resume or --continue if unexpired. See scheduled tasksNo
CronDeleteCancels a scheduled task by IDNo
CronListLists all scheduled tasks in the sessionNo
EditMakes targeted edits to specific filesYes
EnterPlanModeSwitches to plan mode to design an approach before codingNo
EnterWorktreeCreates an isolated git worktree and switches into it. Pass a path to switch into an existing worktree of the current repository instead of creating a new one. Not available to subagentsNo
ExitPlanModePresents a plan for approval and exits plan modeYes
ExitWorktreeExits a worktree session and returns to the original directory. Not available to subagentsNo
GlobFinds files based on pattern matchingNo
GrepSearches for patterns in file contentsNo
ListMcpResourcesToolLists resources exposed by connected MCP serversNo
LSPCode intelligence via language servers: jump to definitions, find references, report type errors and warnings. See LSP tool behaviorNo
MonitorRuns a command in the background and feeds each output line back to Claude, so it can react to log entries, file changes, or polled status mid-conversation. See Monitor toolYes
NotebookEditModifies Jupyter notebook cellsYes
PowerShellExecutes PowerShell commands natively. See PowerShell tool for availabilityYes
ReadReads the contents of filesNo
ReadMcpResourceToolReads a specific MCP resource by URINo
SendMessageSends a message to an agent team teammate, or resumes a subagent by its agent ID. Stopped subagents auto-resume in the background. Only available when CLAUDECODEEXPERIMENTALAGENTTEAMS=1 is setNo
SkillExecutes a skill within the main conversationYes
TaskCreateCreates a new task in the task listNo
TaskGetRetrieves full details for a specific taskNo
TaskListLists all tasks with their current statusNo
TaskOutput(Deprecated) Retrieves output from a background task. Prefer Read on the task's output file pathNo
TaskStopKills a running background task by IDNo
TaskUpdateUpdates task status, dependencies, details, or deletes tasksNo
TeamCreateCreates an agent team with multiple teammates. Only available when CLAUDECODEEXPERIMENTALAGENTTEAMS=1 is setNo
TeamDeleteDisbands an agent team and cleans up teammate processes. Only available when CLAUDECODEEXPERIMENTALAGENTTEAMS=1 is setNo
TodoWriteManages the session task checklist. Available in non-interactive mode and the Agent SDK; interactive sessions use TaskCreate, TaskGet, TaskList, and TaskUpdate insteadNo
ToolSearchSearches for and loads deferred tools when tool search is enabledNo
WebFetchFetches content from a specified URLYes
WebSearchPerforms web searchesYes
WriteCreates or overwrites filesYes

Permission rules can be configured using /permissions or in permission settings. Also see Tool-specific permission rules.

Bash tool behavior

The Bash tool runs each command in a separate process with the following persistence behavior:

Activate your virtualenv or conda environment before launching Claude Code. To make environment variables persist across Bash commands, set CLAUDEENVFILE to a shell script before launching Claude Code, or use a SessionStart hook to populate it dynamically.

LSP tool behavior

The LSP tool gives Claude code intelligence from a running language server. After each file edit, it automatically reports type errors and warnings so Claude can fix issues without a separate build step. Claude can also call it directly to navigate code:

The tool is inactive until you install a code intelligence plugin for your language. The plugin bundles the language server configuration, and you install the server binary separately.

Monitor tool

<Note>

The Monitor tool requires Claude Code v2.1.98 or later.

</Note>

The Monitor tool lets Claude watch something in the background and react when it changes, without pausing the conversation. Ask Claude to:

Claude writes a small script for the watch, runs it in the background, and receives each output line as it arrives. You keep working in the same session and Claude interjects when an event lands. Stop a monitor by asking Claude to cancel it or by ending the session.

Monitor uses the same permission rules as Bash, so allow and deny patterns you have set for Bash apply here too. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. It is also not available when DISABLETELEMETRY or CLAUDECODEDISABLENONESSENTIAL_TRAFFIC is set.

Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See plugin monitors.

PowerShell tool

The PowerShell tool lets Claude run PowerShell commands natively. On Windows, this means commands run in PowerShell instead of routing through Git Bash. On Windows without Git Bash, the tool is enabled automatically. On Windows with Git Bash installed, the tool is rolling out progressively. On Linux, macOS, and WSL, the tool is opt-in.

Enable the PowerShell tool

Set CLAUDECODEUSEPOWERSHELLTOOL=1 in your environment or in settings.json:

{
  "env": {
    "CLAUDE_CODE_USE_POWERSHELL_TOOL": "1"
  }
}

On Windows, set the variable to 0 to opt out of the rollout. On Linux, macOS, and WSL, the tool requires PowerShell 7 or later: install pwsh and ensure it is on your PATH.

On Windows, Claude Code auto-detects pwsh.exe for PowerShell 7+ with a fallback to powershell.exe for PowerShell 5.1. When the tool is enabled, Claude treats PowerShell as the primary shell. The Bash tool remains available for POSIX scripts when Git Bash is installed.

Shell selection in settings, hooks, and skills

Three additional settings control where PowerShell is used:

The same main-session working-directory reset behavior described under the Bash tool section applies to PowerShell commands, including the CLAUDEBASHMAINTAINPROJECTWORKING_DIR environment variable.

Preview limitations

The PowerShell tool has the following known limitations during the preview:

Your exact tool set depends on your provider, platform, and settings. To check what's loaded in a running session, ask Claude directly:

What tools do you have access to?

Claude gives a conversational summary. For exact MCP tool names, run /mcp.

See also