↓ Skip to main content

Claude Code AI Agents Ultracode

What Is Ultracode in Claude Code? Workflows, Cost and When to Use It

Ultracode makes Claude Code plan a multi-agent workflow for each task. I ran one small job three ways: $1.37 by default, $25.54 with ultracode on.

What Is Ultracode in Claude Code? Workflows, Cost and When to Use It

Ultracode is a setting in Claude Code that makes Claude plan a dynamic workflow for each substantial task. A workflow is a JavaScript script that Claude writes on the spot. It starts many subagents in the background, passes results from one stage to the next, and hands the main session a summary at the end. Ultracode is not a different model and not a higher effort level. You turn it on for the session with /effort ultracode, or for one task by putting the word ultracode in your prompt. It costs far more than a normal request: the same small job cost me $1.37 without it and $25.54 with it.

I tested this on Claude Code 2.1.330 with Fable 5.2. An unrelated interview-assistant product has the same name; this post is about the Claude Code setting.

What is ultracode in Claude Code?
#

The workflows page in the docs puts it in one sentence: “Ultracode is a Claude Code setting that turns on automatic workflow orchestration for the session, at whichever effort level the session runs at.” With it on, Claude plans a workflow for each substantive task, and one request can turn into several workflows in a row.

The workflow is what’s new. With subagents, the main conversation decides turn by turn what to hand out and reads every result into its own context. With a workflow, that loop is written down as code: the script says which agents run, in what order and with what prompts, and their intermediate results stay in the script’s variables. The runtime executes it in the background while your session stays free.

Three things with similar names are different features:

  • Effort levels (low to max) set how much the model thinks. Since v2.1.284, /effort ultracode leaves the effort level where it was. Only the launch flag changes it, as the next section shows.
  • ultrathink is a keyword that raises thinking for one turn. It starts no agents.
  • /code-review ultra is a multi-agent code review that runs in the cloud and is billed separately.

How to turn ultracode on and off
#

ScopeHowNotes
One taskPut ultracode in the promptThe session setting does not change
This session/effort ultracode, and /effort ultracode off to stopEffort level unchanged
From launchclaude --effort ultracodeAlso sets effort to xhigh
Always"ultracode": true in settings.jsonOn for every session until you remove it

Workflows are on all paid plans, the API, and the cloud providers. On Pro you first turn on the Dynamic workflows row in /config.

Two limits apply. A run may use up to 16 agents at once and 1,000 in total. Then there is a size guideline, which is advice to Claude and not a cap: small is fewer than 5 agents, medium fewer than 10, large fewer than 50, and unrestricted leaves it to Claude. The default is medium, or small on Pro.

/config workflowSizeGuideline=small

While a workflow runs, /workflows opens its progress view. There p pauses or resumes the run, x stops the selected agent or the whole run, r restarts an agent, and s saves the script as a command you can run again. Saved ones go to .claude/workflows/ in the project or ~/.claude/workflows/ for all projects.

What does a workflow script look like?
#

In my test Claude wrote a script of about 15,700 characters, most of it prompts. Its skeleton looked like this (shortened, with the prompts cut out):

export const meta = {
  name: 'tests-and-fixes',
  description: 'Write tests for each module, fix what they find, then review',
  phases: [{ title: 'Test & fix' }, { title: 'Review' }],
}

const MODULES = ['isbn', 'dates', 'fines', 'loans', 'catalog', 'report']
const LENSES = ['spec-coverage', 'edge-case-bugs', 'mutation-check']

phase('Test & fix')
const results = await pipeline(MODULES, name =>
  agent(testAndFixPrompt(name), { label: `test+fix:${name}`, schema: RESULT_SCHEMA }),
)

phase('Review')
const reviews = await parallel(LENSES.map(lens => () =>
  agent(reviewPrompt(lens, results), { label: `review:${lens}`, schema: FINDINGS_SCHEMA }),
))

return { results, reviews }

So there were nine agents in two phases: one per module to write tests and fix that module, then three read-only reviewers looking at the whole thing from different angles. Each agent returns structured output that matches a schema, which is how the script can pass the first phase’s results into the reviewers’ prompts.

The test: one small job, three ways
#

I made a throwaway Python library of six small modules, about 100 lines in all, with one planted bug in each and a README that states the intended behaviour. It had no tests. The prompt was the same each time: write pytest tests for every module, run them, fix whatever bugs they reveal, and report.

I ran it three times with claude -p, each on a fresh copy and with the same permission rules: once with my usual settings (Fable 5.2 at medium effort), once with --effort xhigh, and once with --effort ultracode. A checker the agents never saw had one assertion per planted bug.

Default (medium)--effort xhigh--effort ultracode
Time2 min 48 s5 min 3 s27 min, in two goes
Cost at list prices$1.37$2.24$25.54
Agents119, plus the main session
Output tokens17,82831,103404,026
Planted bugs fixed6 of 66 of 66 of 6
Tests written310145485

I’m on a Max plan, so none of this was billed. The dollar figures are what Claude Code reports at API list prices; on a subscription the same work comes out of your usage limits.

All three runs fixed all six bugs. The default run also caught a crash the README never mentioned. Ultracode cost about 19 times as much and took about 10 times as long to reach the same fixes.

What the extra money bought was checking. The main session spent 2 minutes 16 seconds planning before it started anything. The six module agents then ran in parallel and finished in two to five and a half minutes each, at 37,000 to 54,000 tokens apiece. The three reviewers were the expensive part: ten to twelve minutes and 99,000 to 130,000 tokens each. The run ended with a mutation check, in which the fixed code was broken in 24 different ways, one line at a time, to confirm the tests noticed. They did, except for one change that makes no difference to any result. The final report also listed three behaviours the README leaves open, where the code was left as it was.

That’s worth having on code that matters. On a job this size it’s a lot to pay for confidence in six one-line fixes. This was also one run of each on a tiny repository, so read the ratios as rough.

Ultracode in headless mode stops after 10 minutes
#

The docs say the typed keyword does not start a workflow when the prompt arrives through claude -p. The launch flag does. claude -p --effort ultracode started a workflow for me, as long as the Workflow tool had a permission rule allowing it.

Then it went wrong in an instructive way. The main session launched the workflow and ended its turn with “The workflow is running”. In headless mode, Claude Code waits for background work for 10 idle minutes, then stops it and drops the partial result. My workflow needed longer. The three reviewers were killed mid-run, $13.52 had been spent, and the “result” the command printed was that one sentence about the workflow running.

The headless page documents the fix: set CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS, or set it to 0 to wait without a cap.

CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 claude -p "add tests for every module and fix what they find" \
  --effort ultracode \
  --permission-mode acceptEdits \
  --allowedTools "Workflow" "Read" "Edit" "Write" "Bash(python3 -m pytest:*)" \
  --max-budget-usd 20 \
  --output-format json

Resuming worked as documented. I resumed the session with --resume and asked Claude to relaunch the same script. The six module agents came back from cache in no time, and only the three reviewers ran again. That second go still cost $12.02, because the reviewers were where the money went.

Two more things from the logs:

  • The agents obey the same permission rules as the main session. Mine wanted scratch copies of the repository in the system temp folder, and 32 commands were refused across the two goes, against one in each single-session run. They worked around it, but a narrow allow list costs a workflow time.
  • Read modelUsage, not usage, in the JSON output. After the first go, usage showed 13,362 output tokens, which was the main session alone. modelUsage showed 211,120, which included the agents. total_cost_usd includes them too.

When is ultracode worth it?
#

The docs say to reach for a workflow “when a task needs more agents than one conversation can coordinate, or when you want the orchestration codified as a script you can read and rerun”. They also warn that with ultracode on, each request uses more tokens and takes longer, and they suggest running a workflow on a small slice first: one directory, not the whole repository.

My test shows why. Every agent starts cold and reads the code for itself, so there is a floor under the cost however small the job is, and the review stage costs more than the work it reviews. That overhead pays off when the job is wide: a migration across hundreds of files, an audit of a whole codebase, tests for a large package that has none. It also pays when being wrong is expensive and you want independent checks. It doesn’t pay for a bug fix, a small feature, or anything one session finishes in a few minutes.

So I’d leave the session setting off and use the keyword. Put ultracode in the one prompt that deserves it, set the size guideline to small until you know what a run costs you, and give headless runs a budget cap and no time ceiling.

The short version
#

Ultracode makes Claude Code write and run a multi-agent workflow script for each substantial task. Turn it on per task with the ultracode keyword, per session with /effort ultracode, or at launch with claude --effort ultracode, which also raises effort to xhigh. On a six-module test it fixed the same six bugs as a default run, at about 19 times the cost and 10 times the time, and added a mutation check and a list of open questions. In headless mode, set CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 or the run is stopped after 10 idle minutes.

Further reading
#

On this site:

Elsewhere: