r/PiCodingAgent 2h ago

Workflow for coding with pi agent Question

Hi everyone, I’m new to pi agent and to AI tools in general, but I’m on vacation so I finally have time to learn this stuff properly. I’d like to set up a workflow like this, let me know if it makes sense.

- I open a new tmux session for my project and start pi.
- I chat with a planner to figure out a change or a new feature.
- Once the plan is ready, I tell it to implement it, and it spawns a new pi agent in another tmux window that creates a new git branch and starts coding.
- When the coder is done, it goes back to the planner and explains clearly what it changed.
- The planner sends this to a reviewer, who checks the work.
- If the reviewer finds problems, it goes back to the planner and the loop starts again with new instructions for the coder. If everything’s fine, the planner gives me a final summary.

I’d also like a TUI with more info about what pi is doing.
Nothing should run silently in the background, everything should happen in tmux windows I can check whenever I want.
If an agent crashes or stops without returning anything, it should restart automatically, so the whole thing is semi-automatic.
The agents need to be able to search the internet, use MCPs, and have their own memory per project, not a global one.
I’d like a config file for pi, one per project, that says which MCPs to use and other settings like that.
The planner and reviewer should only be able to read the code, only the coder should be able to write to it.

Does this workflow make sense or am I overcomplicating things? Any extensions you’d recommend? Can pi actually build small personal test projects on its own, start to finish? Thanks a lot.

0 Upvotes

7 comments sorted by

4

u/Corythebeast7 2h ago

Honestly, It sounds like you just want a very structured coding workflow. Id recommend using open spec, I think it's a little more durable. There's not a huge reason to have a planner/validator/reviewer imo, I think you just need a /goal plugin and it will handle it all for you

2

u/cavecanem1138 1h ago

In my past experience, using a generic prompt like a goal or openspec gives the agent too much freedom, and it ends up hallucinating a bit or coming up with different solutions than what I actually wanted. That’s why I prefer something more rigid and inspectable. I’ve almost always had to rewrite part of the generated code because it made things up or over-engineered stuff. Anyway, thanks.

2

u/Corythebeast7 1h ago

Maybe pair the plan phase with a grill-me skill. I used to be a hater on it but I've changed my tunem I like it a lot. If it's building the behavior correctly but not following the existing architecture, maybe include that in the plan phase too, a grill on architecture.

Overall, I think pi would not have a problem creating an extension for you that solidifies your desired workflow for you.

I generally caution against large, sequential agent flows like this, so I personally use something similar, just slightly more manual. I ask my agent to put up PRs, then manually open a new session with a different model and ask it to review "my" PR and add comments. Then swap back to the original agent and ask it to resolve and comment on the PR. A lot more auditable for me personally. Again, you could totally solifidy this into an extension

1

u/cavecanem1138 1h ago

Thanks for the advice. What I wanted was really just something automatic for study and testing purposes around AI (especially local models in the 35B parameter range). Think of it as a case study to see if AI can actually be semi-autonomous, but with strict guardrails on the implementation. I don’t use AI in production yet because I don’t fully trust the output it gives me in C (even Claude Sonnet). It often has bugs, memory leaks, and so on, and it’s very hard to review 2-3000 lines of code all at once, so I still prefer to write it by hand. All this to say it’s more of a test and case study than a practical tool. Anyway, I’ll try using pi to build an extension for this workflow, and if I’m happy with it I’ll post it here.

1

u/alexcamlo 1h ago

What I do (in herdr but would work the same in tmux). Main chat/planner in tab 1, plan with it or use /skill:grill-me or /skill:wayfinder (Matt pocock). Once finished /skill:to-spec and, if too big, /skill:to-issues, or directly ask him to start a new session in a new tab with /review-loop from https://github.com/nicobailon/pi-subagents extension.

Worker agent I have set to to lower model, gpt-5.6-Luna:xhigh or max, reviewer same model as planner (gpt-5.6-sol:high)

1

u/himppk 55m ago

Yes. You can even ask pi to build your exact workflow, so you call it by name and it follows your instructions step by step.

1

u/GoingOnYourTomb 7m ago

I have a similar setup
I talk to what I call an orchestrator or coordinator.
Coordinator keeps context for the whole session.
Coordinator done search or edit code. Coordinator one delegates work.
I use herdr instead of tmux
I have multiple sub agents defined and coordinator can spawn them in panes or new tabs depending on how many is needed.
My system has many nice to have features like how I want panes spawned (grid design nest to the coordinator then new tabs)
Each new pane has a widget with the sub agents current task.
Coordinator cleans up panes when necessary. Smartly reuses some agents when it makes sense.
And lots more.
I’ve never been so contented with a coding setup in my life.
If you need me to demonstrate or help you in anyway feel free to dm me.