Major

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 GironUpdated
Two professionals reviewing contract paperwork at a conference table

What is a Claude agent?

A Claude agent 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. If you want one that runs a business workflow every week without anyone prompting it, Major is the place to put it: the agent reasons through the work once, builds a governed app for the repeatable parts, and calls Claude only for the judgment.

Search the phrase and four products answer to it.

  • Claude Code and subagents: Anthropic's terminal coding agent, plus specialized subagents you configure inside it. Built for engineers working interactively.
  • Claude Agent in an IDE: the same family of coding agent embedded in JetBrains or VS Code through the vendor's AI chat.
  • Claude Agent SDK: a Python and TypeScript library that runs the Claude Code agent loop inside your own process.
  • An agent you build on the API: your own loop on the Messages API, or a hosted loop on Claude Managed Agents.

The first three are coding tools. This article covers the fourth, the one you want for renewals, support triage, or reconciliation.

What Claude is good at, and where it stops

Claude reads long, messy input and returns a structured opinion. Give it a 40-page master services agreement and 90 days of email threads, ask which renewal terms carry risk, and the analysis holds up. It handles multi-step tool use without hand-holding.

Three things it does not do. It does not remember between runs unless you pass history back in. It does not enforce permissions, so any tool you expose is a tool it can call. It does not return identical output for identical input, which hurts when the output feeds a system that expects a stable shape. A durable Claude agent is mostly code with one model call in the middle.

The API in about 200 words

Auth is one header. Send x-api-key plus the required anthropic-version: 2023-06-01 on every request to POST /v1/messages. The body needs 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.

The tool-use loop runs in five steps.

  1. Send the request with a tools array. Each tool has a name, a description, and an input_schema.
  2. Claude replies with a tool_use block and stop_reason: "tool_use". The block carries 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.

Around that sit count_tokens for pre-flight sizing, the Message Batches API for bulk work, a files endpoint for reusable uploads, and a models endpoint so you resolve current model IDs instead of hardcoding them.

Claude Managed Agents is the hosted alternative. POST /v1/agents defines the model, prompt, and tools, POST /v1/environments defines the sandbox, and POST /v1/sessions starts a run, all behind the managed-agents-2026-04-01 beta header.

Pick on control. With the Messages API you own tool execution, retries, state, and permissions, which suits workflows that touch your systems of record. The Agent SDK ships built-in file and shell tools, which suits coding-shaped work. Managed Agents hosts the loop and sandbox for long-running tasks.

The gotchas nobody documents

Your token dashboard is probably wrong. usage.input_tokens counts only tokens after your last cache breakpoint. Total input is cache_read_input_tokens plus cache_creation_input_tokens plus input_tokens. A 200k cached document with a 50-token question reports 50.

Caching is an exact prefix match and fails silently. Put a timestamp in the system prompt and every cached block after it stops matching. No error, just zero cache reads.

The loop is yours, including retries, timeouts, malformed tool arguments, and the rule that results from parallel tool_use blocks return in a single user message.

Policy limits matter too. Third-party products cannot offer claude.ai login without prior approval, so use API keys. You cannot name your product Claude Code. Managed Agents persists conversation and sandbox state server-side, so it is not currently eligible for Zero Data Retention or a HIPAA BAA, which ends the evaluation for some teams before any technical question.

Where the model should stop and the code should start

Take a renewal review and mark each step. Querying contracts renewing in 60 days is mechanics. Skipping accounts already briefed this cycle is mechanics. Mapping each account to its owner is mechanics. Reading the agreement and correspondence to form a risk opinion is judgment. Formatting the brief and writing the audit line is mechanics.

One step in 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 keep nothing but a transcript.

Move them into an app and three things change at once. The work becomes deterministic because it is code. It becomes stateful because the dedupe ledger and brief history live in a database instead of a context window. It becomes governable because a scoped credential and an audit log sit at the point of action. Cost flattens too: front-loaded when the agent builds the app, then paying only for judgment. Caching discounts repeated context, but the cheapest token is the one you never send.

Build the Contract Renewal Brief agent on Major

Major is the enterprise platform where agents build the software they run on. Here is the renewal agent as a concrete build.

  • Trigger: a workflow schedule, Mondays at 07:00 in the account owner's timezone.
  • Connectors: Notion for the Contracts database, Gmail for correspondence, Slack for delivery, and the Anthropic connector for the model call. The Anthropic connector is action-only (list models, create a message), so the trigger always comes from somewhere else.
  • The app: queries Notion for agreements renewing within 60 days, checks its own managed-database ledger to skip anything already briefed this cycle, maps accounts to owners, and pulls the contract plus the last 90 days of Gmail threads from one label.
  • The agent's judgment: one long-context Claude request holding the agreement and the correspondence, with one instruction: write a renewal risk brief citing the clauses and emails behind each point. No tool loop, no state to carry.
  • Output: a page in a Renewal Briefs database in Notion, and a Slack direct message to the owner with the top three risks and a link.
  • Governance: Notion read on Contracts and write on Renewal Briefs only, Gmail read-only on one label, Slack limited to direct messages. Credentials sit behind the credential proxy, access follows RBAC, and every write lands in the audit log.

Run it against fifty contracts and the mechanics cost the same each time. Only the reading scales. Start building free and point it at your own contracts database.

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 workflow context 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 judgment call becomes a swappable input into software you own.

More use cases by tool: More Gmail use cases, More Notion use cases, More Slack use cases.

Start building on Major

Build the Contract Renewal Brief agent on Major: Claude reads the agreements, and an app you govern handles everything else, every Monday, the same way.

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 trigger, against your systems of record, without anyone typing a prompt. A renewal agent can review every contract expiring in 60 days each Monday and post a risk brief to the owner. On Major, the agent builds an app for the repeatable steps and runs it, so only the judgment calls use the model.
Does Claude have agents built in, or do I build my own?
Both exist. Anthropic ships finished coding agents such as Claude Code and the Claude Agent in JetBrains. For a business workflow like renewal review or invoice reconciliation you build your own on the Messages API, the Agent SDK, or Managed Agents. On Major, that custom piece lands as a deployed app with SSO, permissions, and a database attached.
Is building a Claude agent free?
No. A Claude subscription covers claude.ai and Claude Code for a person, not programmatic access. Agents run on the API, billed per token against an API key, so check Anthropic's pricing page before estimating a workflow. On Major, reasoning happens during the build and the recurring run is code, so volume growth does not multiply the model bill.
Claude Agent SDK vs Claude Managed Agents?
Use the Agent SDK when you want the loop inside your own process in Python or TypeScript with full control of tools. Use Managed Agents when you want Anthropic to host the loop and sandbox for long-running tasks. Managed Agents persists state server-side, so it is not currently eligible for Zero Data Retention or a HIPAA BAA.
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 formatting cost tokens on every run when the model does them, and nothing once they are code in an app. Prompt caching discounts repeated context but does not remove it. Reason once, run forever: Major keeps the model for judgment only.