Skip to main content
Subagents are specialized AI assistants that Firebender’s agent can delegate tasks to. Each subagent operates in its own context window, handles specific types of work, and returns its result to the parent agent. Use subagents to break down complex tasks, do work in parallel, and preserve context in the main conversation.

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:

Built-in subagents

Firebender includes built-in subagents that handle context-heavy operations automatically.

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.
You do not need to configure the built-in subagents. Firebender uses them automatically when appropriate.

When to use subagents

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 agents array in firebender.json
  • Any agent with callable: true can be invoked as a subagent
  • The older subagents array is still supported for backwards compatibility, but new configurations should use agents

Project vs user scope

Agent files can live anywhere as long as they are listed in the corresponding 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

Important configuration note

Fields like readonly 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
Include phrases like “use proactively” or “always use for” in your description field to encourage delegation for specific situations.

Explicit invocation

You can also ask Firebender to use a specific subagent by name in natural language:
  • Use the verifier subagent to confirm the auth flow is complete
  • Have the debugger subagent investigate this error
  • Run the security-auditor subagent on the payment module

Parallel execution

Launch multiple subagents concurrently for maximum throughput:
  • Review the API changes and update the documentation in parallel
Firebender can issue multiple subagent launches in a single step so those workstreams run simultaneously.

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.
This pattern is useful for:
  • 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
Each handoff should include structured output so the next agent has clear context.

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 description field 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 at agents/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 the Sub-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.

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