Running an autonomous AI coding assistant across a modern enterprise monorepo or complex microservices codebase quickly reveals a critical bottleneck: monolithic context saturation. When a single agent session attempts to grep across thousands of files, parse massive directory trees, rewrite business logic, and execute verbose test suites, its context window rapidly degrades. Raw terminal traces, hundreds of lines of grep outputs, and compilation logs flood the working memory. The consequences are immediate and expensive: token consumption spirals, reasoning latency grows, and the model loses grasp of high-level architectural constraints, leading to subtle regressions and hallucinated dependencies.
Mistral Vibe addresses this core engineering friction through its native Subagents and Task Delegation architecture. Rather than forcing one primary session to shoulder the entire workflow, developers can establish modular, bounded subagents in .vibe/agents/. These subagents run in isolated scratchpad contexts, operate under strictly sandboxed tool boundaries, execute specialized jobs (such as read-only codebase exploration or sandbox test verification), and return only condensed, structured summaries to the primary session.
At 365Finds, our engineering recommendation is unequivocal: never permit a single Mistral Vibe agent session to perform both broad repository reconnaissance and test execution alongside core code generation in codebases larger than 50,000 lines of code. Enforcing explicit delegation boundaries is not premature optimization; it is the prerequisite for predictable, regression-free AI-assisted software engineering.
1. The Anatomy of Mistral Vibe Agent Hierarchy
Mistral Vibe differentiates between two distinct classes of agent definitions within its configuration layer:
- Top-Level Interactive Agents (
agent_type = "agent"or omitted): These are user-facing configurations. You select them at session startup (vibe --agent <name>), switch between them during an interactive terminal session viaShift + Tab, or configure one as the default in~/.vibe/config.toml(default_agent = "accept-edits"). Built-in examples includeask,accept-edits,smart-approve, andauto-approve. - Delegation Subagents (
agent_type = "subagent"): These configurations cannot be launched directly from the CLI flag or the interactive selector. Instead, they operate as background task workers. The primary active agent invokes them dynamically via Vibe's internal task delegation mechanism (task), offloading noisy workloads and ingesting only the synthesized outcome.
Configuration Storage Hierarchy
Subagents and custom agents are defined in TOML files and loaded from two directory tiers:
| Tier | Directory Path | Scope and Precedence |
|---|---|---|
| User (Global) | ~/.vibe/agents/<agent-name>.toml | Available across all local projects for your user profile |
| Project (Local) | ./.vibe/agents/<agent-name>.toml | Project-specific overrides; checked into version control for team alignment |
(Note: The filename main.toml is reserved by Mistral Vibe and cannot be used for custom agents.)
Enabling Subagent Capabilities Globally
Before deploying custom subagents, ensure that delegation is enabled in your main configuration file (~/.vibe/config.toml or ./.vibe/config.toml):
# ~/.vibe/config.toml
# Enable dynamic delegation to subagents
enable_subagents = true
# Maximum lifecycle count of subagents spawned per session
max_subagents = 32
# Maximum concurrent subagents executing parallel background tasks
max_concurrent_subagents = 4
Setting max_concurrent_subagents prevents runaway parallel subagent execution from exhausting your API rate limits or local CPU compute when running local models.
2. Defining Bounded Subagents in .vibe/agents/
To enforce strict task isolation, you must configure specialized subagents whose toolsets, system prompts, and execution permissions are limited to their specific role.
Archetype A: The Read-Only Code Explorer (code-explorer.toml)
The code explorer is responsible for surveying repository structure, locating interface boundaries, tracing dependencies, and searching for symbols. Because exploration requires reading many files and scanning noisy directories, keeping this output quarantined outside the main context window is essential.
Create ./.vibe/agents/code-explorer.toml:
agent_type = "subagent"
display_name = "Code Explorer"
description = "Specialized read-only subagent for discovering repository structure, searching symbols, and analyzing dependency graphs. Delegate codebase queries here to prevent primary context pollution."
safety = "safe"
# Direct model selection: Use a high-speed or lightweight model alias for reconnaissance
active_model = "mistral-medium-3.5"
# Hard-lock write operations and destructive shell access
disabled_tools = ["write_file", "edit", "search_replace", "bash"]
# Permitted read-only inspection tools
[tools.read_file]
permission = "always"
[tools.grep]
permission = "always"
[tools.glob]
permission = "always"
[tools.list_dir]
permission = "always"
instructions = """
You are a specialized read-only codebase exploration subagent.
Your goal is to inspect the codebase, trace symbols, locate relevant files, and analyze dependencies.
CRITICAL OPERATING RULES:
1. Never propose direct file edits or execute shell commands.
2. Return strictly structured, concise markdown summaries.
3. Include file paths and line number anchors, but do NOT dump entire file bodies back to the caller.
4. Summarize interface definitions, function signatures, and data flows directly.
"""
Why This Works:
agent_type = "subagent": Ensures this agent never appears in the human interactive agent dropdown.description: This string is the semantic routing key. The primary orchestrator reads this metadata to determine whether an incoming user request warrants delegating tocode-explorer.disabled_tools: Guarantees that even if the model hallucinates a file modification, the Vibe CLI runtime blocks the tool call before execution.
Archetype B: The Sandboxed Test Generation & Verification Worker (test-runner.toml)
Running test suites produces verbose stack traces, failure logs, and test matrix outputs. Furthermore, granting an AI agent unchecked terminal permissions to run shell commands poses security risks. The test-runner subagent isolates test authoring, test execution, and log distillation.
Create ./.vibe/agents/test-runner.toml:
agent_type = "subagent"
display_name = "Test Runner & Generator"
description = "Specialized subagent for generating unit tests, executing local test suites, and digesting failure traces. Delegate all test validation here."
safety = "smart"
# Use reasoning-dense model for debugging failure traces
active_model = "devstral2-local"
# Restrict file modifications exclusively to test directories
[tools.write_file]
permission = "always"
[tools.edit]
permission = "always"
# Fine-grained shell permission boundaries
[tools.bash]
permission = "ask"
allowlist = [
"pytest tests/",
"pnpm test",
"cargo test --package",
"npm run test:unit"
]
denylist = [
"rm -rf",
"git push",
"git commit",
"curl",
"wget"
]
instructions = """
You are a test engineer subagent. Your job is to create or update unit tests, execute them against local changes, and interpret the test results.
OUTPUT SPECIFICATION:
- When tests pass, return a concise success receipt: the number of passed tests and the modified test files.
- When tests fail, analyze the raw stack trace, summarize the root-cause failure, and provide a 3-bullet remediation recommendation for the main agent.
- Do NOT output thousands of raw terminal log lines. Synthesize the results into actionable summaries.
"""
Why This Works:
- Allowlist & Denylist: The subagent can run standard verification commands (
pnpm test,pytest tests/) without halting for manual user confirmation every time, while destructive operations (rm -rf, network egress viacurl) remain strictly denied. - Context Firebreak: Hundreds of lines of failed assertion dumps are absorbed and resolved within the subagent's local loop. Only the diagnostic summary re-enters the primary conversation.
3. Delegation Mechanics: How the Main Agent Orchestrates Work
Once your subagents are configured in ./.vibe/agents/, you do not need to manually juggle terminal sessions. Mistral Vibe's orchestrator leverages tool delegation automatically.
Configuring Project Delegation Guidelines (AGENTS.md)
To ensure the primary agent aggressively delegates exploration and testing tasks instead of trying to do everything itself, codify delegation rules in your project's root AGENTS.md:
# Repository Agent Guidelines
## Multi-Agent Delegation Rules
When handling tasks that require broad codebase scanning or test verification:
1. DELEGATE CODE RECONNAISSANCE: Invoke the `code-explorer` subagent to locate files, inspect APIs, and trace dependencies. Do not run mass grep searches or view multiple whole files in the primary context.
2. IMPLEMENT CHANGES: Synthesize the plan in the main session and perform modifications to business logic directly using `accept-edits`.
3. DELEGATE VERIFICATION: Invoke the `test-runner` subagent to write corresponding unit tests and run verification suites. Review its distilled test report before declaring the task complete.
When Mistral Vibe initializes, it reads AGENTS.md and binds these workflow constraints into the primary system prompt.
End-to-End Execution Flow
Here is how a complex refactoring task unfolds across the delegation pipeline:
[ Developer Terminal ]
|
| "Refactor the Auth token verification to support RS256 in auth-service"
v
+-----------------------------------------------------------------------------+
| Primary Agent Session (accept-edits) |
| Context: High-level task, architectural plan, clean terminal history |
+-----------------------------------------------------------------------------+
|
|--- 1. Delegate Exploration ---> [ Subagent: code-explorer ]
| | Context: Isolated scratchpad
| | Action: Greps 45 files, reads configs
| | Emits: Only 12-line structural summary
|<-- 2. Return Summary Interface -+
|
|--- 3. Direct Execution: Updates src/auth/verifier.ts
|
|--- 4. Delegate Validation ----> [ Subagent: test-runner ]
| | Context: Isolated test sandbox
| | Action: Runs pytest, absorbs 200-line
| | stack trace, fixes assertion
| | Emits: 5-line Pass/Fail verification
|<-- 5. Return Clean Report ------+
v
[ Final Delivery: Pristine Context, Zero Regression, Verifiable Tests ]
4. Comparing Approaches: Monolithic Agent vs. Subagent Delegation
| Dimension | Monolithic Agent (Single Session) | Subagent Delegation Pipeline |
|---|---|---|
| Context Window Longevity | Quickly saturated after 2-3 deep searches and test runs | Stays clean; background noise remains isolated in scratchpads |
| Token Efficiency | High cumulative waste (raw logs repeated on every turn) | Minimal; pay once for subagent output, main context retains summaries |
| Security & Tool Safety | All-or-nothing (full shell access granted to one agent) | Granular least-privilege (read-only for search; allowlisted bash for tests) |
| Reasoning Precision | Degrades over multi-turn tasks ("lost in the middle" effect) | Remains focused on top-level architectural changes |
| Latency Profile | Slightly faster on trivial 1-file edits | 1-2s orchestration dispatch overhead; dramatically faster on complex tasks |
5. 365Finds Institutional Evaluation & Best Practices
At 365Finds, we evaluate developer tooling through an empirical lens of reliability, security boundaries, and token economics. Based on our testing of Mistral Vibe CLI in multi-tiered enterprise codebases, we highlight three core rules:
1. The Primacy of the description Field
The orchestrating model does not inspect the full system prompt of a subagent when deciding whether to invoke it; it relies almost entirely on the description field. If your description is generic (e.g., description = "A helper subagent"), the main model will bypass it. Always write descriptions that specify:
- What the subagent does (
"Specialized read-only subagent for discovering repository structure...") - What tasks must be routed to it (
"Delegate all codebase search and symbol tracing here") - Negative scope boundaries (
"Never used for code modification")
2. Hard Tool Disabling Over System Prompt Pleading
Never rely on prompt phrasing like "Please do not edit files" to protect your codebase during reconnaissance. Large language models under ambiguous context can hallucinate write operations. Hard-disable the tools at the TOML level:
disabled_tools = ["write_file", "edit", "search_replace", "bash"]
This guarantees deterministic execution safety regardless of model temperature or unexpected input.
3. Asymmetric Model Allocation
Subagents do not have to use the same LLM as the main session. For broad codebase indexing and grepping, assign a fast, cost-effective model alias (such as mistral-medium-3.5 or an efficient local model via active_model) to the code-explorer. Reserve your frontier model (mistral-large or your primary engineering configuration) for the main orchestrator where architectural reasoning and diff generation take place. This hybrid allocation cuts token costs by up to 60% while speeding up exploration sweeps.
Summary
Configuring subagents in Mistral Vibe transforms terminal coding from a fragile, context-heavy guessing game into a disciplined multi-agent workflow. By organizing dedicated TOML definitions in .vibe/agents/, establishing strict tool permissions, and configuring clean delegation handoffs in AGENTS.md, developers keep the main conversation focused, secure, and resilient against codebase complexity.