Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt

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

Tools are the capabilities Claude uses to interact with your filesystem, shell, browser, and external services. Claude selects tools automatically based on the task; you do not invoke them directly. You can control which tools Claude is permitted to use via /permissions or by editing settings.json.
Most tools require explicit permission the first time Claude uses them in a given scope. Claude asks before taking any action it has not been explicitly allowed to perform.

File & Filesystem Tools

Tool name: ReadReads a file from the local filesystem. Claude can read any file accessible to the process, including text files, images (PNG, JPG, and other formats), PDFs, and Jupyter notebooks (.ipynb).Input parameters:
ParameterTypeRequiredDescription
file_pathstringYesAbsolute path to the file to read
offsetnumberNoLine number to start reading from (1-indexed)
limitnumberNoMaximum number of lines to read (default: 2000)
Behavior:
  • File paths must be absolute, not relative.
  • Returns up to 2000 lines by default, with line numbers prefixed (cat -n format).
  • For large files, Claude can call the tool multiple times with offset to read in sections.
  • For image files, the content is returned as a visual attachment (Claude Code is multimodal).
  • For PDF files, up to 20 pages per request; large PDFs require the pages parameter (e.g., "1-5").
  • For Jupyter notebooks, returns all cells with their outputs.
  • If the file has not changed since the last read in this session, Claude receives a notice to reuse the cached content.
Permission behavior: Claude must have read permission for the file’s directory. Read operations are considered read-only and safe.
Tool name: WriteWrites content to a file, creating it if it does not exist or overwriting it entirely if it does.Input parameters:
ParameterTypeRequiredDescription
file_pathstringYesAbsolute path to the file to write
contentstringYesThe full content to write to the file
Behavior:
  • Always writes the complete file content — there is no partial-write mode.
  • When overwriting an existing file, produces a diff patch for display.
  • Notifies connected IDE extensions (VS Code) about the change.
  • Tracks file history for undo support when file history is enabled.
  • Automatically creates parent directories if they do not exist.
Permission behavior: Requires write permission for the target path. Claude asks for permission the first time it writes to a new directory unless you have configured a blanket write rule.
Tool name: EditPerforms an exact string replacement in a file. This is the preferred tool for modifying existing files because it only changes the specific text you target, leaving the rest of the file untouched.Input parameters:
ParameterTypeRequiredDescription
file_pathstringYesAbsolute path to the file to modify
old_stringstringYesThe exact text to replace (must be unique in the file unless replace_all is true)
new_stringstringYesThe replacement text
replace_allbooleanNoReplace all occurrences of old_string (default: false)
Behavior:
  • The edit fails if old_string is not found in the file.
  • The edit fails if old_string matches multiple locations and replace_all is false.
  • Produces a structured diff patch for review and display.
  • Notifies connected IDE extensions about the change.
  • Tracks file history for undo support.
Permission behavior: Requires write permission for the target file path. Uses the same permission rules as Write.
Tool name: GlobFinds files matching a glob pattern within a directory. Returns matching file paths sorted by modification time (most recently modified first).Input parameters:
ParameterTypeRequiredDescription
patternstringYesThe glob pattern to match (e.g., **/*.ts, src/**/*.test.js)
pathstringNoDirectory to search in. Defaults to the current working directory
Behavior:
  • Results are sorted by modification time, most recent first.
  • Returns up to 100 matching file paths; results are truncated beyond that.
  • Ignores directories and returns only file paths.
  • Version control directories (.git, .svn, etc.) are automatically excluded.
Permission behavior: Read-only. Requires read permission for the target directory.
Tool name: GrepSearches file contents using regular expressions via ripgrep (rg). Supports multiple output modes, context lines, case-insensitive search, file type filtering, and pagination.Input parameters:
ParameterTypeRequiredDescription
patternstringYesRegular expression to search for
pathstringNoFile or directory to search (defaults to current working directory)
globstringNoGlob pattern to filter files (e.g., *.ts, *.{js,jsx})
output_modestringNo"content" (matching lines), "files_with_matches" (file paths only), or "count" (match counts). Defaults to "files_with_matches"
-BnumberNoLines of context before each match (requires output_mode: "content")
-AnumberNoLines of context after each match (requires output_mode: "content")
-C / contextnumberNoLines of context before and after each match
-nbooleanNoShow line numbers (requires output_mode: "content", defaults to true)
-ibooleanNoCase-insensitive search
typestringNoFile type filter (e.g., js, py, rust, go)
head_limitnumberNoLimit output to first N lines/entries (default: 250; pass 0 for unlimited)
offsetnumberNoSkip first N lines/entries before applying head_limit
multilinebooleanNoEnable multiline mode (. matches newlines)
Permission behavior: Read-only. Requires read permission for the search directory.
Tool name: NotebookEditEdits cells in a Jupyter notebook (.ipynb) file. Supports replacing, inserting, and deleting cells.Input parameters:
ParameterTypeRequiredDescription
notebook_pathstringYesAbsolute path to the .ipynb file
cell_idstringNoID of the cell to edit. For inserts, the new cell is placed after this cell (or at the beginning if omitted)
new_sourcestringYesNew source content for the cell
cell_typestringNo"code" or "markdown". Defaults to the current cell type. Required when edit_mode is "insert"
edit_modestringNo"replace" (default), "insert", or "delete"
Behavior:
  • Works only with .ipynb files; use Edit for plain Python or Markdown files.
  • Cell outputs are not modified — only the source is changed.
  • The notebook is re-serialized as JSON after the edit.
  • Tracks file history for undo support.
Permission behavior: Requires write permission for the notebook’s directory.

Shell Tools

Tool name: BashExecutes shell commands. This is the most powerful and versatile tool; it can run any shell command the user has granted permission for.Input parameters:
ParameterTypeRequiredDescription
commandstringYesThe shell command to execute
timeoutnumberNoTimeout in milliseconds
descriptionstringNoShort human-readable description of what the command does (5–10 words for simple commands)
run_in_backgroundbooleanNoRun the command as a background task. Claude will receive a notification when it completes
Behavior:
  • Commands run in a persistent shell session with the current working directory.
  • Long-running commands (over 2 seconds) show a progress indicator and can be backgrounded with Ctrl+B.
  • In assistant mode, commands that run longer than 15 seconds are automatically moved to the background.
  • Output larger than 30,000 characters is persisted to a file in the tool-results directory and summarized inline; Claude can read the full output via Read.
  • Image output (e.g., from plotting libraries) is returned as a visual attachment.
  • sed in-place edits (sed -i) are intercepted and shown as file edit previews rather than run directly.
Background tasks: When run_in_background is true, Claude receives the task ID and output file path immediately, then gets notified via a task notification when the command finishes.Sandboxing: On supported platforms, commands can run inside a sandbox. The sandbox can be bypassed with dangerouslyDisableSandbox: true (requires explicit user permission).Permission behavior: Requires explicit permission for each command pattern. Use /permissions to configure allow/deny rules such as Bash(git *) or Bash(npm run *).

AI Agent Tools

Tool name: TaskLaunches a specialized sub-agent to perform a task. Agents run the full Claude Code loop with their own tool access, enabling parallel work and delegation of complex subtasks.Input parameters:
ParameterTypeRequiredDescription
descriptionstringYesShort (3–5 word) description of the task
promptstringYesThe full task description for the agent
subagent_typestringNoType of specialized agent to use (e.g., a named agent from your ~/.claude/agents/ directory)
modelstringNoModel override: "sonnet", "opus", or "haiku". Overrides the agent definition’s model
run_in_backgroundbooleanNoRun the agent in the background. Claude receives a notification when it completes
isolationstringNo"worktree" to run the agent in a temporary git worktree (isolated copy of the repo)
cwdstringNoAbsolute path for the agent’s working directory. Mutually exclusive with isolation: "worktree"
Behavior:
  • Sub-agents have their own tool set and permission context, scoped to their task.
  • The parent Claude waits for the agent to complete (or proceeds if run_in_background is true).
  • Agent output is returned as a structured result to the parent.
  • Using isolation: "worktree" creates a temporary git worktree so the agent works on an isolated copy; the worktree is cleaned up when the agent exits.
Built-in agent types: Claude Code ships several built-in agents (general-purpose, explore, plan, verification, statusline-setup) that are automatically selected when appropriate.Permission behavior: Agent tool access is subject to the same permission rules as the parent session.
Tool name: TodoWriteCreates and updates a structured task list for the current session. Claude uses this tool proactively to track progress on multi-step tasks.Input parameters:
ParameterTypeRequiredDescription
todosarrayYesThe complete updated todo list
Each todo item has:
  • content — Imperative description of the task (e.g., "Run tests")
  • activeForm — Present continuous form shown in the spinner (e.g., "Running tests")
  • status"pending", "in_progress", or "completed"
Behavior:
  • Claude should have exactly one task in_progress at any time.
  • When all tasks are completed, the list is cleared.
  • The task list is visible in the Claude Code UI and updates in real time.
  • Claude uses this tool for tasks with 3 or more distinct steps, and skips it for trivial single-step requests.
Permission behavior: No permission prompt required.

Background Task Tools

These tools manage long-running background tasks launched via Bash(..., run_in_background: true) or Task(..., run_in_background: true).
Tool name: TaskCreateCreates a new task in the session task list (TodoV2 format, when enabled).Input parameters:
ParameterTypeRequiredDescription
subjectstringYesBrief title for the task
descriptionstringYesWhat needs to be done
activeFormstringNoPresent continuous form shown in spinner (e.g., "Running tests")
metadataobjectNoArbitrary metadata to attach
Returns the created task’s id and subject.
Tool name: TaskGetRetrieves details about a specific task by its ID.Input parameters:
ParameterTypeRequiredDescription
taskIdstringYesThe ID of the task to retrieve
Returns the task’s id, subject, description, status, blocks, and blockedBy arrays.
Tool name: TaskListLists all tasks in the current session task list.
Tool name: TaskUpdateUpdates the status or content of an existing task.
Tool name: TaskStopStops a running background task.

Web Tools

Tool name: WebFetchFetches content from a URL and applies a prompt to extract relevant information from the fetched page.Input parameters:
ParameterTypeRequiredDescription
urlstringYesThe URL to fetch (must be a valid URL)
promptstringYesThe question or instruction to apply to the fetched content
Behavior:
  • Fetches the URL and converts the response to Markdown.
  • Applies the prompt to the Markdown content to extract the relevant parts.
  • Returns the processed result, HTTP response code, response size in bytes, and duration.
  • Maximum content size is 100,000 characters before truncation.
  • Some hosts are pre-approved and do not require a permission prompt.
Permission behavior: Claude asks for permission before fetching from any domain, unless that domain is pre-approved. You can allow specific domains with WebFetch(domain:example.com) permission rules.
Tool name: WebSearchSearches the web using Anthropic’s built-in search capability and returns synthesized results.Input parameters:
ParameterTypeRequiredDescription
querystringYesThe search query (minimum 2 characters)
allowed_domainsstring[]NoOnly include results from these domains
blocked_domainsstring[]NoExclude results from these domains
allowed_domains and blocked_domains cannot be specified in the same request.
Behavior:
  • Uses Anthropic’s native web search beta (web_search_20250305).
  • Performs up to 8 searches per tool call.
  • Returns a synthesized response with source URLs as Markdown links.
  • Available for first-party API users, Vertex AI users (Claude 4.0+ models), and Foundry users.
Permission behavior: Requires an explicit permission rule to run without prompting.

MCP Tools

Tool name prefix: mcp__<servername>__<toolname>MCP (Model Context Protocol) tools are provided by external MCP servers you configure. Each MCP server can expose any number of tools with custom names, schemas, and capabilities.Behavior:
  • MCP tools appear in Claude’s tool list with the prefix mcp__<servername>__<toolname>.
  • Input schemas are defined by the MCP server and vary per tool.
  • Claude cannot use an MCP tool it has not been granted permission for.
  • MCP servers connect over stdio, HTTP (SSE), or WebSocket transports.
Managing MCP servers: Use /mcp to enable, disable, and inspect connected servers.Permission behavior: Each MCP tool requires its own permission rule. Claude asks for permission the first time it tries to call a new MCP tool.

Build docs developers (and LLMs) love