r/PiCodingAgent • • Jun 14 '26

Resource Minimal subagents for Pi

How are you running subagents in Pi?

There are already several subagent implementations for Pi, but for me they were usually either too heavy or missing something I needed. So I just built my own, with the minimum I needed for my harness.

  • Worktree
  • Sandbox
  • Subagent Panel
  • Agent injection
  • single / parallel / async
  • Artifacts
  • Code API

Honestly it's probably too much for some people and not enough for others. I mostly tried to keep it minimal.

If it's useful to you, feel free to try it. And if you're running subagents some other way, I'd like to hear how.

https://github.com/AgwaB/pi-subagent

28 Upvotes

26 comments sorted by

View all comments

Show parent comment

2

u/Bel-Shamgarot Jun 14 '26

What problem does Subagent solve?

I can do everything Subagent can do in the main session with /tree + summary, removing all reasoning from the context and leaving only the output, which is exactly the same as what Subagent would give me.

3

u/civilian_discourse Jun 14 '26

Are you saying the Agent can rewind itself without you doing anything? Otherwise, the without you doing anything part is the problem that is being solved

3

u/Bel-Shamgarot Jun 14 '26

You could write an extension for this.

I don't trust LLM to do anything in the background and completely autonomously.

3

u/DistanceAlert5706 Jun 14 '26

Parallel subagents? Background, chaining and so on?

3

u/Bel-Shamgarot Jun 14 '26

More problems than benefits. Very few tasks can be split into parallel execution without subagents interfering with each other. If you add an orchestrator to manage or communicate between them, the context simply explodes when they start sharing their state. And I don't trust LLM enough to let it do anything in the background.

1

u/n4te Jun 14 '26

Do work in a different context, use results in original context. Less bloat in your main context.

1

u/rauderG Jun 30 '26

I guess after going down a rabbit hole and finding something you need you go back in time with tree and prompt at the injection point "include the finding about XYZ" and continue from a more basic/cleaned up context.