📚Academy
likeone
online

Tool Use

Give your agent hands: Bash, file tools, search, and custom permissions

Tools Are What Make Agents Useful

An AI that can only talk is a chatbot. An AI that can act is an agent. Tools are the bridge. When you give Claude tools, you give it the ability to interact with the real world — read files, run commands, search code, write output, and more.

The Agent SDK ships with a set of built-in tools that cover the most common agent operations. You do not need to define these yourself — they come ready to use with the tools configuration option.

Real-world analogy: Think of tools as apps on a phone. The phone (Claude) is smart on its own, but it becomes transformative when it can open maps, send messages, check the weather, and take photos. Each tool is one capability. The more tools you provide, the more your agent can do.

The Built-In Tools

When you set tools: "defaults", your agent gets access to these core tools:

Bash
Run terminal commands. Install packages, run scripts, execute programs, check system status. The most powerful tool — and the one that requires the most caution.
Read
Read file contents. Supports text files, images, PDFs, and Jupyter notebooks. Can read specific line ranges for large files.
Write
Create new files or overwrite existing ones. The agent uses this to generate code, write reports, or create configuration files.
Edit
Make surgical changes to existing files. Sends only the diff instead of rewriting the entire file. More efficient and safer than Write for modifications.
Grep
Search file contents for patterns. Find function definitions, error messages, configuration values — anything in your codebase.
Glob
Find files by name pattern. **/*.ts finds all TypeScript files. src/**/test.* finds test files in src. Fast file discovery.

Tools in Action

Here is an agent that uses multiple tools to accomplish a real task — analyzing a project structure:

TypeScript — multi-tool agent
import { Claude } from "@anthropic-ai/claude-agent";

const agent = new Claude({
  model: "claude-sonnet-4-6",
  tools: "defaults",
  systemPrompt: `You are a code analyst. When asked about a project:
1. Use Glob to find all source files
2. Use Read to examine key files (package.json, main entry)
3. Use Grep to find patterns the user asks about
4. Summarize your findings clearly.`,
});

// The agent will chain multiple tools automatically
const result = await agent.query(
  "Analyze this project. What framework does it use? How is it structured?"
);

console.log(result.text);
// Claude uses Glob to find files, Read to examine them,
// and produces a detailed analysis
🔒

This lesson is for Pro members

Unlock all 355+ lessons across 36 courses with Academy Pro. Founding members get 90% off — forever.

Already a member? Sign in to access your lessons.

Academy
Built with soul — likeone.ai