CloudCodeTree LogoCloudCodeTree
HomeResumeAI NewsContactSchedule
CloudCodeTree Logo
CloudCodeTree
← Back to AI News
Run a Codebase-Wide Audit Without Burning Your Context Window: Dynamic Workflows in Claude Code

Run a Codebase-Wide Audit Without Burning Your Context Window: Dynamic Workflows in Claude Code

Chris Harper

3 min read

Jun 18, 2026 · 21:04 UTC

AI
Workflow
Claude Code
Best Practices

TL;DR: The ultracode keyword makes Claude Code write a JavaScript workflow script that coordinates up to 1,000 subagents in the background — codebase-wide tasks without burning your context window.

When a task is too large for one context window — a repo-wide security audit, a 500-file migration, a question that needs multiple sources cross-checked — Claude Code can write and execute a JavaScript workflow script that fans out to dozens of agents in parallel. Intermediate results stay in script variables, not your context, so the task doesn't consume your prompt budget.

Three ways to start:

  1. /deep-research — the workflow already bundled inside Claude Code. Drop in a question:

    /deep-research What changed in the Node.js permission model between v20 and v22?
    

    Agents fan out across several angles, cross-check sources with a survival vote, and return a cited report. Good first run — you see what the progress view looks like before writing your own.

  2. The ultracode keyword — include it in any prompt and Claude writes a workflow script for that specific task instead of working through it turn by turn:

    ultracode: audit every API endpoint under src/routes/ for missing auth checks
    

    Claude shows the planned phases and asks you to confirm before it runs.

  3. /effort ultracode — pairs xhigh reasoning effort with automatic workflow orchestration for the whole session. Claude decides on its own whether each task warrants a workflow. Best for migration-scale work where you want maximum parallelism without typing the keyword each time. Drop back with /effort high when you return to routine tasks.

Managing runs:

Type /workflows at any time to open the progress view — each phase shows agent count, token spend, and elapsed time. Key bindings: p to pause/resume, x to stop an agent or the whole run, s to save a successful run's script as a command you can rerun later. Saved to .claude/workflows/ in your project (shared with the team) or ~/.claude/workflows/ (personal, available in every project).

Limits: 16 agents run concurrently; 1,000 total per run. File edits inside a workflow are auto-approved in the workflow runtime; shell commands not in your allowlist can still prompt you mid-run. For large runs, start with a small slice — one directory instead of the whole repo — to gauge cost before committing.

Requires Claude Code v2.1.154+, any paid plan. Works on Bedrock, Vertex, and Foundry.

Sources: Orchestrate subagents at scale with dynamic workflows — Claude Code docs, Introducing dynamic workflows in Claude Code — Anthropic blog