WORKFLOWS
Agent Or Workflow? 🚀
One question decides it. Here is the real difference inside Claude Code, the exact file for each, and when to reach for which.
The One Question
People overcomplicate this. There's really just one question that 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. That's the whole decision. Everything below just makes it obvious.
Workflow = Recipe
You wrote the steps down. Anyone can run it and get the same result every time. No guessing, no improvising, it just follows the path.
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 actually finds.
Here's the trap almost everyone falls into: they reach for the chef when a recipe would have been cheaper, faster, and more reliable. When you already know the steps, you don't need something to think. You need something to execute.
The Workflow
A workflow is a path you decide once and lock in. Same steps, same order, every run. You're not asking Claude to think, you're asking it to follow the steps you already mapped. In Claude Code that's a slash command: a file at .claude/commands/<name>.md that lists the steps, so typing /<name> runs the whole thing.
Great Workflow Jobs
- Turn one video script into a caption, an email, and three tweets — same pipeline every time
- Build your weekly numbers report in your exact format from the same sources
- Turn messy meeting notes into a clean summary plus a list of action items
- Take a finished blog post and format, tag, and publish it the same way
- Run every new client through your standard onboarding sequence
Notice the pattern: in every one of these, you already know the steps. There's nothing to figure out, just a sequence to run. That's a workflow.
The Agent
An agent is a specialist you hand a goal, and it figures out its own steps to get there. You don't script the path. You give it the outcome and let it decide what to do next based on what it actually finds. In Claude Code that's a subagent: a file at .claude/agents/<name>.md that runs in its own clean context, so it isn't dragging your whole chat history around.
Great Agent Jobs
- "Research what my top competitor changed this month" — it has no idea what it'll find until it looks
- "Look at my landing page and tell me what's hurting sales" — the problems it finds decide the next move
- "Go through my inbox and surface what actually needs me" — every inbox is different
- "Figure out why my ad costs jumped last month" — it's an investigation, not a checklist
- "Review this draft and flag anything weak or confusing" — real judgment, no fixed steps
In every one of these, you can't hand it a script, because you don't know what it'll run into. You hand it a goal and trust it to think. That's an agent. The simplest way to use one is to just say "use a subagent to..." on a task and let Claude Code take it from there.
The Rule
Build a Workflow When
- You can write the steps out up front
- The output should look the same every run
- The task is repetitive
- You want it cheap, fast, and predictable
- You already own the flow
Build an Agent When
- The next step depends on what it finds
- There's real judgment involved
- You can't map the path up front
- You're handing off a goal, not a script
- The task needs to think, not just run
The clean line: a workflow is a path you control, an agent is the model directing its own process. When in doubt, start with a workflow. Only reach for an agent when the task genuinely needs to think for itself, and you'll stop paying for autonomy you never needed.
The real unlock of AI agents is not full autonomy, but human-in-the-loop systems design. Structure your agent inputs with explicit constraints, negative prompts, and automated test checkpoints. When building tools, keep token consumption lean by caching system prompts and isolating tasks into specialized sub-agents.