How to Use the Claude AI Agent: From Setup to Other Platforms
A practical walkthrough of generating a Claude agent, running it locally, and wiring it into platforms beyond the terminal.
Nathan Levine
4 min read

"AI agent" gets thrown around a lot, but with Claude it has a fairly concrete meaning: a loop where the model can read files, run commands, call tools, and react to the results — not just answer a single prompt. Here's how I actually set one up and where I've plugged it in beyond my own terminal.
What "generating" a Claude agent means
There are two levels people usually mean when they say this:
- Using Claude Code — Anthropic's own agentic CLI/IDE tool. You don't build anything; you install it and point it at a repo.
- Building a custom agent with the Claude Agent SDK — you write your own loop (or use theirs) with your own tool definitions, for a product or internal workflow.
Both start the same way: you need an Anthropic API key (or a Claude Code subscription) and a clear idea of what tools the agent should be allowed to touch.
Setting up Claude Code
This is the fastest path if you just want an agent working in your codebase today.
npm install -g @anthropic-ai/claude-code
claude
From there:
- Run it inside a git repo — it uses repo context (README, package.json, directory structure) to orient itself.
- Give it a task in plain language: "add input validation to the signup form and write a test for it."
- It reads relevant files, proposes edits, runs your test suite, and iterates on failures — without you manually copy-pasting code back and forth.
The key difference from chat-based Claude is that it has tools: file read/write, shell execution, search. That's what makes it an agent rather than an assistant you paste code into.
Building your own agent with the Agent SDK
If you want an agent inside your own product — not just your terminal — you use the Claude Agent SDK (or the raw Messages API with a manual tool-use loop):
from anthropic import Anthropic
client = Anthropic()
response = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
tools=[
{
"name": "search_orders",
"description": "Look up a customer order by ID",
"input_schema": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
}
],
messages=[{"role": "user", "content": "Where's my order #4521?"}],
)
The model doesn't execute search_orders itself — it returns a tool-use request, your code runs the actual lookup, and you feed the result back in the next message. That request/execute/respond cycle, repeated until the model has enough to answer, is the entire mechanism behind "agentic" behavior. Everything else — memory, planning, multi-step reasoning — emerges from that loop plus good tool design.
Using it on other platforms
Once you've got the core loop working, the same agent pattern ports to wherever your users already are:
- Slack — Claude Tag (Claude in Slack) wraps this loop into a Slack app. You
@mentionit in a channel or DM, and it can read thread context, call tools, and reply inline. Good fit for internal tooling questions, triage, or summarizing long threads. - Web apps — expose the same tool-calling loop behind an API route, and drive it from a chat widget. The model doesn't know or care that it's not a terminal; it just sees messages and tool results.
- Automation platforms (Zapier, n8n, etc.) — instead of custom tool code, the agent's "tools" become existing platform actions (send email, update a row, create a ticket). You're mapping the same request/execute/respond loop onto a no-code action library.
- CI/CD — a scheduled or triggered agent run (for example, on a PR) that reads a diff, runs checks, and posts findings back as a comment. This is the same loop as Claude Code, just invoked headlessly instead of interactively.
The pattern doesn't change across platforms — what changes is which tools you expose and how much autonomy you give the agent before it needs a human to confirm.
What actually matters when you deploy one
A few things I've learned the hard way:
- Scope the tools tightly. An agent with
delete_fileand no guardrails will eventually use it in a way you didn't intend. Give it the narrowest set of tools that gets the job done. - Log everything. When something goes wrong three steps into an agentic loop, you need the full tool-call trace, not just the final answer.
- Decide where a human has to confirm. Reversible actions (searching, reading, drafting) can run autonomously. Irreversible ones (sending an email, pushing code, charging a card) should pause for approval until you trust the agent's judgment on that specific task.
That last point is the one people skip, and it's the one that actually determines whether an agent is safe to hand real responsibility to.


