Claude Agent: What It Is and How to Build One That Lasts

Claude agent means four different things. Here is the one that matters if you are building, plus the API details and the gotchas nobody documents.

Jose Giron
Major and Anthropic integration lockup

"Claude agent" means four different things

A Claude agent, in the sense a builder means it, is an application that uses Anthropic's Claude models to plan its own steps and call tools until a task is finished. The model decides what to do next. Your code does the doing. Search the phrase, though, and four products wear one name.

  • Claude Code and subagents · What it actually is: Anthropic's terminal coding agent, plus the specialized subagents you configure inside it · Who it is for: Engineers writing and reviewing code interactively · Where to go: Claude Code CLI docs
  • Claude Agent in an IDE · What it actually is: Anthropic's coding agent embedded in a vendor's IDE, reachable from AI Chat · Who it is for: Engineers who live in JetBrains or VS Code · Where to go: JetBrains AI Assistant docs
  • Claude Agent SDK · What it actually is: A Python and TypeScript library that runs the Claude Code agent loop inside your own process · Who it is for: Teams building an agent that reads files and runs commands · Where to go: Agent SDK overview
  • An agent you build on the API · What it actually is: Your own loop on the Messages API, or a hosted loop on Claude Managed Agents · Who it is for: Teams putting a business workflow behind a model · Where to go: Messages API

The coding senses are real products doing real work, but not what you want if the job is renewals, support triage, or reconciliation. This article covers the fourth row and does not teach Claude Code.

What Claude is good at, and where it stops

Claude is strong at reading long messy input and producing a structured opinion about it. Hand it a 40-page master services agreement and 90 days of email threads, ask which renewal terms carry risk, and you get analysis a human would recognize. It handles multi-step tool use without hand-holding.

Three things it does not do. It does not remember between runs unless you pass the history back in. It does not enforce permissions, so a tool you expose is a tool it can call. It does not return the same output twice for the same input, which matters when that output feeds a system expecting a stable shape. Those gaps are why a durable Claude agent is mostly code with a model call in the middle.

Five jobs where a Claude-backed agent earns its keep

  • Contract and renewal review · Trigger: Schedule, weekly · What Claude reads: Agreement text, amendment history, recent account email · Output destination: Renewal brief record plus owner notification
  • Support triage with routing · Trigger: New ticket webhook · What Claude reads: Ticket body, customer tier, prior tickets from the same account · Output destination: Queue assignment, priority field, internal note
  • Pull request code review · Trigger: PR opened or updated · What Claude reads: Diff, changed file context, repository conventions · Output destination: Review comment on the PR
  • Meeting notes to CRM · Trigger: Transcript posted · What Claude reads: Call transcript, existing opportunity record · Output destination: Updated deal fields, next-step task
  • Invoice reconciliation · Trigger: Payment received · What Claude reads: Invoice, payment reference, contract payment terms · Output destination: Ledger entry, exception flagged to finance

Each has the same shape: a trigger that has nothing to do with Anthropic, a fetch step, one model call that forms a judgment, and a write to a system of record. Getting from prototype to production is mostly about the stages that are not the model.

What you need to build one (the API in about 200 words)

Auth is one header. Send x-api-key with your key and the required anthropic-version: 2023-06-01 on every request to POST /v1/messages. The required body is three fields: model, max_tokens, and messages, with the system prompt in a top-level system parameter rather than a message role. Everything agentic is a feature of that one endpoint.

curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarize this clause."}]
}'

The tool-use loop runs like this:

  1. Send your request with a tools array, each tool carrying a name, a description, and an input_schema.
  2. Claude replies with an assistant message containing a tool_use block and stop_reason: "tool_use". The block has an id.
  3. Execute the tool in your own code.
  4. Append a user message containing a tool_result block whose tool_use_id matches that id.
  5. Repeat until stop_reason comes back as end_turn.

Four endpoints sit around that: count_tokens for pre-flight sizing, the Message Batches API for bulk asynchronous work, files for uploads referenced across requests, and models for resolving current model IDs instead of hardcoding them.

Claude Managed Agents is the other path, hosting the loop and sandbox across three resources: POST /v1/agents defines the model, prompt, and tools, POST /v1/environments defines the sandbox, and POST /v1/sessions starts a run. All of it sits behind the managed-agents-2026-04-01 beta header.

  • Messages API with your own loop · You control: Tool execution, retries, state, permissions, language choice · Anthropic controls: The model · Best when: The workflow touches your systems of record and you need the loop auditable
  • Claude Agent SDK · You control: The process it runs in, hooks, permissions config · Anthropic controls: The agent loop, built-in file and command tools · Best when: You are building something coding-shaped in Python or TypeScript
  • Claude Managed Agents · You control: Agent and environment config, when sessions start · Anthropic controls: The loop, the sandbox, session state, tool execution · Best when: Long-running sandboxed tasks where you would rather not run infrastructure

For most enterprise workflows the first row wins. The SDK's built-in tools are file operations and shell commands, exactly right for a coding agent and beside the point for a renewal brief. Managed Agents trades control for hosting, and that trade has a compliance edge. Choosing an agent layer covers the wider field.

Honest pros and cons

The good part is genuinely good: one endpoint, a tool-use contract that is easy to reason about, prompt caching that bills cache reads at roughly a tenth of the base input price, batch processing for work that can wait, and enough context to hand the model an entire agreement without chunking it.

The parts that bite:

  1. Your token dashboard is probably wrong. usage.input_tokens counts only tokens after your last cache breakpoint. Total input is cache_read_input_tokens + cache_creation_input_tokens + input_tokens, so a dashboard reading one field under-reports badly: a 200k cached document with a 50-token question reports 50.
  2. Caching is an exact prefix match, and it fails silently. Put a timestamp in your system prompt and every cached block after it stops matching. No error, no warning, just zero cache reads. Variable content goes after the breakpoint.
  3. The loop is yours, including the ugly parts. Retries, timeouts, malformed tool arguments, and the rule that results from parallel tool_use blocks come back in a single user message.
  4. The Agent SDK is Python and TypeScript only. From any other language you run the CLI as a subprocess with -p and --output-format json.
  5. You cannot resell claude.ai login. Anthropic does not permit third-party products to offer claude.ai login or rate limits without prior approval, including agents built on the SDK. Use API keys.
  6. You cannot call your product Claude Code. The branding guidelines allow "Claude Agent" or "Powered by Claude" and prohibit "Claude Code."
  7. Managed Agents sits outside ZDR and HIPAA BAA coverage. Because sessions persist conversation history and sandbox state server-side, Managed Agents is not currently eligible for Zero Data Retention or a HIPAA Business Associate Agreement. For some readers that ends the evaluation before any technical question.

What the Anthropic connector gives you

Two operations and an API key. The Anthropic connector is action-only: list models, and create a message. There is no Anthropic trigger, and there cannot be one, because Claude has no events to emit.

So a Claude agent is never a one-connector build. The trigger comes from Notion, Gmail, a webhook, or a schedule, and the surrounding work is where the engineering lives.

Where the model should stop and the code should start

Take the renewal review and mark each step.

  • Query contracts renewing in the next 60 days · Judgment or mechanics: Mechanics
  • Skip anything already briefed this cycle · Judgment or mechanics: Mechanics
  • Map each account to its owner · Judgment or mechanics: Mechanics
  • Read the agreement and recent correspondence, form a risk opinion · Judgment or mechanics: Judgment
  • Format the brief and write the audit line · Judgment or mechanics: Mechanics

One row out of five needs a frontier model. The other four are a database query, a dedupe check, a lookup table, and a template. Run them through Claude and you pay every run, get slightly different results each time, and have no record of what happened beyond a transcript.

Move them into an app and three things change together. The work becomes deterministic, because it is code. It becomes stateful, because the dedupe ledger and brief history live in a database rather than a context window. It becomes governable, because a scoped credential and an audit log sit at the point of action instead of inside a prompt, which is structural rather than a policy you hope holds.

The cost shape changes too. An agent that re-reasons its mechanics pays more as it runs more. One that builds an app for the mechanics pays once, then pays only for the judgment. Front-loaded, then flat. Caching helps with repeated context, but the cheapest token is the one you never send.

This is Major's wedge. When an agent on Major works out how to handle a repeatable step, it builds an app for that step, with its own managed database, storage, and logs, and runs the app from then on. Reason once. Run forever.

Picking Claude does not lock you in

The deterministic layer is the durable asset, and it does not care which model wrote the brief. Major runs Claude alongside Kimi, Gemini, Muse Spark, ChatGPT, and Grok, with the workflow's context and memory held in the app rather than one vendor's context window. Swap the model and the query, the ledger, the owner mapping, and the audit trail survive the change. The judgment call is a swappable input into software you own.

Build this in Major

Here is the Contract Renewal Brief agent. It runs Mondays at 07:00 in the account owner's timezone, on four connectors: Notion, Gmail, Slack, and Anthropic. The app queries a Notion Contracts database for agreements renewing within 60 days, checks its own ledger to skip anything already briefed this cycle, then pulls the contract and the last 90 days of Gmail threads with that account's primary contact from a single label. Notion as the data layer keeps the source records where the team already edits them.

Claude gets one job: one long-context request containing the agreement and the correspondence, with one instruction, write a renewal risk brief citing the specific clauses and email exchanges behind each point. No tool loop, no browsing, no state to carry.

Output goes two places: a page in a Notion Renewal Briefs database, and a Slack direct message to the owner with the top three risks and a link, the routing discipline that makes Slack alert triage survive a busy team.

Permissions are scoped narrowly: Notion read on Contracts and write on Renewal Briefs only, Gmail read-only restricted to one label, Slack chat:write limited to direct messages.

The renewal query, owner mapping, dedupe ledger, brief template, and audit log are deterministic code with a managed database behind them. Claude is called once per contract, for the judgment. Run it against fifty contracts and the mechanics cost the same each time. Only the reading scales.

You get $100 in free credits to build your first AI agent or app on Major, enough to stand up the Contract Renewal Brief agent from this article. Point Major at your Notion contracts database, describe the brief you want on Monday morning, and it builds the app around the model call. Build your Contract Renewal Brief agent on Major.

Related articles

Frequently asked questions

What is the point of Claude agents?
A Claude agent does work a chat window cannot: it runs on a schedule or a trigger, against your systems of record, without anyone typing a prompt. A renewal agent can query every contract expiring in 60 days each Monday, read the agreement and the recent email with that account, and post a risk brief to the owner before they open their laptop.
Does Claude have agents built in, or do I build my own?
Both exist. Anthropic ships finished agents: Claude Code in the terminal, the Claude Agent in JetBrains and other IDEs. Those are coding agents. For a business workflow like renewal review or invoice reconciliation, you build your own on the Messages API, the Claude Agent SDK, or Claude Managed Agents. Nothing off the shelf knows your contracts.
Is building a Claude agent free?
No. A Claude subscription covers claude.ai and Claude Code for a person, and does not cover programmatic access. Agents run on the API, which is billed per token against an API key. Check current rates on Anthropic's [pricing page](https://platform.claude.com/docs/en/pricing) before you estimate a workflow, since model tiers and rates change.
Claude Agent SDK vs Claude Managed Agents?
The Agent SDK runs the agent loop inside your own process, in Python or TypeScript, so you keep control of tools and execution. Managed Agents runs the loop and sandbox on Anthropic's infrastructure, which suits long-running tasks. One caveat: because Managed Agents sessions persist state server-side, they fall outside Zero Data Retention and HIPAA BAA coverage.
How do I stop a Claude agent getting more expensive as it gets used more?
Move the repeatable steps out of the model. Database queries, dedupe checks, owner lookups, and output formatting cost tokens every run when the model does them, and nothing once they are code in an app. Prompt caching is the partial measure, since it discounts repeated context. Writing the app removes those tokens entirely.