Context isolation
Each subagent has its own context window. Long research or exploration tasks do not consume space in your main conversation.
Parallel execution
Launch multiple subagents simultaneously. Work on different parts of your codebase without waiting for sequential completion.
Specialized expertise
Configure subagents with custom prompts, tool access, and models for domain-specific tasks.
Reusability
Define custom subagents and use them across projects.
How subagents work
When Firebender encounters a complex task, it can launch a subagent automatically. The subagent receives a prompt with the necessary context, works autonomously, and returns a final message with its results. Subagents start with a clean context. The parent agent includes relevant information in the prompt since subagents do not have access to prior conversation history.Foreground vs background
Subagents run in one of two modes:| Mode | Behavior | Best for |
|---|---|---|
| Foreground | Blocks until the subagent completes. Returns the result immediately. | Sequential tasks where you need the output. |
| Background | Returns immediately. The subagent works independently. | Long-running tasks or parallel workstreams. |
Built-in subagents
Firebender includes built-in subagents that handle context-heavy operations automatically.| Subagent | Purpose | Why it is a subagent |
|---|---|---|
Explore | Searches and analyzes codebases | Codebase exploration generates large intermediate output that would otherwise bloat the main context. |
general-purpose | Handles complex research and multi-step delegated work | Some tasks benefit from a separate context window even when they are not pure codebase exploration. |
Why these subagents exist
These operations share common traits: they generate noisy intermediate output, benefit from specialized prompts and tools, and can consume significant context. Running them as subagents solves several problems:- Context isolation: intermediate output stays in the subagent. The parent only sees the final summary.
- Model flexibility: subagents can use a different model configuration from the parent.
- Specialized configuration: each subagent has prompts and tool access tuned for its specific task.
- Cost efficiency: isolating token-heavy work in smaller or specialized agents can reduce overall cost.
When to use subagents
| Use subagents when… | Use skills when… |
|---|---|
| You need context isolation for long research tasks | The task is single-purpose and repeatable |
| You want multiple workstreams to run in parallel | You want a quick, reusable action |
| The task requires specialized expertise across many steps | The task completes in one shot |
| You want an independent verification of work | You do not need a separate context window |
If you find yourself creating a subagent for a simple task like generating a changelog or formatting imports, consider using a skill instead.
Quick start
Firebender automatically uses subagents when appropriate. You can also create a custom subagent by selecting the agent builder in the mode dropdown.Custom subagents
Define custom subagents to encode specialized knowledge, enforce team standards, or automate repetitive workflows.Configuration model
In Firebender, agents and subagents use the same configuration system:- All agent files are registered through the
agentsarray infirebender.json - Any agent with
callable: truecan be invoked as a subagent - The older
subagentsarray is still supported for backwards compatibility, but new configurations should useagents
Project vs user scope
| Type | Location | Scope |
|---|---|---|
| Project config | firebender.json | Current project only |
| User config | ~/.firebender/firebender.json | All projects for the current user |
agents array. Relative paths resolve from the project root for project config, or from ~/.firebender/ for user config.
Example firebender.json
File format
Each subagent is a markdown file with YAML frontmatter followed by the prompt:Configuration fields
| Field | Required | Description |
|---|---|---|
name | No | Unique display name. Defaults to the filename if omitted. |
description | No | Explains when the subagent should be used. Firebender reads this to decide delegation. |
tools | No | Comma-separated list of tool groups or MCP tools the subagent can use. If omitted, all tools are available. |
model | No | Model to use: small, medium, large, inherit, default, or a specific model ID. |
color | No | Optional color used when the agent appears as a custom mode. |
icon | No | Optional absolute or resolved icon path. |
callable | No | If true, the agent can be invoked as a subagent. Defaults to false. |
Important configuration note
Fields likereadonly and background are not part of the agent file schema in Firebender. Instead:
- Subagent availability is controlled by
callable: true - Tool restrictions are controlled by
tools - Background execution is chosen at invocation time by the parent agent
Using subagents
Automatic delegation
Firebender proactively delegates tasks based on:- The task complexity and scope
- Custom subagent descriptions in your configuration
- Current context and available tools
Explicit invocation
You can also ask Firebender to use a specific subagent by name in natural language:- Use the
verifiersubagent to confirm the auth flow is complete - Have the
debuggersubagent investigate this error - Run the
security-auditorsubagent on the payment module
Parallel execution
Launch multiple subagents concurrently for maximum throughput:- Review the API changes and update the documentation in parallel
Resuming subagents
Subagents can be resumed to continue previous work. Background subagents preserve state while they run, and the parent agent can continue a prior subagent conversation when needed.Common patterns
Verification agent
A verification agent independently validates whether claimed work was actually completed. This helps catch cases where an implementation is partially done or unverified.- Validating that features work end-to-end before marking work complete
- Catching partially implemented functionality
- Ensuring tests really pass, not just that test files exist
Orchestrator pattern
For complex workflows, a parent agent can coordinate multiple specialist subagents in sequence:- Planner analyzes requirements and creates a technical plan
- Implementer builds the feature based on the plan
- Verifier confirms the implementation matches requirements
Example subagents
Debugger
Test runner
Best practices
- Write focused subagents: each subagent should have a single, clear responsibility. Avoid generic helper agents.
- Invest in descriptions: the
descriptionfield determines when Firebender delegates to your subagent. - Keep prompts concise: long prompts dilute focus. Be specific and direct.
- Add subagents to version control: commit your subagent files so the team benefits.
- Start with Firebender-generated agents: let Firebender draft the initial version, then customize it.
Anti-patterns to avoid
Do not create dozens of generic subagents. A large set of vague agents is hard to maintain and gives Firebender poor delegation signals.- Vague descriptions: “Use for general tasks” gives no useful signal. Be specific.
- Overly long prompts: a giant prompt usually makes the subagent slower and harder to maintain.
- Duplicating commands: if a task is single-purpose and does not need context isolation, use a command or skill instead.
- Too many subagents: start with two or three focused subagents and add more only when you have a clear use case.
Managing subagents
Creating subagents
The easiest way to create a subagent is to ask Firebender to create one for you: Create an agent file atagents/security-reviewer.md, add it to the agents array in firebender.json, and make it callable: true. The security-reviewer subagent should check code for common vulnerabilities like injection, XSS, and hardcoded secrets.
You can also create subagents manually by adding markdown files and registering them in project or user config.
Viewing subagents
Callable agents appear in theSub-agents submenu, and non-callable agents appear as custom modes in the mode picker.
Performance and cost
Subagents have trade-offs. Understanding them helps you decide when to use them.| Benefit | Trade-off |
|---|---|
| Context isolation | Startup overhead because each subagent gathers its own context |
| Parallel execution | Higher token usage when multiple contexts run at once |
| Specialized focus | Extra latency for simple tasks |
Token and cost considerations
- Each subagent consumes tokens independently: running several in parallel increases total usage
- Evaluate the overhead: for quick, simple tasks, the main agent is often faster
- Subagents can be slower: the benefit is context isolation and specialization, not raw speed