One question decides it. Here is the real difference inside Claude Code, the exact file for each, and when to reach for which.
People overcomplicate this. One question tells you which to build: can you write the exact steps out ahead of time, or does the next move depend on what Claude finds along the way?
If you can write the steps out and they’d run the same way every time, you want a workflow. If the steps change based on what it discovers, you want an agent.
01
Workflow = recipe
You wrote the steps down. Anyone can run it and get the same result every time. It follows the path you set.
02
Agent = chef
You hand over a goal, like "make something great with what’s in the fridge," and it decides the steps for itself based on what it finds.
Here’s the trap: people reach for the chef when a recipe would have been cheaper and more reliable. When the steps are known, you don’t need something to think. You need something to execute.
A workflow is a path you decide once and lock in. Same steps, same order, every run. In Claude Code that’s a skill you run with a slash command: a file at .claude/skills/<name>/SKILL.md that lists the steps, so typing /<name> runs the whole thing. Add disable-model-invocation: true to its frontmatter and it only runs when you type the command. Older .claude/commands/<name>.md files still work the same way.
The Tell
You can write down every step before you start, and nothing about the task changes based on what Claude finds.
Great workflow jobs
Why It Wins
Predictable, cheap and fast. You’re paying Claude to run a path you mapped once instead of reasoning at every step. For anything repetitive, that’s what you want.
An agent is a specialist you hand a goal, and it figures out its own steps. In Claude Code that’s a subagent: a file at .claude/agents/<name>.md that runs in its own context window with its own instructions and tools, then hands a summary back to your main chat. That keeps your main conversation clean.
The Tell
You can’t write step three until you see what step two turns up. The task needs judgment.
Great agent jobs
The easiest way to try one: say "use a subagent to..." on a task. To make sure a specific one runs, type @ and pick it from the list.
The Tradeoff
More powerful, less predictable and more expensive, because it’s reasoning at every turn. Subagent work still counts toward your usage limits. Worth it when the task truly needs to think.
01
Build a workflow when
02
Build an agent when
Anthropic draws the same line in Building Effective Agents: workflows run on predefined paths, and agents direct their own process. Their advice matches mine too. Start with the simplest thing that works, and only add an agent when the task needs to think for itself.
Paste this into Claude Code in your project folder. It runs the one-question test on your task, then writes the skill or the subagent file for you.