When ultracode is on, the session is pinned to Opus @ xhigh and a single dynamic
workflow fans out to dozens of subagents that inherit that session model unless every
stage is pinned. ultracost makes per-stage routing explicit, policy-driven, and
verifiable — quality-first, so coding and reasoning stay on Opus while pre-planned
mechanical work drops to Sonnet. No telemetry. No network on the hot path. MIT.
Built for ultracode (Opus @ xhigh dynamic workflows) — the only place this fan-out
happens. ultracost routes by tier (opus/sonnet), not a pinned version, so it
tracks whatever Opus your session runs.
Security & trust. ultracost has zero runtime and dev dependencies, so there is no
supply chain to compromise — Snyk Open Source and npm audit report 0 vulnerabilities.
Releases publish to npm with OIDC Trusted Publishing and signed provenance, every
GitHub Action is pinned to a commit SHA, and CodeQL + OpenSSF Scorecard run in CI.
The installer touches only its own files and is fully reversible. See SECURITY.md.
Install
Claude Code plugin (recommended):
/plugin marketplace add danielkremen818/ultracost
/plugin install ultracost@ultracost
npm CLI (CI / scripting):
npx ultracost init
Via ClaudePluginHub (one command — adds the marketplace and installs the plugin):
npx claudepluginhub danielkremen818/ultracost --plugin ultracost
First command, in Claude Code: /ultracost:check ./path/to/workflow.js — flag any
agent() stage that would silently inherit Opus. Every verb is also a slash command, so
plugin users need nothing on PATH.
The problem
When ultracode is on, Claude Code runs the session on Opus @ xhigh (the only model that supports xhigh) and auto-orchestrates dynamic workflows that fan out to dozens — up to 1,000 — subagents. Two defaults compound:
- Subagents inherit the session model. No per-stage override → every stage runs on the session's Opus.
- The built-in workflow guidance tells Claude to omit the per-agent model. So inheritance wins.
The documented result: one prompt spawning 46 Opus subagents and ~3M tokens with no warning. A grep sweep and a per-file verifier do not need Opus. (Why ultracode makes this worse →)
The evidence: nobody pins a stage
This is the default behavior, not user error. In a scan of ~22 real ultracode workflow scripts, almost none pinned model: on any stage — even Anthropic's own bundled deep-research workflow pins zero. Reproduce it on your own history in one command:
npx ultracost audit ~/.claude/projects
What ultracost does