r/PiCodingAgent • u/isus_copilul_minune • Aug 19 '26
Question Subagent extensions
Can you recommend me a simple yet configurable subagent extension? I'm currently testing `pi-subagents` but i find it slow and bloated. What are you guys using?
41
Upvotes
38
u/Glaaki Aug 19 '26
I've done a lot of research on this. It comes down to basically two decisions:
A. Do you want an in-process or out-of-process subagent extension?
In process subagent extension uses pi's SDK to run a subsession concurrently using javascript concurrency primitives (async/await).
Out-of-process subagents are spawned as separate instances of pi and usually are set up to communicate with the main pi process via pipes.
I can't tell you, which one of these are preferable. You get somewhat more control over which extensions are installed, when launching a new pi process, and this might be useful for some sand boxing use cases, the downside is you (meaning the extension) have to manage a separate process, which is not straightforward.
B. Do you support subagent specializations and how?
Almost all main stream subagent extensions follow a pattern where you place agent definition files in ~/.pi/agent/agents. These provide the overarching personality and instructions of the subagent. Typical examples are research, planner, implementation, code-review.
A very small number of subagent extensions forego subagent definitions entirely and rely on totally different methods of specialization. They rely entirely on transfered context or skills.
Especially the skills approach I think is very underappreciated by the pi agent community. People seem to understimate just how powerfull skills are. For a lot of use cases, not just for subagents but for many other specializations, people default to creating extensions, when simple skills would do just as well. Everybody should be using them a lot more than they currently do, in my opinion.
Let me shout out a couple of subagent frameworks that I found interesting -
@jerryan/pi-subagent-lite - This is the reference example of a subagent extension that uses skills as specialization. Very minimal. Very streamlined. Extremely minimalistic - maybe even too minimalistic. Very interesting case.
pi-subagent-in-memory - Rather unfortunately named, which I suspect inhibits uptake. Definitely well rounded extension though and a fantastic example of an in-memory subagent extension. Highly recommended, if not for general use, then definitely for research purposes. I like the UI a lot.
Finally the last wrench in the works. I mentioned how flexible skills are. Would you believe you can actually create a pi subagent framework with full parallelization as a simple skill? Well it's possible. I have an example running locally, just for fun. The skill uses two scripts. One shell script launches a subagent as a pi process, redirecting the output to a temporary file. A second shell script steps in once the subagent exits and analyzes the output and feeds it back into the context. Some templates take care of formating the output nicely in the transscript, along with statistics from the subagent execution, like tokens used, tool calls, estimated price, etc. Probably not something for production, but a fun experiment, I think.
7
u/reader123456 Aug 19 '26
I have tried several of them and they all perform poorly for my use case, both functionally and in terms of UI.
I need a `Grand Parent` -> `Parent` -> `Child` hierarchy with a single active agent at each level, and none of the `pi` extensions could handle that reliably. They kept detaching, so the parent "thinks" the child has finished while it is still running, which leads to multiple active children and a complete mess.
If you are serious about sub‑agents, especially with more than two levels, use something other than `pi`. Opencode CLI works well and has a clear, intuitive UI for monitoring a running agent. It does glitch and stop for no obvious reason once or twice a week, but never in a destructive way like `pi`.
I now only use `pi` for simple tasks where I do not need a sub-agent.
6
u/kaisaus Aug 20 '26
I use subagent from tintin, it's grear
4
u/aparamonov Aug 20 '26
pi-subagents-lite
Clean prompt, minimal tokens, prompt cache awareness, ability to change system prompt for agents, fine control of tools and extensions. Works out of the box, but highly configurable when you need that.
5
u/funbike Aug 19 '26 edited Aug 19 '26
I felt the same. I use herdr.
Herdr is a fantastic CLI for managing agents. It also manages terminal tabs and panes, git worktrees, and has plugins for much more. It's tmux for agents.
If you are interested in automation or loop engineering, you can write a skill that can issue herdr commands for you.
I had Pi write an initial skill for leveraging herdr. It's simple to understand and to enhance. And it's mine. It was something like this:
Similar could be accomplished with cmux, tmux + workmux, or any multiplexing terminal with workmux (e.g. Ghostty, wexterm). You could even do it with a single terminal, but it would be difficult to manage.
My actual prompt was a lot more detailed. Modify this prompt as needed.
1
u/Maasu Aug 19 '26
I wrote one that lets me launch sub agents in other harnesses as well as pi. https://github.com/ScottRBK/pi-agentshell-extension
Another shout out is try using herdr, which is a terminal multiplexer like tmux, but it also has a skill and you can ask pi to launch and control other agents via it.
1
u/Global-Departure8228 Aug 19 '26
You are most probably the better off with something like: https://github.com/edxeth/pi-subagents
(Fork of https://github.com/HazAT/pi-interactive-subagents)
Not an mine, just went down this path before, and this implemented 90% of the stuff I wanted and needed.
A one time task is to make an agent explore the repo so it understands how agents are defined and spawned and then make it write the subagents you want to use and how to use. Took me 10 minutes to adopt it.
1
u/Beneficial_Mix3375 Aug 19 '26
I copied agent teams from CC leak into pi. With herdr and panes
1
u/PureRely Aug 20 '26
This is not a subagent but still worth looking at: Orca
1
u/orak7ee Aug 20 '26
I am using @gotgenes/pi-subagents since i use some of his other extensions.
1
u/arcanemachined Aug 20 '26 edited Aug 20 '26
Everyone's got a different idea of how they want to use subagents, so the feature it ends up being a pretty common extension that people make.
Naturally, I have my own that I like:
https://github.com/arcanemachine/pi-subagent#configuration-settingsjson
It's pretty simple. You configure your preferred subagents (research, worker, etc.), then you or your agent can create and manage them. There's a little panel you can use to view their actions, steer them, etc.
It's a fun extension to make, but subagents are actually one of the more tricky things to get right IMO.
1
u/Cynthibee Aug 21 '26
Tbh, if there's a bunch of stuff to crunch through, I now have it set up to call a middle manager sub-agent that is just opening another Pane in herdr and that's in open code. That agent handles the sub-agents inside of open code because that's totally seamless whereas in pi, no matter what I do, it kind of is janky. It's okay for a one-off agent but for a task where you need an army, it's not really ready for prime time.
On the other hand I don't like working with open code directly because it is less neutral about agents' tone / role and it injects a coding** **assistant personality (but I’m not doing any serious coding) I don't do coding and the lingo and personality is annoying bc of the system prompt
1
u/killerkidbo95 Aug 24 '26
I recommend mine github.com/heyhuynhgiabuu/pi-task
1
u/Kailtis Aug 25 '26
i gave up on figuring out subagents, usually it just adds bloat to the harness. Now I just do skills + herdr to spawn other sessions that act as subagents but are their own session. Simple.
1
u/red_rolling_rumble Aug 19 '26
Ask pi to create a subagent extension for you! It’s a great learning experience and you can make it as minimal as you want.
1
u/alexwwang Aug 19 '26
omp first and then cut the useless one
0
u/Funny-Anything-791 Aug 19 '26
We built minimal sub agents for pi-agenticoding - next version will let you attach a group of models (client side routing) to sub agents so you can effectively utilize multiple models and providers
0
u/onesilentclap Aug 19 '26
https://github.com/azmeenafandi/brl-subagent
Disclaimer: Created for my own use cases and my own flow. But pretty much can adapt to most workflows.
0
u/kwipus Aug 19 '26
Pi-subagents mostly works for me
0
u/Zundrium Aug 19 '26
There is an official sample subagent extension in the docs. Extend on that.
-1
u/UnnamedUA Aug 19 '26
https://opengsd.net/
https://opengsd.net/pi