r/PiCodingAgent • u/bsa-saa • May 08 '26
Discussion Do subagents really matter?
I’ve been running Pi for two weeks without any subagents, agent teams, or anything like that. Compared to my previous workflow, I haven’t noticed any difference at all. In fact, the AI even seems a bit more accurate without subagents.
Something I think is really important: Is there a good way to automatically start/stop another agent client and let them send messages to each other?
Would love to hear any methods or tools that can do this!
37
u/m3umax May 08 '26
Well it depends on how you work.
For myself, I couldn't do without them and had my AIs build me a custom subagent extension that works around the way I work.
My workflow is:
Brainstorm with Superpowers brainstorm skill > Output spec.md
Review spec with a subagent (different model family) > Output revised spec.md
Write implementation plan with Superpowers writing-plans skill > Output plan.md
Review plan with a subagent (different model family) > Output revised plan.md
Shard the plan.md into individual task "tickets" using my custom
TickettoolOrchestrator manages a fleet of subagents to implement the plan by moving the tickets through the pipeline from ready > active> review > needs fix > done
Subagents allow me to kick off step 6 and walk away/go to sleep and come back to a fully completed plan. Otherwise I'd have to manually babysit the whole process. And I'm too lazy for that.
5
u/No_Pollution2065 May 08 '26
I am using pi with locally hosted model with limited VRAM and for single user. Without subagents, model is reusing most of the KV cache and progesses very quickly. I am wondering with subagents, would model have to do prompt processing for the full context again once it switches between agents? It would limit it's benefit for local use cases or is there any way around it.
9
u/m3umax May 08 '26
Ah. This is exactly why I built in an optional parameter called "inherit_context" into my subagent tool.
It can accept the node ID for any message in the tree and results in the entire JSONL session state up to the chosen node ID being passed to the subagent as context.
It can save a node ID and repeatedly call subagents using that same "anchor" message.
Result: Each subagent gets a stable unchanging prefix which hits kv cache.
So my strategy is to read into context the required documents that will be common to all subagents such as the spec document and Superpowers skills. Save anchor, then repeatedly call subagents with that same unchanging context package to guarantee the cache hit.
→ More replies (2)1
u/_zendar_ May 08 '26
Hi, sometimes I get into issues during planning phases. I've implemented a plan cycle review skill to address this. Check this PR for additional explanations: https://github.com/obra/superpowers/pull/1473 If you are interested in trying it please checkout my branch and let me know if it could be helpful
1
u/elprogramatoreador May 08 '26
Is your orchestrator an agent or a deterministic script? In any case im interested how it works for you!
I’ve been stuck on getting a good orchestrator pattern for a while now
4
u/m3umax May 08 '26
I like agents in what's called an OODA (observe, orient, decide, act) loop.
Just telling them to act in a OODA loop is helpful since it's a real military term for giving subordinates autonomy.
Deterministic scripts are hard because you gotta come up with every edge case and scenario ahead of time whereas agents can reason and recover from the unexpected.
I'm a vibe coder but, and the things I do aren't mission critical. Autonomous agent loops probably aren't ready for production yet lol.
But I want to have the experience running them on the assumption that one day autonomous agents *will* be production grade.
→ More replies (1)1
u/rm-rf-rm May 08 '26
Are you doing the review in the same session which is qhy you need the subagent ?
I have essentially the exact same workflow (which is just the standard engineering process in many industries). I review the spec/plan manually anyway so i start a new session for revision discussions thus obviating the need for a subagent. I do however like the idea of automatically doing it with a subagent using a different model though - especially if your using open weight models and something like Qwen written, Gemma reviewed should yield some fruit
2
u/m3umax May 09 '26 edited May 09 '26
It's the same session. My prompt is, to paraphrase: write the spec/plan, then send it to a subagent for review using X provider/model. Sleep for 5, 4, 3, 2 minutes, then finally 90 second intervals using delegate_check to see if review is finished each time. When the review comes back, fix any issues and report back.
My next enhancement is aimed at a system like the Claude Code /monitor command so the orchestrator can run a background bash poll script and know the exact second the subagent is done instead of hard coded wait cadence.
18
u/Polite_Jello_377
May 08 '26
•
The only reason to use subagents is to keep context clean. If you are doing it to build some big org chart of agents because you think it will be better, you are just playing dolls.
1
6
u/QueasyBreak5119 May 08 '26
Subagents changed the game for me and almost can’t work without them for many tasks. If I compact or continue a project within a new thread once context starts to fill up, I’m constantly creating handoff summaries anyway. Subagents just allow you to have that summary upfront and begin with all you need in the first instance, so to me it’s doing what I would have done anyway but in a more focused way, with meaningful context surviving longer. Which allows you to get things done at a much higher quality faster, which I know you already know. The kicker is the quality and accuracy of what your subagents bring back. If it’s just giving your main agent more crap to figure out and dig through then yeah, I can see that numbing down your session fast. But i have a strict “one task” rule for my subagents. Do one thing, nothing else. And the results have been high quality. Just like others have said, it’s not the most graceful workflow, a lot of it is manually passing information. But it doesn’t feel laborious. My subagents are usually Chinese models, they are workhorses man
1
u/cosmicnag May 08 '26
What extension are you using and how? Can you give an example invocation for the one task only concept? Do you manually invoke subagents per task? The main agent has to rely on its output?
4
u/QueasyBreak5119 May 08 '26
Sure, I’m just using a modified version of the pi-subagents extension. With the one task, I keep it very simple. I found default subagent use was way too heavy and much too broad. For example, I was trying to reverse engineer something recently. I broke the large task down to the sum of its parts. For examples sake I’ll say 5 major elements that need deep research, planning etc. I have one sub agent research one element, in a very narrow scope - as specific as possible with a limited skill set. One site, one concept, whatever. It’s up to you how you want to scope it, but I find the smaller and more limited the better. My mentality is that it’s more effective to bring back small chunks of extremely relevant data rather than broad scans. It’s really cool to see a screen of subagents just going crazy, using every tool on the Swiss Army knife, but instead of abusing their open context window I try to preserve it as well.
This is best done with a pre-planning session before your planning session lol. For that, I use the /grill-me skill.
It may sound very manual and very tedious but in practice it’s doesn’t feel that way because in reality things are moving along quicker because this process leads to almost 100% forward momentum every time.
Just opening my eyes so may not the best reply, but hope that helps!
→ More replies (1)
6
u/sertturp May 18 '26
So here’s my take on subagents, after actually using them for real engineering work instead of running a medieval role‑play guild inside my LLM.
Most people seem to use subagents like:
“Frontend Agent”
“Backend Agent”
“Writer Agent”
“Reviewer Agent”
“CEO Agent” (yes, I’ve seen this)
Which is basically the same model wearing different Halloween costumes.
Same brain, same context, same reasoning… just more noise and more tokens burned for absolutely no reason.
My usage is a bit different.
I use subagents as disposable context-isolated workers whose only job is to dive into something heavy, extract the useful bits, and then disappear into the void like a good intern.
Example:
I was working on a load balancer and needed Pingora docs.
Instead of polluting my main agent’s context with 40 pages of documentation, I just spawned a subagent:
Main agent → “Go read the docs, check the code examples, bring me the important stuff.”
Subagent → dives into the entire documentation like a caffeinated raccoon
Comes back with a clean, distilled summary
Then gets deleted like it never existed
Main agent stays clean, focused, and smart.
Subagent does the dirty work.
Everybody wins.
This pattern works insanely well for:
Large documentation sweeps
RFC / API / whitepaper digestion
Repo/codebase exploration
Log/config/JSON extraction
Research tasks that would nuke your main context
And the best part:
No context contamination.
No hallucinations from juggling 10 different topics.
No “writer agent” pretending to be Hemingway.
Just clean, isolated, task‑specific work.
My rule of thumb:
Subagent = a tool, not a personality.
If you’re giving your subagent a job title instead of a job, you’re doing cosplay, not engineering.
1
u/ayawnimouse Oct 13 '26
not that I have a problem with it, but its odd to write this with an llm - I really hate llm's with personality it feels so forced and weird "like a caffeinated raccoon", however it does make sense in terms of pollution to the main agents context so I did get something useful out of your post
4
u/Street-Donut1215 May 08 '26
The only reasonable use case for me is when I want the agent to do something with a clean context window (independent review, visual data extraction from charts etc). This enables me to do these tasks without the need to start a new chat / session
1
u/SalimMalibari May 08 '26
Does subagent works?? Yes but think to simplify it think of it like employees ...
Ok an employee can do all jobs but some jobs need multiple employees ...
Like i remmember doing a simple task and it was amazing but i didnt futher my experiment.
I launched 2 subagents they can talk to each other and try to convince each other , i made it like 5 rounds but they didnt get any agreement , but like i could for example if i have wicked problem , i might use something similar till both subagent or multiple get an agreement...
To be honest , i feel if you still dont need subagents thats mean you are still using AI to solve simple problems only ... try to find wickes problems ans try to solve it
1
u/bsa-saa May 08 '26
What tool did you use to build those subagents?
1
u/SalimMalibari May 08 '26
No tool i just asked pi , it seems it can create subagent somehow that cant even resd the main thread ... so as far i understood pi can launch himself and send prompt using grep ... that what it used ... like ypu need 3 to 7 prompt to do that but its too easy
1
u/bsa-saa May 08 '26
Got it, It launch a headless pi if you haven't install some extensions. Maybe it also read the session file. Agent magic
→ More replies (1)
2
u/worldsayshi May 08 '26
I've been thinking about using subagents specifically for saving tokens/context. The agent often runs long running scripts that output lots of logs that might contain errors. Would be nice to only include the errors in the context. But often a simple pipe grep oss enough. So I'm not sure it's worth it?
One alternative to plain subagent use could be to have some kind of garbage collector subagent where a subagent goes through the session history and removes unnecessary stuff. Has anyone tried this?
3
1
u/ayawnimouse Oct 13 '26
wow we are really moving forward here, a garbage collector subagent is very unexpected but makes sense too. There could basically be a top level agent that all it does is garbage collect, summarize etc, the main agent that is now a sub agent isn't even aware of the top level agent monitoring and editing its context. we are living in the future
2
u/cellerich May 08 '26
Have a look at the following GitHub Repository: https://github.com/HazAT/pi-config Daniel has a setup which uses subagents for different tasks and fire off in a separate terminal window. Make sure to have TMUX in your terminal emulator!
2
u/Maleficent-Movie-625 May 08 '26
Yes. To keep the context of the main clean
no need to pollute the main context, unless it’s the result of a lookup.
Also if you need to compact a single time, you’re doing it wrong. I’m also on pi, refusing to install the subagent plugin, but I’m going to make my own version of it instead.
Subagents matter to keep the context clean
2
u/johnson_detlev May 08 '26
I think in coding the only really nice use case for a subagent is autoreviewing the clankers changes by another clanker after the task "is done".
1
u/Appropriate-Debt2000 May 08 '26
Your output completely depends on whats in the LLMs context window.. subagents help keep it focused. A huge chunk of your main agent otherwise would be polluted with things which are not relevant. You can also switch models per sub agent depending on the assigned task which helps further. Agent teams take it a level further by not just outputting the final results to main agent but also coordinating with other team members in process avoiding conflicts and duplication .. providing much richer contect to the main agent. Overall really good concepts and u should add in your wf
1
u/Eddlm_ May 08 '26
They do.
Lets the main dude have multiple points of view thru personalities or different models
Accelerates read only work
LLMs generally work better when they know they're playing a specific role with a specific focus, so it's great to steer the main agent from trying be everything at once.
Source, my ass. So, my experience.
1
u/DueKaleidoscope1884 May 08 '26
I think your question is about parallelizing mostly? If not, I also started using Pi a few weeks ago with the intention to keep things as simple as possible, did you try managing context and work with the built in session mgt? (/tree or doubt escape) As long as you do not need automated orchestration this seems to go a long way to avoid actual sub agents? Sure a lot more manual and deliberate work but that could be a deliberate choice? The session tree does not cover all use cases of sub agents but I feel currently I discarded that feature too soon.
1
u/anlaki- May 08 '26
My context usage reaches 80% on a single prompt when I ask Pi to read its docs to create a basic extension. Therefore, I believe subagents are truly important.
1
u/Frequent_Ad_6663 May 08 '26
I'm often reminded of the midwit thing. Folks on the left tail of the distribution are like "just open cli and prompt once" folks in the middle use Droid or similar? And folks on right tail just prompt once in cli. Pete from claw has an article on this
1
1
u/melihmucuk May 28 '26
I think subagents matter most when they give you a genuinely separate pass, not when they’re just "more agents".
The clearest example for me is code review. I don’t really want the same agent that planned and implemented a change to also be the only reviewer. That’s not how we do it with humans either. The person who wrote the code already has a bunch of assumptions in their head, and they’re naturally biased toward the solution they just built.
Without subagents, the flow often becomes:
give one agent the task
it investigates
you go back and forth on a plan
it implements the plan
then you ask the same agent to review its own work
At that point the context is huge, the agent has already committed to a direction, and the review tends to be weaker. It may catch syntax-level stuff, but it’s less likely to challenge the approach or spot the thing it misunderstood earlier.
That’s where I’ve found pi-crew useful. For example, the review flow can spawn a separate code reviewer and quality reviewer in parallel, then merge only the findings that are actually actionable. The planning flow can send scouts to inspect different parts of the repo before handing cleaned findings to a planner.
So the main agent is more of an orchestrator instead of trying to hold the whole task, implementation, and review in one overloaded context.
I don’t think subagents magically make AI smarter. For small tasks, they’re probably unnecessary. But for planning, investigation, and especially reviewing code written by another agent, having a fresh isolated context is a real advantage.
Small disclosure: I’m using/working on pi-crew, so I’m biased too. But the reason I like it is pretty boring: it gives me a practical way to spawn/list/abort/respond to background agents in Pi, instead of pretending one giant context window is always the best workflow.
11
May 08 '26
[removed] — view removed comment
4
u/bsa-saa May 08 '26
Yes, I’m doing exactly the same thing.
I think what we’re really doing is manually planning and breaking down complex tasks. This process could probably be automated to some extent, but in my opinion, Claude Code’s async approach only provides the tools — it doesn’t actually give you a clear path or workflow. It still ends up requiring manual effort to manage the context and orchestrate everything.
3
u/cosmicnag May 08 '26
So you run this pu command from inside pi ? The output goes to the main agent?
1
May 08 '26
[removed] — view removed comment
1
u/bsa-saa May 08 '26
https://github.com/nicobailon/pi-subagents I used this before. It's good, but it's best to cover the subagent prompts.
4
u/Dull-Philosophy3970 May 08 '26
I’ve been wondering about this as well. Haven’t found a reliable way for the main agent to launch subagents for specific tasks. Anyone has tips for how to do this? Should I create specific SKILL.md?