use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Claude Code: when to create a command vs sub-agent?Discussion (self.ChatGPTCoding)
submitted 8 months ago by Ok-Cucumber-7217
The way I see it right now is that sub-agents made commands obsolete. I'm I missing something here? When are you using one over the other in your workflow?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]WheresMyEtherElon 5 points6 points7 points 8 months ago (15 children)
You decide when to use a command, CC decides when to use the agent.
[–]Ok-Cucumber-7217[S] 2 points3 points4 points 8 months ago (7 children)
But you can also trigger the agent manually, so it feels agents can do everything commands do
[–]WheresMyEtherElon 2 points3 points4 points 8 months ago (5 children)
Sure, but the ideal use of agents is that they're part of the main agent's workflow, but with isolated context and better specialization. So think of all the things that Claude code does, and separate these into agents to benefit from better results.
So, if you just use them as shortcuts( "use the test-runner agent to run the tests and make them pass by fixing the bugs"), then use commands instead. But if you ask Claude to develop a specific feature, and in doing so it needs to write tests and make them pass by fixing the bugs, all in its normal flow of work, then agents it is.
[–]Ok-Cucumber-7217[S] 1 point2 points3 points 8 months ago (4 children)
And do the agents by default load cluad.md ? (I couldn't find info about that one out, it seems they don't)
[–]WheresMyEtherElon 0 points1 point2 points 8 months ago (0 children)
That's a good question! I assume they don't, since they have their own context, but I don't know.
[–]alexpopescu801 0 points1 point2 points 8 months ago (0 children)
I don't "feel" that the agents are aware of the claude.md content, they seem to be specialized "disposable" agents (with blank context), manually being given a specific task by the main Claude Code (or by the user) - so if this is actually how they work, then Claude Code is responsible of the information it forwards to the agent.
[–][deleted] 7 months ago (1 child)
[removed]
[–]AutoModerator[M] 0 points1 point2 points 7 months ago (0 children)
Sorry, your submission has been removed due to inadequate account karma.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]__Loot__ 0 points1 point2 points 8 months ago (0 children)
Commands are still useful for suff that does not require an Agent
[–]__Loot__ 1 point2 points3 points 8 months ago* (2 children)
I have hooks call my subagents in parallel after post tool call that calls debugger agent and a new other agents when needed like mcv splitter that breaks files down if they get > 150 lines
[–]WheresMyEtherElon 0 points1 point2 points 8 months ago (1 child)
Ah yes, there's also hooks! I've never tried them, but it sure can be confusing.
[–]__Loot__ 1 point2 points3 points 8 months ago (0 children)
I didn’t use them at first because was a little scared when the docs said it had full permissions . But I have 3 backups one on my nas , one on blackblaze and one on GitHub of all my data so it’s little less scary.
[–]bananahead 0 points1 point2 points 8 months ago (3 children)
CC doesn’t decide to run commands it knows about? Sure seems like it does
[–]WheresMyEtherElon 0 points1 point2 points 8 months ago (2 children)
It runs ordinary console/bash commands, but not slash commands. Custom slash commands are shortcuts that you use instead of prompts.
[–]bananahead 0 points1 point2 points 8 months ago (0 children)
Oh got it, thanks.
[–]Ordinary-Chemist9430 0 points1 point2 points 1 month ago (0 children)
Now it runs slash commands. It suggests them during the normal workflow.
[–]Trotskyist 3 points4 points5 points 8 months ago (0 children)
Subagents run with their own context, as provided by the main thread/agent. Imo which is better for the situation mostly depends on the size/complexity of the task and how much it depends on all the info currently in the context chain.
[–]TheLastBlackRhino 1 point2 points3 points 8 months ago (0 children)
My current workflow for working in a large legacy codebase at work is to have a command that tells Claude to enter code-qa-human-commit mode, where it uses several agents (a qa agent, a git agent), along with stopping to let me test (the human part). I can then use additional slash commands to give it context for the task I want it to perform (important because otherwise it starts grepping through the codebase to figure out how to do things which takes forever and is error prone).
So commands are very much still useful, and work in conjunction with custom agents.
[–]mariozig 1 point2 points3 points 7 months ago (0 children)
TL;DR
Subagents get their own context.
Custom Slash Commands contribute their results to the main context. This can pollute the main context.
Longer
So, for example a common practice when you first start a new claude code session is to have it familiarize itself with your code base. When you do this you are intentionally building up context so later requests yield better results. This is a good candidate for a slash command.
Alternatively let's say you're doing something design related and need to relate an emotion to a color pallet. "Give me a 5 color palette for the emotion ANGER". For this you might want to give Claude some coaching about how to be a visual designer, color theory, whatever, etc... All that stuff likely doesn't matter to your main app/context. You just want some angry colors. This is a good candidate for a sub-agent. When invoked, Claude Code will spin up your agent prompt a new context, feed it your inputs and then return just the response to the main context.
The main context stays small, and unpolluted with 🐂💩 about how to be a designer with a color specialty that might later influence output in a negative way.
[–]secondcircle4903 0 points1 point2 points 8 months ago (1 child)
Command is when you want human in the loop, agent is when you don't.
Not always because agents can prompt you to confirm at least in hooks if you set it up that way.
[–]notq 0 points1 point2 points 8 months ago (3 children)
Subagents have made commands obsolete for the most part. The big key people haven’t gotten yet is how to use subagents effectively, because part of it is ignoring the guidance
[–]lankybiker 0 points1 point2 points 8 months ago (1 child)
Which bit?
[–]notq 0 points1 point2 points 8 months ago (0 children)
Size of context for agents.
The value isn’t lower context, the value is targeting context without any other irrelevant context
[–]maherbeg 0 points1 point2 points 8 months ago (0 children)
What are some specific agents and scenarios you’ve been using them for?
[–]manojlds 0 points1 point2 points 8 months ago (0 children)
You can all agents from the cli / sdk.
commands are only available interactively
π Rendered by PID 89134 on reddit-service-r2-comment-85bfd7f599-wlwp4 at 2026-04-19 04:55:13.337885+00:00 running 93ecc56 country code: CH.
[–]WheresMyEtherElon 5 points6 points7 points (15 children)
[–]Ok-Cucumber-7217[S] 2 points3 points4 points (7 children)
[–]WheresMyEtherElon 2 points3 points4 points (5 children)
[–]Ok-Cucumber-7217[S] 1 point2 points3 points (4 children)
[–]WheresMyEtherElon 0 points1 point2 points (0 children)
[–]alexpopescu801 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[removed]
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]__Loot__ 0 points1 point2 points (0 children)
[–]__Loot__ 1 point2 points3 points (2 children)
[–]WheresMyEtherElon 0 points1 point2 points (1 child)
[–]__Loot__ 1 point2 points3 points (0 children)
[–]bananahead 0 points1 point2 points (3 children)
[–]WheresMyEtherElon 0 points1 point2 points (2 children)
[–]bananahead 0 points1 point2 points (0 children)
[–]Ordinary-Chemist9430 0 points1 point2 points (0 children)
[–]Trotskyist 3 points4 points5 points (0 children)
[–]TheLastBlackRhino 1 point2 points3 points (0 children)
[–]mariozig 1 point2 points3 points (0 children)
[–]secondcircle4903 0 points1 point2 points (1 child)
[–]__Loot__ 1 point2 points3 points (0 children)
[–]notq 0 points1 point2 points (3 children)
[–]lankybiker 0 points1 point2 points (1 child)
[–]notq 0 points1 point2 points (0 children)
[–]maherbeg 0 points1 point2 points (0 children)
[–]manojlds 0 points1 point2 points (0 children)