r/ClaudeCode • u/Resident-Fall4351 • 5d ago
Discussion Has anyone successfully set up a multi-agent system using Claude Code?
I have recently been investigating multi-agents and how several AI agents can be set up to specialise in various elements of a project.
For instance, having one main agent (Claude Code) and then sub-agents for areas such as front-end, back-end, testing and code review.
Whilst this has the potential to significantly speed up development, I am interested to know how effective this is in practice.
Below are some questions I have:
- Do you employ Claude Code’s sub-agents for project elements or would you rather create distinct agents?
- What methods are used to ensure that all agents have access to the same information?
- And how is it avoided for agents to alter things in contradictory ways?
- Does the increased efficiency that can be gained outweigh the extra number of tokens required?
I would be very interested to learn of people’s real world multi-agent systems that they have set up using Claude Code. Ideally, these should not just be based upon experimentation, but also applied within live projects.
•
u/AutoModerator 5d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
5
u/Patronic89 5d ago edited 5d ago
You don't "employ" sub-agents. You have a fixed workflow structure and the orchestrator(main session) is splitting the work on "throw-away" agents. They just have one specific task each. And it does burn less token you would think because the context isn't getting that big of each agent.
2
u/Ok-Cut3951 5d ago
Currently working on a harness with a more native approach to this, with integrated planning, communication, etc.
1
u/Turbulent_Swimmer900 5d ago
I tried to force Claude to use agents but wound up cutting way back after breaking down how much each one cost vs the main thread just doing the work itself. Now, I can sneak 2-4 specialized "helpers" in there where appropriate, but had to make a lot of safeguards to ensure they weren't costing more than they were worth.
1
u/pietrzm 5d ago
I'm using both subagents and top-level sessions put into a team/swarm. I treat subagents more like an agent's tool rather than a swarm member. You don't get only output faster but also the quality of it is higher (can fully focus on a single deliverable).
I'm using this setup daily, at work (SWE) and outside of it. I'd say for it to truly shine it's best to have big enough of backlog ready.
E: Mine often talk with each other:
1
u/Traditional-Diver160 5d ago
I use it on a live project. Not sub-agents per area, but separate agents with roles: development, testing, builds, releases. Each role has its own description file and its own memory file, and reads both at the start of a session. To keep them from changing the same things, each agent has its own permanent working copy and its own branch, and I merge into the main branch myself, by hand.
1
u/junderdo 5d ago
I've been developing this on the side. It's contains a CLI, a simple TUI, and agent skills for using it. If you want to try it you can install now it and its herdr plugin now. Be sure to upgrade it though later today after I cut a new release. Lots of fixes and good features in today's release.
https://github.com/junderdo/loopherd
1
u/atlas_trader 5d ago
claude start 3 agents to do cleaning, laundary and prepare dinner, and you can provide model and effort according to the task complexity
1
u/Late-Coast6973 5d ago
In daily use I give sub-agents only read-only jobs: searching the codebase, reviewing a diff, checking docs. They hand back a summary, so the main context stays small. Anything that writes code stays in one session, or each parallel writer gets its own git worktree, so edits don't collide.
1
u/Obvious-Grape9012 🔆Pro Plan 5d ago
I've used Claude Code to help me to build-out Pi. Out-of-the-box Pi is pretty plain. I've added webfetch, websearch, handovers, peer-messaging, and my own flow-helping "verbs" to make having a few Pi sessions orchestrate workers neatly. When in Pi, I'm mostly using DeepSeek v4.1 and it's working well
1
u/maxzang 5d ago
I run coding sessions in T3 Code (not my product), mixing Claude Code and Codex, with each task as its own thread ending in one PR. For sub-agents, a thread hands bounded work to child agents on other models: usually Claude writes the change and a GPT model on Codex reviews each PR before it merges, one fresh reviewer per round.
For shared info, the project's rules live in the repo in CLAUDE.md with AGENTS.md symlinked to it, so every session on every model reads the same instructions. To avoid contradictory edits, each thread usually gets its own git worktree and branch. On tokens I don't have numbers worth quoting; I use this daily on live products, not as an experiment.
To connect the sessions I use pingpong (pingpong.dev, disclosure: I make it): each session posts what it's working on, gets told when another session's work overlaps, and can ask another session a question.
1
u/shetritr 5d ago
on the "contradictory changes" question: give each agent its own git worktree and a list of files it owns, then merge one branch at a time. two agents editing the same file is something to design out up front, not fix after
1
u/PitifulAppearance509 5d ago
Just turn on agent teams in Claude code. Ask Claude to define the team for you. Done. But it does burn through a lot of tokens.
1
u/onitsoga 4d ago
The setup that's held up for me is one agent per worktree with a narrow file scope each, plus a shared backlog md in the repo so they all read the same state. Contradictory edits mostly come from two agents touching the same file, so scope them apart and put a review step before anything merges. Are you running these in one session with sub-agents, or separate Claude Code instances?
1
u/Outrageous_Band9708 4d ago
https://github.com/Druthulu/ProjectArchitect
checkout my readme and my wiki, tons of great info in there.
1
u/amirfish 4d ago
The contradictory-edits problem is the real one. Sub-agents each saying their tests pass, then the pieces don't fit, is what burns the time savings.
What's worked for me: settle the shared contract before anyone starts (who owns what, which states exist), and give each agent its own worktree so they're not staging into the same git index by accident. I built CCC to track which session is doing what across a run like that, one inventory instead of five terminals: https://getccc.dev/?utm_source=reddit&utm_medium=comment&utm_campaign=agent-replies
Are you running these as separate claude processes, or sub-agents inside one session?
1
u/reliant-labs 3d ago
Yes we've set this up. one agent pushes PR's, then other agents pick up the work after a pr gets pushed (review, scan, test, iterate on review comments, etc). We can branch based on review comments and send feedback to lesser agents/models, or back to models like Opus
1
u/klautermaus 3d ago
I like to have a group of claude agents/sessions for different tasks, often sharing relevant context. Then each agent is free to create new agents or sub-agents if needed. Most of the time controlling these groups from one step higher, so mainly using 1-3 different overview agents.
Probably not most token-efficient approach, but makes it much easier to work on many things at the same time
1
u/cashvaporizer 1d ago
I run something like this on live projects, though I split by task rather than by area (front end, back end, etc).
One coordinator session takes requests and hands longer work to separate sessions, each briefed on a single task. I often run them across two machines. I have a linux tower running Claude Code with remote control that I can hand sessions to as needed, and it will keep running while I'm on the move with my laptop-based or cloud-based sessions, and can do things those can't, like connect to infrastructure and other operational services. I also sometimes use different agents (mainly claude code and codex though). Each reports back to the coordinator, and I intervene where necessary and give the final yes on anything that ships.
For conflicts, +1 to merging one at a time. Each PR gets main merged in and CI green first. I use github actions to run automated unit and integration tests, plus an automated reviewer on every PR.
The part I don't see covered here is where the shared state lives for the humans. Repo files work fine for the agents, but when I want to sign off on a plan before work starts, or hand something to someone who isn't in the repo, I want a page I can read and comment on, not a markdown file on a branch.
(self-plug disclosure!) I built https://fmrl.site to close that gap. It's free and an account is optional. Agents publish plans, task lists and reports as pages that people and other agents can read, comment on and edit, and an inbox lets everyone know when something changed.
1
u/Kitchen_Interview371 5d ago
Look into gas city. I use this, it costs between 30-50% extra tokens vs sitting in front of the keyboard yourself but the result is an almost fully autonomous build. The extra token use is from all the extra testing you need to do to ensure quality since you’re not looking at it or testing yourself.
0
u/wiggle_room1337 5d ago
It's too expensive for this to make sense currently.