Pro Workflows & Power Moves
- Orchestrate parallel subagents — and know when to graduate to a script-driven dynamic workflow
- Make hooks the deterministic glue: lint on save, gate the stop, block forbidden writes
- Turn your repeated prompts into custom slash-commands, skills, and an output style
- Build an MCP stack and headless pipelines (claude -p) that run unattended in CI
- Run the explore → plan → execute → review loop with discipline, and keep context lean
- Treat CLAUDE.md like code: short, pruned, and high-signal
This is the page where the primitives stop being individual features and start being a workflow. If you already know what a subagent or a hook is, the leverage is in how you stack them: a slash-command that kicks off a plan-mode pass, subagents that fan out the work, a hook that won't let the turn end until tests pass, and a headless invocation that runs the whole thing in CI. Let's wire it together.
The mental model: who holds the plan?
Every power move below is a different answer to one question — who is holding the plan and the intermediate results? Anthropic's own framing for the new dynamic-workflows feature lays it out cleanly:
| Tool | Who decides what runs next | Where results live | Scale |
|---|---|---|---|
| Subagents | Claude, turn by turn | Claude's context window | A few per turn |
| Skills | Claude, following the prompt | Claude's context window | Same as subagents |
| Agent teams | A lead agent, turn by turn | A shared task list | A handful of long peers |
| Dynamic workflows | The script | Script variables | Dozens to hundreds |
The progression is the whole game: start with one Claude, delegate to subagents to protect context, and only move the plan into code when a task needs more agents than one conversation can coordinate.
Move 1 — Parallel subagents, then graduate to a workflow
A subagent is a separate Claude with its own context window and a scoped toolset; it returns a result, not its transcript. The power-user habit is to fan out independent work:
Fan out a review across modules
Review the changes in auth/, billing/, and api/ — use the code-reviewer subagent on each, in parallel. Report only correctness bugs and missing tests.
Three reviewers run at once, each burning its own context on the diffs, and your main session sees three tidy reports instead of three raw diffs. The catch: parallelism only helps for independent subtasks. If step B needs step A's output, run them in sequence; if they write the same files, isolate them in git worktrees.
When the task outgrows a single conversation — a 500-file migration, a codebase-wide bug sweep, research cross-checked across many sources — graduate to a dynamic workflow. Claude writes a JavaScript orchestration script (fan out → reduce → synthesize), a runtime executes it in the background with up to 16 concurrent agents, and only the final answer lands in your context. Trigger one with the ultracode keyword or just ask in plain words:
Kick off a dynamic workflow
ultracode: audit every API endpoint under src/routes/ for missing auth checks, then cross-check each finding with a second agent before reporting
The killer feature isn't just more agents — it's that a script can apply a repeatable quality pattern, like having independent agents adversarially review each other's findings before any are reported. Try the bundled /deep-research <question> to see the pattern live: it votes on each claim and filters out the ones that don't survive cross-checking.
- Save a good workflow run as a command: open /workflows, select the run, press s. It becomes /your-name in every future session.
- Gauge cost on a slice first — one directory, not the whole repo. A run can spawn far more agents (and tokens) than a single conversation.
Move 2 — Hooks: the deterministic glue
CLAUDE.md instructions are advisory — Claude usually follows them. Hooks are deterministic — they run a script at a fixed point in the loop, guaranteed, every time. Reach for a hook when something must happen with zero exceptions.
The three highest-leverage hook patterns:
- After Claude edits a file, run your formatter or linter automatically so the codebase never drifts. The feedback also flows back to Claude, so it self-corrects.
- A Stop hook runs your test/build script and blocks the turn from ending until it passes. This is what lets an unattended run finish correctly instead of stopping when the work merely 'looks done'.
- Deny writes to a protected path (migrations, generated files, secrets) before they happen, regardless of what Claude intends.
You don't have to hand-write the JSON. Ask Claude to author the hook for you:
Have Claude write a hook
Write a hook that runs eslint --fix after every file edit, and a second hook that blocks any Write or Edit to the db/migrations/ folder. Add them to .claude/settings.json and show me the config.
- A Stop hook that keeps blocking will be overridden after several consecutive blocks so the session can't deadlock — your gate is a safety rail, not an infinite loop.
- Hooks run with your shell's permissions. Review any hook script before committing it, exactly as you would CI config.
Move 3 — Custom slash-commands, skills & output styles
Anything you prompt twice should become a primitive. The decision is simple: skills are knowledge, hooks are guarantees, MCP is action, slash-commands are entry points.
A slash-command (or a skill with disable-model-invocation: true) packages a repeatable workflow you trigger by hand. $ARGUMENTS makes it parameterized:
.claude/skills/fix-issue/SKILL.md
--- name: fix-issue description: Triage and fix a GitHub issue end-to-end disable-model-invocation: true --- Fix GitHub issue $ARGUMENTS: 1. gh issue view to read the issue 2. Search the codebase for the relevant files 3. Write a failing test that reproduces the bug 4. Implement the fix, then run tests and lint until green 5. Commit with a descriptive message and open a PR
Run it with /fix-issue 1234. Use disable-model-invocation: true for anything with side effects you want to trigger deliberately rather than have Claude reach for on its own.
Output styles change how Claude communicates across the whole session — terse for an expert, verbose-with-explanations for teaching, or a structured format your tooling can parse. Pair a custom slash-command (the what) with an output style (the how) and you've shaped both ends of the interaction.
The most under-used power move from the official docs: let Claude interview you before a big feature, then start a fresh session to build from the written spec.
Spec-by-interview, then build in clean context
I want to build [brief description]. Interview me in detail using the AskUserQuestion tool — technical implementation, UI/UX, edge cases, tradeoffs. Dig into the hard parts I might not have considered. When we've covered everything, write a complete, self-contained spec to SPEC.md.
Move 4 — Build an MCP stack
MCP servers are executable processes Claude calls over JSON-RPC to actually do things — query your database, read Sentry, pull a Figma design, file a Linear issue. A power-user "stack" is a small, deliberate set, not everything you can find:
Add servers to your stack
claude mcp add --transport stdio sentry -- npx -y @sentry/mcp-server claude mcp add --transport http linear https://mcp.linear.app/sse
Two principles keep an MCP stack fast:
- Prefer a CLI when one exists.
gh,aws,gcloud, andsentry-cliare the most context-efficient way to talk to a service — Claude already knows them, and they don't load a tool schema into every turn. Reserve MCP for services without a good CLI, or where you want structured, typed access. - Keep the server list lean. Every connected server's tool definitions consume context up front. Trim servers you're not actively using; bloated tool lists crowd out your actual instructions.
For the deeper why, see Context Engineering — the same attention-budget logic that governs CLAUDE.md governs your tool list.
Move 5 — Headless & Agent SDK pipelines
claude -p "prompt" runs Claude non-interactively — no session, parseable output — which is the door to CI, pre-commit hooks, and batch jobs. This is the headless / Agent SDK surface.
The classic fan-out-across-files pattern from the official best-practices guide:
Headless batch migration
# 1. Have Claude generate the work list first, then loop: for file in $(cat files.txt); do claude -p "Migrate $file from React to Vue. Return OK or FAIL." \ --allowedTools "Edit,Bash(git commit *)" done
Two flags do the heavy lifting: --output-format json (or stream-json --verbose) makes results machine-readable, and --allowedTools scopes exactly what Claude may touch when no human is watching. Pipe it anywhere:
Claude as a pipeline stage
cat error.log | claude -p "Cluster these errors by root cause, output JSON" \ --output-format json | jq '.[] | select(.severity=="high")'
- Always test the prompt on 2–3 items before unleashing the loop on 2,000. Refine, then scale.
- Unattended runs need verification baked in — a Stop hook or an in-prompt test step — or you've just automated producing plausible-but-wrong output at scale.
Move 6 — Plan-mode discipline & context engineering
The single most reliable quality lever is separating research from execution. The four-phase loop from Anthropic's best-practices guide:
- Enter plan mode. Claude reads files and answers questions but makes no changes. Point it at the exact directories: 'read /src/auth and explain how sessions work.'
- Ask for a detailed implementation plan. Edit it directly before approving — a plan you've corrected beats a plan you skimmed.
- Drop out of plan mode. Claude codes against the plan and runs the verification you specified.
- Have a fresh-context subagent review the diff against the plan, fix gaps, then commit and open a PR.
See Plan Mode for the discipline, and skip it when the diff fits in one sentence — planning has overhead. The reason this works is context economy: performance degrades as the window fills, so a 50-token instruction in a 2,000-token context lands far harder than the same instruction buried in 50,000 tokens. Practical habits:
/clearbetween unrelated tasks; a clean session with a better prompt beats a long polluted one.- After two failed corrections, stop correcting —
/clearand rewrite the prompt with what you learned. - Delegate research to subagents so file-reading happens in their context, not yours.
The "level up your setup" path
If you do nothing else, do these in order:
- Run /init for a starter, then cut every line that fails the test: 'would removing this cause Claude to make a mistake?' A bloated file makes Claude ignore the rules that matter.
- Add a PostToolUse lint/format hook and a Stop hook that gates on tests. Now the loop closes itself instead of waiting on you.
- Pick a workflow you've typed twice — fix-issue, write-tests, ship-pr — and put it in .claude/skills/ or .claude/commands/.
- Add only the servers you use weekly; prefer gh/aws CLIs over MCP where they exist. Trim the rest.
- Use plan mode for any multi-file or unfamiliar change, and end with a fresh-context review subagent.
- Run claude -p in a pre-commit hook or a small batch job with --allowedTools, so you experience Claude as a pipeline stage, not just a chat.
CLAUDE.md mastery
CLAUDE.md loads at the start of every conversation, so it is the highest-frequency context you control — and therefore the easiest to ruin by overstuffing.
| Put in CLAUDE.md | Keep out |
|---|---|
| Bash commands Claude can't guess | Anything Claude finds by reading code |
| Code-style rules that differ from defaults | Standard conventions Claude already knows |
| Test runner + how to run a single test | Full API docs (link instead) |
| Repo etiquette (branch/PR naming) | Info that changes frequently |
| Non-obvious gotchas and env quirks | "Write clean code" platitudes |
Treat it like code: review it when behaviour goes wrong, prune regularly, and use @path/to/file imports plus per-directory CLAUDE.md files so each part of a monorepo gets only what's relevant. Move sometimes-relevant knowledge into skills so it loads on demand instead of taxing every turn.
Check yourself
0/4- The progression is the skill: one Claude → parallel subagents → script-driven dynamic workflows, chosen by who needs to hold the plan.
- Hooks are the deterministic glue — lint on save, gate the stop, block forbidden writes — for what must happen every time.
- Package repeated prompts into slash-commands/skills, shape delivery with an output style, and keep an MCP stack lean (prefer CLIs).
- Headless claude -p with --allowedTools turns Claude into a CI/pipeline stage; always bake in verification for unattended runs.
- Plan-mode discipline plus aggressive context economy (/clear, subagent research, a pruned CLAUDE.md) is the highest-reliability lever you have.
Sources & further reading
- Best practices for Claude Code — Anthropic's official guide: the explore→plan→execute loop, CLAUDE.md rules, hooks, subagents, headless fan-out, and verification.
- Orchestrate subagents at scale with dynamic workflows — official docs on dynamic workflows, the
ultracodekeyword,/deep-research, and the who-holds-the-plan comparison table. - Effective context engineering for AI agents — Anthropic Engineering on context as a finite budget and just-in-time retrieval.
- hesreallyhim/awesome-claude-code — large community-curated list of skills, hooks, slash-commands, agent orchestrators, and plugins.
- qdhenry/Claude-Command-Suite — a well-known library of professional slash-commands and agents (e.g.
/dev:code-review). - GWUDCAP/cc-sessions — an opinionated extension set demonstrating hooks for workflow enforcement plus task/git management.
- VoltAgent/awesome-claude-code-subagents — a large community collection of specialized subagent definitions.