Introduction
A single generalist coding agent works fine for small tasks. The moment a project gets real — backend, frontend, tests, deploys, security checks — that one agent starts juggling everything in a single context window. Quality drops, the model starts forgetting earlier instructions, and you end up clearing the chat just to make it usable again.
This guide walks through running multiple specialized sub-agents in parallel from your terminal, using Mistral’s new CLI coding tool Mistral Vibe as the worked example. Same idea applies to Claude Code, Codex, or any agent platform that supports custom agent definitions — the value is in the orchestration pattern, not the tool. You’ll see how to scope agents, isolate their context, run them concurrently, and avoid the “one giant chat” trap.
📚 Table of contents
- Why one generalist agent isn’t enough anymore
- Context dilution — the failure mode no one warns you about
- What Mistral Vibe is and why DevStrell 2 matters
- Installing Mistral Vibe
- Main agents vs sub-agents
- Building a test-writer sub-agent
- Building a code-reviewer sub-agent
- Building a deploy-prep sub-agent
- Running multiple sub-agents in parallel
- Permissions, scoping, and team sharing
- Best practices
- Common mistakes
- Frequently asked questions
🤹 Why one generalist agent isn’t enough
Think about how a real engineering team splits work. You don’t have one person doing backend, frontend, security review, QA, and deploy prep. You have specialists. Each one keeps a focused mental model of their slice of the system.
AI agents work the same way. A specialized sub-agent — “you write Pytest tests for the backend, nothing else” — outperforms a generalist on that task because its context, tools, and instructions are all narrowed to one job. You can also run several of them at once, which is the real productivity unlock.
Common specialists worth defining
- Test writer — only writes and runs tests
- Code reviewer — read-only, security and performance focus
- Deploy prep — runs tests, lints, and final checks before shipping
- Frontend specialist — UI, accessibility, design tokens
- Backend specialist — API, DB, error handling
- Doc writer — READMEs, API docs, changelogs
🧠 Context dilution — the silent failure mode
When you keep dumping work into one long agent session, three things go wrong as the conversation grows. Early instructions age out of the context window, the model starts pattern-matching on its own older mistakes, and the response gets slower and pricier per turn. This is called context dilution, and it’s the reason every long Claude or Codex session eventually feels like it’s drifting.
Sub-agents fix this with isolated contexts. Each sub-agent spawns as an independent process with its own context window. It inherits the project context automatically — file tree, git status, code structure — but it does not inherit your entire prior conversation. That means it starts at maybe 10–15% of the window instead of 80%, with only the project information it needs.
One giant agent
- Single window holds tests, code, refactors, configs
- Early rules drop out as the window fills
- Quality degrades around the 30-turn mark
- You frequently clear context and lose progress
Sub-agents
- Each agent has its own context window
- Inherits project context, not chat history
- Focused instructions stay sharp across runs
- Run multiple in parallel without interference
🌊 What Mistral Vibe is and why DevStrell 2 matters
Mistral Vibe is a CLI-based coding agent built on top of DevStrell 2, Mistral’s open-source coding model. The pitch is performance close to frontier closed-source models at roughly one-seventh the cost. A few specs worth knowing:
DevStrell 2
- 72.2% on SWE-Bench Verified
- Roughly 7× more cost-efficient than Claude Sonnet
- Open-source — fork it, modify it, no vendor lock-in
- A smaller sibling model runs on decent local hardware
- On-prem deployment supported
Mistral Vibe CLI
- Ships five built-in agents (default, plan, accept-edits, auto-approved, explore)
- Supports custom main agents and sub-agents
- TOML-based agent definitions
- Parallel background execution
- Available free, paid tiers via Le Chat
The cost ratio is the part that matters for sub-agent workflows specifically. If you’re running five parallel agents on every task, the LLM bill scales fast. A 7× cost edge turns “nice in theory” into “run-it-on-every-PR” territory.
📦 Installing Mistral Vibe
The install is a single curl-or-Python command from the Mistral Vibe site. Once it’s on PATH:
- Run the install script (bash or Python flavor).
- Verify by running
vibein any terminal. - On first run, sign in or create a free account. You can also run a local model and skip the cloud.
- Optionally upgrade to Pro or Team via the Le Chat subscription if you’re heavy on parallel agents.
cdinto your project, runvibe, and the tool indexes the codebase and reads git history.
🎭 Main agents vs sub-agents
Vibe has two flavors of custom agent. They look almost identical on disk — one field decides which it is.
Main agent
Invoked with vibe --agent <name>.
Replaces the default behavior of your session. Useful when an entire workflow should follow one
custom personality — e.g. a strict TDD agent for a kata project.
Sub-agent
Invoked from inside any main agent session. Runs in its own context, can run in the background, and delegates results back. This is what you want for parallel specialist workflows.
Both live in .vibe/agents/ (project
scope) or your global agents directory (machine scope). The TOML file specifies name, description,
instructions, allowed tools, safety profile, max turns, and budget cap.
🧪 Building a test-writer sub-agent
The cleanest first agent. Have the tool author it for you instead of hand-writing TOML — Vibe will format it correctly and place it in the right directory.
Prompt
“Create a sub-agent called test-writer
responsible for writing backend tests using Pytest. It should only test the backend. Follow this
format: [paste the docs example].”
Once created, invoke it from the main session:
“Run the test-writer sub-agent as a background task and write authentication tests for our backend.”
The sub-agent spawns, writes the tests, returns control to the main agent. You can ask for five parallel instances if you want different test angles (happy path, edge cases, negative cases) covered simultaneously.
🔍 Building a code-reviewer sub-agent
This one is a great example of scoped permissions. The reviewer doesn’t need bash, can’t write files, and doesn’t change anything — it just reads and reports.
Prompt
“Create a sub-agent called code-reviewer.
No bash access. Read-only on files. Focus on security and performance issues. Give recommendations
without making changes.”
Permissions to expose: read_file and
grep. That’s it. Auto-approve is
safe here because the agent literally cannot modify anything. Invoke with: “Use the code-reviewer
sub-agent to review the codebase.”
🚀 Building a deploy-prep sub-agent
A higher-trust agent that orchestrates the others. Runs the full test suite, runs the linter, invokes the code-reviewer, and gates a green light for deployment.
Prompt
“Create a deploy-prep sub-agent
that runs the full test suite, the linter, and the code-reviewer sub-agent, then reports a
ready-for-deploy verdict. Same TOML format as my existing agents.”
Invoke with “Run the deploy-prep sub-agent.” It walks through tests, lint, and review, then returns a verdict. This is the building block for a one-command “is this branch shippable” check.
⚡ Running multiple sub-agents in parallel
The whole reason to invest in sub-agents pays off here. One prompt, three agents running concurrently:
“Run the deploy-prep, code-review, and test-writer sub-agents in parallel. Test-writer should cover any uncovered paths so we have full coverage. Code-reviewer reviews everything. Deploy-prep confirms ready-to-ship.”
Vibe spawns three background processes, each with its own context window, each running its own sequence of tool calls. The main agent waits, collects results, and surfaces them. You get in roughly one-third of the wall-clock time what would have taken three sequential rounds with one generalist.
🛡️ Permissions, scoping, and team sharing
The TOML for each agent controls what it can touch. The defaults are forgiving; tighten them as you move from prototype to production.
What to scope per agent
- Allowed tools — only what this agent actually needs (read_file, write_file, bash, grep, network)
- Safety profile — can it act without permission, or does it ask
- Max turns — cap runaway loops
- Max budget — cap the spend per invocation
- Auto-approve — safe for read-only agents, dangerous for ones with bash or network
Project-scoped agents (.vibe/agents/ in
the repo) get committed to git. That means your teammates inherit your specialists the moment they
pull. Globally scoped agents stay on your machine and follow you across projects. Skills can sit on
top of agents for repeatable workflows, which compounds the team-sharing benefit further.
✅ Best practices
- One job per sub-agent. Resist the urge to make a “does everything backend” agent. Narrow agents win.
- Least privilege on tools. Reviewer doesn’t need write_file. Test-writer doesn’t need network. Slim the toolbelt to the job.
- Auto-approve only read-only agents. Anything that can mutate disk or network needs human approval.
- Project-scope agents that encode team conventions. Commit them so the next teammate inherits the workflow.
- Cap max turns and budget. Catches infinite-loop bugs before they cost real money.
- Stack skills on top. Once an agent works, wrap your repeatable workflows as skills the agent can invoke.
- Use cheaper models where you can. DevStrell 2 is excellent for code tasks; reserve top-tier closed models for the planning layer.
❌ Common mistakes
- Creating one mega-agent with every permission and every responsibility — defeats the point
- Forgetting to set max turns / budget — runaway loops are a real failure mode
- Approving every prompt manually for an agent that should be auto-approved — slows the whole flow
- Putting sub-agents at global scope when they encode project-specific conventions
- Confusing main agents and sub-agents — main agents replace the session, sub-agents augment it
- Spawning 20 parallel agents on a small machine and saturating local resources
- Skipping the documentation example when creating an agent — the TOML format is finicky
Conclusion
The shift from one generalist agent to a team of specialists is the same shift engineering organizations made decades ago — and for the same reason. Focused context, narrow tools, and parallelism beat trying to hold an entire project in a single working memory. Mistral Vibe makes the pattern easy to set up at a price that lets you actually run agents in parallel without thinking about the bill.
Start with three agents — test-writer, code-reviewer, deploy-prep — commit them to your repo, and let your teammates run the same workflow on day one. From there, add skills, add more specialists, and pretty quickly your terminal stops feeling like a chatbot and starts feeling like a small engineering team you orchestrate.
Related reading
-
Claude Code Agents and Sub-Agents Guide
The same sub-agent pattern in Claude Code—how it compares to Mistral Vibe’s approach and when to pick each.
-
GPT 5.5 in Codex: A Practical Walkthrough
Another model of AI-assisted coding—Codex’s browser validation and computer use versus Vibe’s parallel sub-agent approach.
-
Building AI Agents for Production — Day 4
When sub-agents need to go to production—LangGraph workflow, FastAPI routes, and Docker deployment from Day 4 of the crash course.