Dev
Blog
Build your own swarm of coding agents
Jul 23, 2025

With the release of Claude 4, we exploded our output by leveraging agents as a swarm (our ”Zerg”). Lots of people have asked about our stack, so hopefully this is helpful.
👾 What is the Zerg?
The Zerg is our system of centrally controlled coding agents that can be run concurrently in the background. They are particularly effective because we cascade critical context to each independent agent, so they understand the original problem being solved and how they fit in.
We use it to:
Handle quick bug fixes and improvements on the go
Build self-contained tasks that can be merged independently
Delegate “leaf nodes” of an active project to be merged back into the branch
The good news is you can set this up minimally with no code, but you’ll need to tune the configuration for it to really shine.
It works by using:
Claude Code CLI for planning, investigation, and merging
Linear for task management and context persistence
Claude Code + Github Actions for spawning agents
You can swap in other solutions for Linear. I’m just partial to using Linear because it keeps agent-owned tasks organized alongside tasks owned by humans.
❗️You’ll need:
A Github repo (use a monorepo if you want to get the most out of this)
Github actions enabled
Claude 4 API access via a Claude Max account and/or the developer API
Linear workspace
💪 Setting up the Hive
The Claude Code CLI is going to be your coding HQ. Install it and authenticate it with your Anthropic API key, or a Claude Max account if you have one.
npm install -g @anthropic-ai/claude-code
claude
Then run
/login
in Claude Code.
Once you’ve authenticated Claude Code, it’s time to set up the agents to run on your Github repository. This is quick, thanks to Claude Code’s Github Actions plugin. One note: Anthropic doesn’t support authenticating the Github Action with Claude Max. You’ll need to provide it an API key with billing attached.
Run
/install-github-app
in Claude CodeInstall it into your repository
This will add the base Github Action workflow for Claude to your repository at .github/workflows/claude.yml
. It will allow you to trigger Claude by tagging it with @claude
from anywhere in a Github issue or PR.
📝 Context Persistence
We already use Linear to track our work, so naturally we want our agents’ work there, too. Thanks to the integrations it offers, it’s a great way to retain the context for a agent’s task. If you’d rather track your work with Github issues, you can skip this and just create Github issues directly.
To be able to create Linear issues to drive your agents’ tasks, set up the Linear/Github issue sync:
Create a team in your Linear workspace for your agents — ours is called ”The Zerg”
In your Linear settings, go to Integrations > Github, and find the Github Issues sync
Set up a sync so issues created in this new team create matching issues in your Github repository
Now, when you create an issue in the right team and include @claude
in the description, Claude will automatically pick up the task and push it to a feature branch.
🧠🪄 Context Generation
The final piece: now that we have a place to put the agent’s context, the magic that really makes this powerful is context generation. Instead of putting the onus of creating detailed issues with the necessary context for each task on yourself (how many times have you seen poorly documented eng tickets?), you can leverage Claude to do this during your natural development flow to generate the issues.
The key is the Linear MCP server. Install it into your Claude Code CLI:
claude mcp add --transport sse linear <https://mcp.linear.app/sse
>Start Claude Code:
claude
Run
/mcp
in Claude Code and then press enter on the new Linear server there to authenticate it
This will allow you to ask Claude to create detailed Linear issues from within an active session, giving you a way to pass context to your spawned agents (Zerglings) in Github.
Note: if you choose to use Github issues directly instead of Linear, just install the Github CLI and you can ask Claude to create Github issues with it instead.
🛠️ Development Process
That’s it! Now you can use these development processes.
For the big rocks:
Plan out an approach with the Claude Code CLI. Have it read the files important to the project. Discuss the architectural implications and key design decisions. Discuss important implementation details that have to get done right. Discuss which files will need to be changed. Discuss a testing plan.
Tell Claude to create tasks for your project. When you’re satisfied with the approach, tell Claude to break it down into tasks and create Linear issues for them. Make sure to prompt Claude to include these important details in the tickets:
A detailed understanding of the project and the approach
Which files should be read to get context on the specific task
What are the bounds of this task
What should be done for testing
Create the ticket in The Zerg team
Add
@claude
in the description if you want an agent to pick this up immediately.
Incorporate the PRs. Depending on how you’re intending to use the result of these agents, incorporate the PRs that Claude creates in the way that fits your process:
For independent tasks: if the agents are tackling completely independently executable and testable tasks, comment on the PRs to have Claude iterate on it. Merge them when ready, or check them out locally to fix them manually or test them.
For dependent tasks: often I have the agents tackle tasks that are dependent on each other. Claude can manage merging the PRs into the local branch and resolving conflicts (hint: use
claude -r
to resume the session the planning was done in). This requires careful prompting so the agents understand the assumptions they should make and the task boundaries. If done right, it’s magical.
For quick fixes & small improvements:
Create a Linear issue. For small, contained tasks, just a small amount of the right context is needed, so having Claude generate it is often overkill. Similarly, add a description of the task, hints about the files to read & make changes in, and
@claude
in the description.Review the PR & merge it. For small tasks, Claude will usually get it right within a couple rounds of review feedback.
📈 Training the Zerglings
The agents will initially run into various problems. The key is to modify the Github Actions workflow and the CLAUDE.md
in your repository as you come across issues and want to customize how you interact with it.
A few recommendations:
You’ll want to give Claude access to Bash commands in the Github workflow. Use the
allowed_tools
parameter. Give it access to specific commands with"Bash(pnpm build)"
or general Bash access with"Bash"
(if you dare).Update your
CLAUDE.md
with concise instructions:Bash commands that should be used to build, test, install dependencies, etc
Where to find key files (e.g. OpenAPI schemas)
Identify precedents for common build tasks
Coding guidelines (e.g. start imports with the
@/
alias)Development workflow (e.g. install dependencies first, then do codegen, then build)
Tell Claude to update your
CLAUDE.md
when you see it stumble on things.If task merging gets messy, make your Linear issue generation aware of task dependencies by explicitly telling Claude NOT to include
@claude
in tasks that are not leaf nodes. Then, once you’re ready for a task to get picked up, tell Claude to update the description with the tag, or just do it yourself.If your cloud environment provides it, preview environments are a great addition to this workflow because you can verify Claude’s work right in the preview environment that is built off the feature branch.
If you have any questions about the setup, feel free to leave a comment. Happy coding. Let me know what you + your Zerg build!
@ VillageAI, Inc 2025