Commands vs. Sub-Agents in Claude Code: A Guide to Supercharging Your Workflow
Z
Zack Saadioui
8/11/2025
Commands vs. Sub-Agents in Claude Code: A Guide to Supercharging Your Workflow
Hey everyone, if you've been diving into Anthropic's Claude Code, you've probably noticed two powerful features that can seriously level up your development process: commands & sub-agents. At first glance, they might seem a bit similar, but honestly, understanding when to use each one is a game-changer for productivity.
I've been spending a LOT of time in the terminal with Claude Code, & I've come to really appreciate the distinct roles commands & sub-agents play. It's not about one being better than the other; it's about picking the right tool for the job. So, I wanted to break down my experiences & what I've learned.
Here’s the thing, a lot of people are wondering if sub-agents have made commands obsolete. I don't think so. It's more nuanced than that. Let's get into it.
What's the Big Difference, Anyway?
The easiest way to think about it is this: a command is for when you want to be in the driver's seat, & a sub-agent is for when you want to delegate. A Reddit comment I saw put it perfectly: "Command is when you want human in the loop, agent is when you don't."
Commands are basically shortcuts for tasks you do over & over. They're great for quick, single-shot actions where you're guiding Claude. Think of them as custom macros for your coding.
Sub-agents, on the other hand, are like specialized members of your development team. You give them a specific role, a set of tools, & their own little workspace (a separate context window), & then you let them get to work. They can handle more complex, multi-step processes on their own.
Let's break that down a bit more.
When to Reach for a Command: Your Go-To for Quick Tasks
Commands are your best friend for the simple, repetitive stuff. They're all about making your personal workflow faster & more consistent. You can create custom slash commands for things you type all the time, which is incredibly handy.
Think about tasks like:
Summarizing a file or a project: You could create a
1
/summarize
command that prompts Claude to give you the high-level overview of a new codebase.
Refactoring a specific piece of code: A
1
/refactor
command could instruct Claude to take a selected function & clean it up according to your project's style guide.
Running tests: A simple
1
/run-tests
command could execute your test suite & report back the results.
Fixing a GitHub issue: You can even create a command that takes an issue number as an argument & prompts Claude to start the debugging process.
The key here is that these are all well-defined, relatively small tasks. You're telling Claude exactly what to do, & you're generally expecting a quick result. You are still very much a part of the process.
Creating a command is super easy. You just create a Markdown file in your
1
.claude/commands
folder. For example, you could create a file called
1
fix-github-issue.md
with a prompt that guides Claude on how to tackle a GitHub issue. It’s a simple way to build up a library of your own personal shortcuts.
When to Unleash a Sub-Agent: Your Army of AI Specialists
Now, let's talk about sub-agents. This is where things get REALLY interesting. Sub-agents are all about autonomy & specialization. They are pre-configured AI personalities that the main Claude Code agent can delegate tasks to.
Here are the key features of sub-agents that make them so powerful:
They have their own context window: This is HUGE. It means a sub-agent can focus on its specific task without getting bogged down by the main conversation. This prevents "context pollution" & keeps your main chat with Claude clean & high-level.
They have specialized expertise: You can create a sub-agent with a very specific system prompt that makes it an expert in a particular domain. For example, you could have a "security-auditor" sub-agent that's an expert at finding vulnerabilities, or a "database-designer" sub-agent that knows all about schema design.
They have their own set of tools: You can give a sub-agent access to only the tools it needs to do its job. This is great for security & for ensuring the sub-agent stays on task.
They're reusable: Once you create a sub-agent, you can use it across all of your projects. You can even share them with your team to create consistent workflows.
So, when do you create a sub-agent? Here are some scenarios:
Complex, multi-step workflows: If a task involves multiple steps, like writing code, then writing tests, & then refactoring, a sub-agent is a perfect fit. You can create a "TDD-master" sub-agent that handles this entire flow for you.
Specialized tasks: When you need an expert, a sub-agent is the way to go. I've seen people create sub-agents for things like:
Code reviewer: A sub-agent that reviews pull requests for style guide violations & potential bugs.
Test runner & fixer: A sub-agent that not only runs tests but also tries to fix them when they fail.
Documentation writer: A sub-agent that can go through your code & generate documentation.
Parallel work: While a single Claude Code session runs sequentially, you could theoretically have different sub-agents working on different parts of a project in separate terminal sessions, much like a team of developers.
For businesses looking to streamline their development, this is where things get really exciting. Imagine having an army of specialized AI assistants that can handle all the different aspects of your development workflow. That's the power of sub-agents.
And if you're thinking about how this kind of AI automation can be applied to other areas of your business, like customer service, that's where tools like Arsturn come in. Just like you can create specialized sub-agents for coding tasks, Arsturn helps businesses create custom AI chatbots trained on their own data. These chatbots can provide instant customer support, answer questions, & engage with website visitors 24/7. It's all about using AI to create specialized assistants that can handle specific tasks, whether it's in your codebase or on your website.
So, What's the Bottom Line?
Here's a quick cheat sheet to help you decide:
Use a Command when...
Use a Sub-Agent when...
The task is simple & repetitive.
The task is complex & multi-step.
You want to be actively involved in the process.
You want to delegate the task & let the AI work autonomously.
You're looking for a quick, single-shot action.
The task requires a specialized skill set.
You're creating a personal shortcut for your own workflow.
You're building a reusable, shareable component for your team.
You want to maintain the current conversation context.
You want to isolate the task in its own context.
Honestly, the best way to get a feel for this is to just start experimenting. Create a few simple commands for things you do all the time. Then, try building a sub-agent for a more complex task. You'll quickly see how they can both fit into your workflow.
For businesses that are starting to see the power of AI in development, it's a natural next step to think about how to apply that power to customer-facing interactions. Building no-code AI chatbots with a platform like Arsturn is a great way to do that. It helps businesses build meaningful connections with their audience through personalized chatbots, boosting conversions & providing a better customer experience.
I hope this was helpful! Let me know what you think. What are some of the coolest commands or sub-agents you've built?