r/opencode • • 1d ago

How do you actually manage your agent orchestration workflow without losing your mind? (Show me your setup)

I am pretty new to agent orchestration and trying to move away from messy, manual chatting into a cleaner workflow. Right now, I feel like I spend more time managing the AI than actually building.
For those of you running multi-agent setups or using different models for different tasks, how do you structure your daily workflow?

  1. Chat Hygiene: Do you keep one main "standing" chat that you constantly clear/archive, or do you start a fresh session for every single task?
  2. Task & Memory Management: How do you keep track of everything? Do you keep all context inside the chat/project files, or do you use an external second brain like Obsidian to feed context in and out?
  3. Model Routing: Do you pre-define your sub-agent models upfront (e.g., hardcoding a cheap/fast model for simple tasks and a heavy model for logic), or do you decide on the fly inside the prompt?

Would love to see how you guys set this up—drop your stack and workflow, screen shot of your side bar chat, etc. below so I can learn what actually works in practice.

I am using Claude code for the orchestrator and various opencode models to do the tasks. All commands started in claude code that commands opencode cli for delegating the tasks.
I am no coder so I dont really know the proper jargon 😂

25 Upvotes

32 comments sorted by

7

u/Ok-Cut3951 1d ago
  1. I run the orchestrator (Claude on a 20$ sub) from my own harness, giving it a wave of work each time with a new session each wave.
  2. A combination of a kanban style task mcp and obsidian handoff note.
  3. My harness supports deterministic routing, reasoning levels are determined for the pre-selected tasks, making it summon Claude with a brief of which agents are needed for the tasks. Overall it seems to be in love with a combination of Ds4.1 flash 1017 and HungerG (currently free)

Models are hardcoded, but it checks weekly for new releases, changes to pricing, etc.

1

u/desktreme 1d ago

Seems like quite an advance setup there. Thank you for sharing.

3

u/Senior-Rub-4663 1d ago

Well, it's not as complicated as it sounds tbh. We're using a pretty similar setup for one of our projects. Instead of Kanban and Obsidian, we use Linear MCP for task management and persistent markdown files for context and handoffs between sessions.

You don't necessarily need your own harness either. Just get an OpenCode Go sub and a $20 ChatGPT or Claude sub for orchestration and you're pretty much good to go. You could even use Kimi with the current $60 promotional quota on OpenCode and avoid spending those extra 20 bucks altogether.

The amount of value you get from OpenCode Go rn is crazy!! Especially with the current DeepSeek Flash and GLM quotas. You can have multiple workers running in parallel without constantly worrying about burning through your expensive frontier model limits.

We basically use Codex or Antigravity to plan the entire sprint, break it down into independent tasks on Linear, allocate them to different agents, have them work in isolated Git worktrees, and then supervise, verify, review and reconcile everything. Each agent leaves a proper handoff so even if a session runs out of context or quota, another agent can pick up where it left off.

Ofc a custom harness gives you more control over deterministic routing and model selection, but I'd argue you don't really need to spend days building your own infrastructure to achieve something similar.

The difficult part imo isn't setting up multiple agents anymore, it's getting them to work together reliably without hallucinating, losing context or messing up each other's work. Once you figure that out, the amount of work you can get done with these relatively cheap subscriptions is genuinely insane.

4

u/alex_aicgs 1d ago edited 1d ago

Multi-agent setup is mostly not optimal. Agents tend to re-read things all over again, so unless it's some highly complex, it's much better to have your one agent do most of it, and to simply have reviewer(s) afterwards. And not spread the models over areas, unless it's like backend vs frontend in which case you shouldn't be doing all at once anyway.

Another reason it's not optimal is reread of uncached input, which is 50x more expensive, regardless API or browser auth. One agent can do it, and subagents can review. That's it. With compactions these days, there are very little downsides, and it's hell of a lot cheaper, and faster.

Another benefit of this is that it's much easier to review for an agent and spot mistakes than it is to build and build well. So just use your best model to build, and a weaker model on higher reasoning to review.

1

u/desktreme 1d ago

Interesting. I thought the most optimal way is by using map like llm wiki. Breaking down the tasks into smaller tasks in connected md files

4

u/alex_aicgs 1d ago edited 1d ago

One capable agent can handle all those small tasks at once. And as stated, all those other agents need to reread all of the inputs all over again, and reason over it... And if it's weaker models, you immediately put yourself in a worse position by having weaker models do a task.

And then you need to have your main orchestator read ALL of that stuff all over again, and waste time and tokens, and fix, and manage - it's just a bunch of needless complications.

So unless you're trying to save usages terribly, I wouldn't recommend going down that rabbit hole. And sometimes, even by trying to save usages you spend more by having to fix everything, and your main orchestrator had to read all of that and more, and it's all uncached input in that thread as it is reading it for the first time. There's a reason models can one shot successfully, especially if you use a subagent to confer with, and then review later. And that's all you need, two agents: one main, one conferee/reviewer, and if really important you can throw another one as a reviewer only later.

Just my opinion.

3

u/AIverflow 1d ago
  1. One topic per session. If it gets too long, the cache expires, or I want to switch models or harnesses, I open a new session and say: 'Read the end of session id-123456 from hermes|claude|gpt.'
  2. It refreshes the context using very few tokens.
  3. One harness being able to read sessions from others is great.
  4. Golden rule: project files = code and documentation. Plans, tickets, and mockups stay outside the project. There are plenty of ticketing tools out there, including GitHub, so I built my own :)
  5. Each project has a .tickets folder (git-ignored in the parent repo) containing plans, tickets, and mockups. It's a minimal, local Markdown ticketing system for agents (ticket-chic on GitHub).
  6. Ask Opus to create a plan and break it into tickets. If a ticket is too big or complex, tell Opus to split it. Then ask Opus to write an orchestration prompt for Sonnet, delegating execution to either Sonnet or Haiku. Then give it to a new Sonnet session and watch them work. This lets you fine-tune testing depth, review checkpoints, and batching for small tickets. At the end, ask sonnet, opus or another model for a review .

This workflow works across most harnesses and models, intra-harness delegation is simpler and safer than juggling multiple tools. Keep it simple.

Good caching is key to cutting costs in agentic coding, so:
- Don't run multiple agents that all re-read the same context.
- A long session that crashes will lose your momentum and burn tokens to recover.
- Never recall an old session with an expired cache (depends on the model/provider).
- Use handoffs or resume the previous session instead.

After an agentic session, ask your agent to debug it : find pitfall and way improvements : was it too many long tests, too much reviews, agents waiting for nothing, and then enforce rules in the project AGENTS .md

1

u/desktreme 1d ago

Do we need to define what’s too big or opus has its own comprehension?

1

u/AIverflow 1d ago

Opus/the Brain creates tickets with 2 metrics : complexity and effort, it is good at that.
And then it assigns them as best he thinks, it can select Fable if it thinks this is the best./
But I constrain it to use only Sonnet and Haiku.
If a complex ticket is assigned to Sonnet I ask : is it really complex ? will Sonnet succeed ? can you make it more simple or split it ? Usually it splits, some rare time I let Opus assigned to it.

2

u/dangerouscat16 1d ago

I think you probably just need to see someone working in action on youtube. Personally I use t3 code but I realize the author doesnt have the best rep.

fresh sesh for every task but develop dependence on an orchestrator who spawnas subagents as needed

agent.md stays only a pointer to more detail .md files

i do define the sub agents but simply when delegating. "delegate x task to haiku xhigh"

1

u/desktreme 1d ago

If you have a good youtube video crossing your mind, it would be greatly appreciated.

Does the result or anything will degrade or lost in translation by using third party app like t3?

From what i understand you opened a chat or new agent based on task not by role? Cmiiw

2

u/nuaing11 1d ago edited 1d ago

For me for every big task i ask the orchestrator (good models) a proposal first, either it will research by itself or spawn a subagent for research (researcher agent) (i specify that),

then it give me a proposal, we tune it until i agree, then it will spawn a subagent for the coding works using (builder) deepseek v4.1 flash, it could be 1sub agents or 3,

when its done orchestrator will check that its implemented the way the orchestrator see it fit,

then it spawn another sub agent (verifier) to review the code, if my repo is strict then orchestrator will spawn doc reviewer based on my repo strict requirement then if it meets my requirements rule etc the orchestrator will report to me that it done and summarize it then i test it i confirm and verified,

then i compatc the session

1

u/desktreme 1d ago

Do you have any rules of when to clear the chat or compacting or move to a new chat, to make the context lean

2

u/nuaing11 1d ago

I only compatc the session when its done and verified by me, but when if theres a follow up that is related to this session i will continue after compatc in this session and compatc again when the follow up is finish/done

If its unrelated to the task i create another sessions

I do this to make it easy to search the session history, and i use openchamber

1

u/desktreme 1d ago

Do you ever archive or delete the completed task?

2

u/nuaing11 1d ago

I never delete and i auto archive for sessions thats longer than 30days, so i can still see the history

2

u/ThankGodImBipolar 1d ago

Chat Hygiene: 

I never compact. In my limited and anecdotal experience, compaction eventually leads to drift in agent behavior that is worse than what happens at 500k+ tokens. 

Task & Memory Management: 

I have my agents write bug reports before fixing code, and they commit a dev log with each change. I also have an external wiki, where I store planning, research, some important decisions/ideas, etc.. And, I have LLMs maintain documentation for the project standards and code, within the repo itself, as part of the development process. 

You can get a lot of inertia behind behavior like those items after you get the ball rolling. My code is littered with cross references to bugs, wiki pages, decisions, commit hashes that introduced regressions, etc., and while it's all slop to me, it does help LLMs connect the dots/discover the context more efficiently and completely.

Model Routing:

I predefine my subagents (partly because I have free OAI credits). Having a model router is an interesting concept to me, and I know that some work pretty well, but naively defining one model is fine for my use cases (and a lot less work). It would be more worth exploring if my goal was a truly autonomous development loop. 

2

u/desktreme 1d ago

I am about to ask about token efficiency but you have free OAI credits.

Are you using system like karpathy llm wiki to manage your external wiki.
I kind of have a wiki too, I was wondering how do you make an entry to your wiki, are u using inbox system then ask your LLM to manage, lint, archive.

2

u/ThankGodImBipolar 1d ago

I don't have an OAI subscription, so I can only use the credits on 5.6 Luna/Terra and 6 Luna... which effectively relegates it to being a slightly more reliable implementation agent. Part of token efficiency is writing plans so that cheap/free models can be used within them - that's GPT 6 Luna for me right now, but it could just as well be Beam Free or Hy4 Flash Free. 

And yes, I am doing Karpathy-style wikis. Right now, I don't have any automatic hooks or anything that are adding pages to it. Instead, "update the docs" is a consistent phase in my implementation plans. I've also got a review prompt that I run manually, which checks the documentation and makes sure that nothing is undocumented or going stale. Ideally, I'd automate the creation of the docs by distilling the git diff of my repo every night - I think this would be the most efficient way of doing it, and more elegant than relying on a deliverable ending up in an inbox. 

My personal wiki, on the other hand, is mostly for ideation and developing things into full-fledged plans, so it gets updated only when I'm specifically prompting an LLM about it. I'm sure this will get some hooks too one day, but for its current use, manual prompting makes the most sense 

2

u/sugarw0000kie 1d ago

Context drift and keeping context small are things to keep in mind, so I view context as untrusted. Every compaction is a game of telephone and things get lost there, and agents running at long context use more tokens and perform worse over time in both speed and code quality. Hallucination rate increases as context goes on. I usually cap my agents at like 256-272k context but may bump up to 400k for the orchestrator.

2: I use repo files, seems to work for me. After creating a list of demands in some spec for the ADR, I have a strong planner write out implementation plans with explicit acceptance criteria, and add them to a registry that is just another .md file that links to planning docs. Plans are marked as ready, blocked, closed. I have planning related skills that agents need to use so they interact with it in a uniform way.

It helps me plan out architecture because I can see clearly to get to step d I still have a/b/c that it depends on, but maybe I can do a+b in parallel, or have other features working on other areas where I wouldn’t be worried about merge conflicts.

1: on chats, I usually keep a chat dedicated to one line of feature development, but may have other chats/worktrees active on that repo so I can build out other areas of the codebase.

3: on model routing, I select subagents as cheaper but still good models. I have luna max (from separate codex sub) as my subagents and luna high for explore. I use stronger models like sol for planing and I change the orchestrator based on the task, deepseek flash is solid for most things, I like minimax 3.1 flash max for frontend, grok 4.7 sometimes I use for review and sec/dependency audit, and glm/gpt terra for harder things. Thats always changing, but models have different strengths so I try to pick ones based on the task and difficulty. Most of the time i switch between deepseek and minimax as orchestrator for backend and frontend.

Caveat with subagents is it’s usually better to let a single strong agent work through a feature line. Where it can be useful to have subagents is when there’s plans that touch distinct areas of code, or on very long implementation trajectories. Strong models will tend to make this call on their own and may launch explore agents but will do most of the building on their own. But if I have something that could take many hours for a strong model to build, like a 15 plan feature line, I know the orchestrator is going to go through several compactions.

In that case I’d rather it hand more of the build work off to subagents to prevent context drift on the orchestrator so I instruct it to use subagents to preserve its context. The subagents will need to re-read and get oriented to the repo so it’s not as efficient. Combination of reduced context drift on delegating orchestrator and the planning docs usually works for me for long builds.

2

u/desktreme 1d ago

Is planner the same agent as the one you use for idea discussion and just giving it a prompt to write.

Would love to peek into that planning skills.

Thank you for the context count tips 🙂

1

u/sugarw0000kie 1d ago

yeah same agent usually. was using chatgpt for the unlimited chat separate from codex but that goes away december ;(

planning skill: https://github.com/dbowm91/codegg/blob/main/.opencode/skills/planning/SKILL.md

plans directory: https://github.com/dbowm91/codegg/tree/main/plans

that's the original one i experimented with and had other repos adapt some version of it later

3

u/Senior-Rub-4663 1d ago

Well I'm pretty much in the same boat, not a proper coder myself lol.

  1. I usually work in sprints rather than keeping one massive chat alive. My orchestrator plans everything, breaks it down into smaller tasks and assigns them to multiple agents. Before ending a session I make sure it leaves a detailed handoff with what's done, what's pending, test results, commits and all that. The next session just picks up from there.
  2. We use Linear MCP instead of Obsidian and it's been working pretty well for us. All the tasks, dependencies and progress are tracked there. For context we just maintain markdown files within the repo itself. Each agent also gets its own Git worktree so they don't mess up each other's work.
  3. Currently using Codex/Antigravity for orchestration, DeepSeek Flash for most of the coding, GLM wherever more reasoning is needed and Carbon for UI. Codex usually handles the final reviews and integration.

Also the amount of value you get from OpenCode Go rn is crazy!! $100 quota on DeepSeek Flash, $500 on GLM and even the $60 Kimi promo. You could probably use Kimi for orchestration itself and save another 20 bucks.

I'd definitely suggest having an independent reviewer though. Agents saying everything is done and everything actually being done are two very different things lmao.

I wasted way too much time trying to build the perfect orchestration setup myself when OpenCode + OpenChamber + Linear MCP and a few scripts were enough for most of it.

Still figuring things out myself but yeah, the biggest improvement for me was getting agents to work independently with proper boundaries and handoffs rather than me manually managing every single chat.

1

u/Senior-Rub-4663 1d ago

Would really like a professional review on this workflow and how to improve I mostly develop big full stack apps also some lead generation scripts lead cleaning and all the shabang in cold outreach hell!! Love to know thoughts 💭

3

u/Fisher_k2 1d ago

Tengo un Workspace personal donde tengo más de 100 agentes y 6 agentes principales que se encargan de orquestar estos subagentes, los subagentes son especialistas en su trabajo (git, Rust, DevOps, testing, etc...) y se invocan dependiendo de la entrada.

Lo normal es que con el prompt ejecute y delegue tareas, pero si quieres algo más especializado, es preferible también diseñar comandos donde especifiques que subagentes quieres invocar para cierto tipo de tareas sin tener que esperar el criterio del orquestador

Te proporciono mi Spam de día, puedes ver mi repositorio para desarrollo de software enfocado en SDD:

https://github.com/Fisherk2/codice-opencode

Ya viene incluido con comandos, skills y agentes, pero tiene la ventaja que lo puedes modificar a tu antojo, no es tan restrictivo como un plugin

Nota: Está diseñado para usarse en OpenCode V2, pero si sabes cómo está estructurado Claude, Codex u otro harness, lo puedes acondicionar.

2

u/povlhp 1d ago

Compact before leaving so have small token count next time around.
Use new for new things in same project.
Remember to have it always write documentation other sessions can read to continue.

1

u/No-Peak8310 1d ago

Si no es para programar mausbot

1

u/[deleted] 1d ago

One thread per task for me. If CI fails tomorrow or someone leaves a review, I want that going back to the agent that wrote the code. A separate issue gets a fresh thread.

I built Statefold around this. On the run I posted yesterday, Codex did the implementation and asked Claude Code to write tests and review the diff. Claude reported back to Codex, then Codex opened the PR. You asked for screenshots, the sidebar and that exact run are here: https://www.producthunt.com/products/statefold-2

1

u/weyoun_9th 1d ago

I would keep one orchestrator, start fresh sessions for individual tasks and store important decisions outside the chat. For model routing use cheaper models for routine tasks and stronger ones for complex reasoning. Have you tried mastra?

1

u/vladmvp 22h ago

If part of the mess is several sessions fighting over one machine, Cobalt (cobaltcode.ai) gives each task its own cloud computer, so you start a fresh task per job and each one keeps its own conversation, diff and live preview. You can run Claude Code or OpenCode (with an OpenRouter key) there on your own accounts, and pin up to four live tasks side by side in a grid to keep track of what each agent is doing. There's a free account to try it, and I'm the founder, so happy to help you get started.

1

u/amirfish 17h ago

Model routing on the fly burned me more than it helped. I ended up pre-deciding per task type, cheap and fast for routine work, heavy for anything that touches architecture, because deciding inside the prompt is just another decision I have to make every time.

For memory, external beats in-chat once you're past one session. I keep work as tickets in a queue instead of chat history, worker agents take the next one and run it to done without me prompting each step, that's the model behind CCC, the open source tool I use for this. How many sessions are you actually running at once right now?

Free and open source: getccc.dev · GitHub

1

u/fapmasterr69 10h ago

Check my post for my setup