Skip to content
Official Docs

Tools reference

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

Claude Code has access to a set of tools that help it understand and modify your codebase. The tool names below are the exact strings you use in permission rules, subagent tool lists, and hook matchers.

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 (gone when Claude exits). 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 itNo
ExitPlanModePresents a plan for approval and exits plan modeYes
ExitWorktreeExits a worktree session and returns to the original directoryNo
GlobFinds files based on pattern matchingNo
GrepSearches for patterns in file contentsNo
ListMcpResourcesToolLists resources exposed by connected MCP serversNo
LSPCode intelligence via language servers. Reports type errors and warnings automatically after file edits. Also supports navigation operations: jump to definitions, find references, get type info, list symbols, find implementations, trace call hierarchies. Requires a code intelligence plugin and its language server binaryNo
NotebookEditModifies Jupyter notebook cellsYes
PowerShellExecutes PowerShell commands on Windows. Opt-in preview. See PowerShell toolYes
ReadReads the contents of filesNo
ReadMcpResourceToolReads a specific MCP resource by URINo
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
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:

  • Working directory persists across commands. Set CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 to reset to the project directory after each command.
  • Environment variables do not persist. An export in one command will not be available in the next.

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

PowerShell tool

On Windows, Claude Code can run PowerShell commands natively instead of routing through Git Bash. This is an opt-in preview.

Enable the PowerShell tool

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

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

Claude Code auto-detects pwsh.exe (PowerShell 7+) with a fallback to powershell.exe (PowerShell 5.1). The Bash tool remains registered alongside the PowerShell tool, so you may need to ask Claude to use PowerShell.

Shell selection in settings, hooks, and skills

Three additional settings control where PowerShell is used:

  • "defaultShell": "powershell" in settings.json: routes interactive ! commands through PowerShell. Requires the PowerShell tool to be enabled.
  • "shell": "powershell" on individual command hooks: runs that hook in PowerShell. Hooks spawn PowerShell directly, so this works regardless of CLAUDE_CODE_USE_POWERSHELL_TOOL.
  • shell: powershell in skill frontmatter: runs !`command` blocks in PowerShell. Requires the PowerShell tool to be enabled.

Preview limitations

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

  • Auto mode does not work with the PowerShell tool yet
  • PowerShell profiles are not loaded
  • Sandboxing is not supported
  • Only supported on native Windows, not WSL
  • Git Bash is still required to start Claude Code

See also

  • Permissions: permission system, rule syntax, and tool-specific patterns
  • Subagents: configure tool access for subagents
  • Hooks: run custom commands before or after tool execution

基于 Claude Code v2.1.88 开源快照的深度分析