Claude Opus 5.5

agents-0-23-0-7-b

Claude Code's read-only tools, web search on, ludion sync off

Question

What replaces subAgent() for managing dynamic agents?

Answer key

A correct answer says
`subAgent()` and its siblings are deprecated in favor of `this.dynamicAgents.{get,abort,delete,has,list}`, and facets are positioned as an isolation primitive rather than the way to model many chat sessions.
The stale answer
Use `this.subAgent()` (the recommended API) to create sub-agents, e.g. one per chat session.

The change's lesson

Answer

There's no `subAgent()` in the current Workflow script API. The function you want is **`agent(prompt, opts)`**. Each call starts a subagent and returns its final text, or a validated object if you pass a `schema`. You make agents dynamic with ordinary JavaScript: call `agent()` inside loops and conditionals, or over lists you build at runtime with `pipeline()` (no barrier, the default) and `parallel()` (waits for all results). Per-call options like `label`, `phase`, `model`, `effort`, `agentType` and `isolation: 'worktree'` handle the rest. The reference I checked doesn't mention `subAgent()` at all, so I can't confirm it was ever the old name. `agent()` is the function to use now.

Answering cost $0.11.

Grade

wrong

The judge's reason: It claims `agent(prompt, opts)` replaces subAgent(), which is false per the key; the replacement is `this.dynamicAgents.{get,abort,delete,has,list}`.

The judge's log

Session log

What the agent wrote, the tools it called, and what they returned, from docs/bench/2026-10-11-done3/runs/B-project/agents-0-23-0-7-b.jsonl. Thinking and the session's settings are left out. The raw log

  1. Tool call: Skill

    {
      "skill": "workflow-authoring",
      "args": "Question only: what replaces subAgent() for managing dynamic agents?"
    }
  2. Tool output

    Launching skill: workflow-authoring
  3. Agent

    There's no `subAgent()` in the current Workflow script API. The function you want is **`agent(prompt, opts)`**. Each call starts a subagent and returns its final text, or a validated object if you pass a `schema`. You make agents dynamic with ordinary JavaScript: call `agent()` inside loops and conditionals, or over lists you build at runtime with `pipeline()` (no barrier, the default) and `parallel()` (waits for all results). Per-call options like `label`, `phase`, `model`, `effort`, `agentType` and `isolation: 'worktree'` handle the rest. The reference I checked doesn't mention `subAgent()` at all, so I can't confirm it was ever the old name. `agent()` is the function to use now.