Model chooser  /  Automate multi-step work with an agent  /  Recurring

For an agent that runs on a schedule, use Claude Opus 5.

A production agent has to finish reliably, at a cost you can budget, without a human watching. Opus 5 sits two points behind the leaders on intelligence at half Fable's price, and Anthropic's Managed Agents can run it on a schedule with the sandbox hosted for you.

Why Claude Opus 5

The reasons it wins for this job.

  • Anthropic built Opus 5 for complex agentic work and recommends starting there. It scores 51 on the Artificial Analysis Intelligence Index, against 53 for Fable 5.1, at half the per-token price.
  • Task budgets tell the model how many tokens a loop may spend, so it paces itself and wraps up instead of being cut off mid-task.
  • Managed Agents runs the loop and a per-session sandbox on Anthropic's side, with scheduled deployments, so a weekly job needs no server of your own.
  • You can delegate reading-heavy sub-steps to Sonnet 5 workers and keep Opus 5 for the decisions, which cuts cost without lowering the quality of the final call.

How to use it

4 steps to a first result.

  1. 1Start from a workflow, not an agentIf the steps are always the same, write them as code with a model call at each step. Use an agent only where the path genuinely varies.
  2. 2Define done and a budgetGive each run an outcome to check and a token budget. Log both.
  3. 3Keep permissions narrowTools that write or send need approval, or a separate confirmation step outside the model.
  4. 4Schedule it and review a sampleRun it on a schedule and read five transcripts a week. Regressions show up there before they show up in metrics.

Claude API, TypeScript (tool loop)

Start from this.

Edit the parts in capitals, then run it.

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();
const tools: Anthropic.Tool[] = [/* YOUR TOOLS: name, description, input_schema */];
const messages: Anthropic.MessageParam[] = [{ role: "user", content: "GOAL AND DEFINITION OF DONE" }];

while (true) {
  const res = await client.messages.create({
    model: "claude-opus-5",
    max_tokens: 16000,
    output_config: { effort: "high" },
    tools,
    messages,
  });
  messages.push({ role: "assistant", content: res.content });
  if (res.stop_reason !== "tool_use") break;

  const results: Anthropic.ToolResultBlockParam[] = [];
  for (const block of res.content) {
    if (block.type !== "tool_use") continue;
    const output = await runTool(block.name, block.input); // YOUR CODE
    results.push({ type: "tool_result", tool_use_id: block.id, content: JSON.stringify(output) });
  }
  messages.push({ role: "user", content: results }); // all results in one message
}
Nothing is sent anywhere. It copies to your clipboard.

Alternatives that also work

If Claude Opus 5 is not an option.

OpenAI · closed · cost: medium

Pick it when your stack is on OpenAI and cost matters more than the top score. Sol is OpenAI's flagship for professional work at a medium cost tier.

Z.ai · open weights · cost: free weights; you pay for the hardware · 838K HF downloads/mo

Pick it when the agent must run on your own GPUs. It posts the best open-weight Terminal-Bench 3.0 score on its model card.

Claude Sonnet 5Official page →

Anthropic · closed · cost: medium

Pick it when the steps are simple lookups and edits. It also works well as the worker under an Opus 5 lead.

Watch out for

Doing this just once? For a long, one-off task an agent should run end to end, use Claude Fable 5.1. A one-off agent task, such as auditing a site, migrating data between tools or assembling a report from ten systems, fails on the long tail of steps. Fable 5.1 is Anthropic's model for long-horizon agentic work, and for one run its higher price barely registers.

Sources

Checked . Models change monthly; we re-check this page when they do.

Picking the model is the easy part.

Wiring it into a workflow that runs every week, with evals, fallbacks and a cost you can predict, is the work. Fifteen minutes, no deck.

Book fifteen minutes →