Major

Claude AI Agents: What to Build So You Stop Re-Prompting

Everyone shows you how to make Claude do a task. The harder question is what Claude should build so the task stops needing a model. A practical look at the Anthropic API, its real gotchas, and a contract-triage agent worth shipping.

Jose GironUpdated
Reviewer reading contract pages at a desk, the kind of document a Claude triage agent reads

How do you build a Claude AI agent?

A Claude AI agent is an Anthropic model running in a loop with tools. You define the tools, Claude picks one and returns the arguments, your code runs it and sends back the result, and the loop repeats until Claude stops asking. You can write that loop yourself on the Messages API, or hand it to Claude Managed Agents. The part that decides whether the agent survives production is what you move out of the loop and into software.

Major is where that move happens. The agent reasons once about a repeatable task, builds an app for it, and runs the app from then on. Claude keeps the judgment calls. The app holds the data, the rules and the audit trail.

Four things people call a Claude agent

  • Claude chat: a conversation that forgets when the session ends.
  • Claude Code: a CLI for a developer working interactively against a local codebase.
  • Messages API with tool use: the real building block. You own the loop, the tool handlers, retries and the state store.
  • Claude Managed Agents: Anthropic's hosted loop with a sandbox, built-in tools and server-side sessions. It is in beta behind the managed-agents-2026-04-01 header.

For work that touches business systems, a fifth option exists: a platform where the agent builds the apps it runs. That is Major.

The Anthropic API in brief

The base URL is https://api.anthropic.com. Authenticate with x-api-key. Every raw call needs anthropic-version and content-type: application/json, and omitting the version header fails the request even with a valid key.

The endpoints you will use are POST /v1/messages, POST /v1/messages/batches for bulk work, POST /v1/messages/count_tokens to price a request before sending it, and GET /v1/models. A tool is an object with a name, a description and an input_schema. Claude answers with stop_reason: "tool_use", your code runs the operation, and you return a tool_result block carrying the matching tool_use_id. Official SDKs exist for Python, TypeScript, Go, Java, C#, PHP and Ruby and set the headers for you.

Where the Anthropic API bites

Tool use is well specified. Setting strict: true on a tool makes Claude's calls match your schema, and prompt caching is good economics for agents that re-read the same documents. These are the specific problems.

input_tokens is not your total input. It counts only tokens after your last cache breakpoint. Total input is cache_read_input_tokens + cache_creation_input_tokens + input_tokens. Anthropic's own example: a 200k-token cached document plus a 50-token question reports input_tokens: 50. A cost dashboard built on the naive field under-reports the workload you most need to watch.

Tools inject a system prompt you pay for on every request, between 286 and 804 tokens depending on model and tool_choice. Multiply by loop iterations, then by runs per day.

Rate limits are tiered and per model. Start has a $500 monthly spend cap, Build $1,000, Scale $200,000. Managed Agents runs a separate pool of 300 RPM on create endpoints and 1,200 RPM on read, list and stream. We checked these against Anthropic's rate limits page on 26 August 2026. They change, so confirm before planning capacity.

Managed Agents sessions store conversation history, sandbox state and outputs server-side. That puts them outside Zero Data Retention and a HIPAA BAA. If your compliance posture needs either, run the Messages API with your own state store.

Caching bills cached reads at 10% of base input price. It makes re-reading cheaper. It does not stop the model from re-reasoning the same steps tomorrow.

When an agent over Claude earns its place

The work spans several systems, needs judgment at one or two points, and has to keep running when nobody is watching. Contract review is the clearest case. A regex pipeline cannot tell you that clause 14.3 quietly caps liability at one month of fees. Support triage, research extraction into a database, and multi-step operational work like reconcile, check, draft, route and escalate fit the same shape. A chat window is the wrong container for all of them because it ends.

Build the contract-triage agent on Major

Look at what a contract-triage flow contains. The extraction schema is fixed. The validation is a table lookup. The record writes, the Slack routing and the renewal sweep run the same way every time. Only two steps need Claude: reading the document, and deciding whether a clause is genuinely non-standard or just worded oddly. On Major, those two stay with the model and the rest becomes a deterministic app.

  1. Connectors: Gmail or Google Drive for the intake mailbox or folder, and Slack for escalations. Both are scoped read-only on intake and post-only on Slack.
  2. The app: a contracts app with a managed database holding contract records and a standard-positions table (liability caps, notice windows, renewal terms). It is also the queue the contract owner works through.
  3. The trigger: a workflow fires when a new document lands in the intake source.
  4. Claude's first judgment: read the full agreement and call an extract_terms tool that returns counterparty, term, renewal date, notice window and liability cap.
  5. Code, not a prompt: the app validates the extraction against the standard-positions table. Clean records are written and filed silently.
  6. Claude's second judgment: for deviations only, decide whether the variance is material, then post the quoted clause and a record link to Slack for the owner.
  7. Daily sweep: a scheduled run reads the table and surfaces notice windows coming due. A conversation cannot do this, because it ended in March.
  8. Governance: the agent cannot sign, send externally, or edit the standard-positions table, because changing the definition of "standard" is a person's decision. Credentials are scoped, access is role-based, and every action is logged and attributed.

Cost follows the same split. The reasoning is front-loaded into the build, then repeat runs spend model tokens only on the two judgment steps. Reason once, run forever. You can build toward this structure by hand on the Messages API, and some teams should. If you want the agent to build and govern the app for you, with SSO and permissions already attached, build it on Major.

Start with triage rather than anything that signs or sends. It has a clean escalation path, and its failure mode is a Slack message rather than an executed contract.

Start building on Major

Describe the contract-triage agent in a sentence and Major builds the app that holds your standard positions, wires Gmail or Drive to Slack, and keeps Claude on the two clauses that need judgment.

Related articles

Frequently asked questions

How do you use Claude as an AI agent?
Call POST /v1/messages with a tools array where each tool carries an input_schema, then run whatever operation Claude asks for and hand the result back. Claude replies with stop_reason "tool_use" and the arguments it wants; your code executes the operation and returns a tool_result block with the matching tool_use_id, looping until Claude stops requesting tools. Anthropic Managed Agents runs that loop for you in a hosted sandbox. On Major, the loop keeps the judgment and the repeatable steps become a deterministic app the agent builds once.
Does Claude have built-in agents?
Yes, two. Claude Managed Agents is a hosted runtime with sandboxes, built-in tools, and server-side session state, currently in beta behind the managed-agents-2026-04-01 header. Claude Code is a CLI for a developer working interactively on a codebase. Managed Agents is the one you build unattended systems on. Major is where the agent's work becomes software your company runs with SSO and permissions attached.
Is a Claude AI agent free?
No. Agents built on the Anthropic API bill per token, including the 286 to 804 token system prompt that tool definitions inject on every request. Usage tiers carry monthly spend caps of 500 USD on Start, 1,000 USD on Build, and 200,000 USD on Scale, so the bill tracks how often the model runs. A Claude subscription covers the chat product and Claude Code, not API-based agents. Major front-loads the reasoning into a build step, after which repeatable work runs as code.
What is the difference between the Messages API and Managed Agents?
The Messages API gives you direct model access and you write the agent loop, tool execution, and state store yourself, while Managed Agents supplies the loop, a sandbox, built-in tools, and persistent sessions. Managed Agents is faster to start and is in beta. Because sessions persist state server-side, it is not eligible for Zero Data Retention or a HIPAA BAA. On Major, agent state lives in a managed database inside the app the agent builds, under your own RBAC and audit.
How much does it cost to run a Claude agent?
Three drivers set the bill: tokens consumed on every iteration of the loop, since each turn resends the full conversation; the tool-use system prompt at 286 to 804 tokens per request depending on model and tool_choice; and output tokens. Prompt caching cuts repeated context to 10 percent of base input price. Moving repeatable steps into code removes their token cost, which is what Major does when the agent builds an app and then runs it.