You can build a useful AI agent with Claude without writing the whole agent loop yourself. Anthropic's Claude Agent SDK provides the tools and execution loop. Your job is to give it a clear task, limit its access, and check the result.
In this guide, we will build a small TypeScript agent that reads business notes and produces a summary with next steps. It will only have reading and searching tools. It will not edit your files, browse the web, or send messages.
1. Prepare your computer and Claude access
Install a currently supported Node.js LTS release and open a terminal. Anthropic's quickstart lists Node.js 18+ as the SDK minimum, but use a supported LTS release for a new project.
You also need an Anthropic Console account, an API key, and available API credit. This guide uses API authentication. Do not assume a Claude chat subscription includes the API usage required here.
Create a dedicated folder containing sample documents only. The working directory is useful organization, but it is not an operating-system security boundary. Use a separate container or restricted environment before handling sensitive business data.
2. Create the project
Run these commands:
mkdir claude-business-agent
cd claude-business-agent
npm init -y
npm pkg set type=module
npm install @anthropic-ai/claude-agent-sdk
npm install --save-dev tsx typescript @types/node
mkdir workspace
Keep the generated lockfile so future installs use the same dependency versions. The SDK normally bundles the Claude Code executable through optional npm dependencies. Avoid installing with optional dependencies omitted. See Anthropic's setup documentation if your platform needs a separate executable.
3. Add your API key
On macOS or Linux, enter the key without displaying it in your terminal:
read -rsp "Anthropic API key: " ANTHROPIC_API_KEY
export ANTHROPIC_API_KEY
printf '\n'
On Windows PowerShell:
About the Author
Discussion
0 comments
Loading comments...
