Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
Subagents are specialized AI agents in Qoder CLI that handle specific tasks. Each subagent has its own context window, system prompt, and tool permissions, enabling better handling of complex tasks.
Quick Start
Create your first Subagent in 3 steps:
- Open the agents interface: Run
/agents in TUI
- Create a Subagent: Press
Tab to switch to User or Project tab, select “Create new agent…”
- Try it: Enter a description, and Qoder CLI auto-generates the configuration
# Use the newly created subagent
Use the api-reviewer subagent to review this API code
Key Benefits
| Benefit | Description |
|---|
| Context Isolation | Each Subagent runs in an independent context, preventing pollution of the main conversation and keeping it focused on high-level objectives |
| Specialized Expertise | Can be configured with detailed instructions for specific domains, improving task success rates |
| Reusability | Can be used across projects and shared with teams for consistent workflows |
| Flexible Permissions | Each Subagent can have different tool access levels |
Built-in Subagents
Run /agents in TUI, press Tab to switch to the BuiltIn tab.
Tip: The User tab shows user-level Subagent configurations, the Project tab shows project-level configurations.
Built-in Subagents and their descriptions:
| Name | Description |
|---|
code-reviewer | Performs local code review tasks |
design-agent | Creates software designs and generates design documents based on user requirements |
general-purpose | Executes various general tasks, suitable for diverse scenarios |
task-executor | Develops software based on design documents |
Using Subagents
Subagents can be invoked through natural language in both TUI and Headless modes.
Explicit Invocation
Specify a subagent by name in your request:
# TUI mode
Use the code-reviewer subagent to review this code
# Headless mode
qodercli -p "Use the code-reviewer subagent to review this code"
Implicit Invocation
Describe your task and let Qoder CLI select the appropriate Subagent:
# TUI mode
Review this code
# Headless mode
qodercli -p "Review this code"
Chained Invocation
Describe the execution order to orchestrate multiple Subagents:
# TUI mode
First use general-purpose subagent to complete the design, then use code-reviewer subagent to review the generated code
# Headless mode
qodercli -p "First use general-purpose subagent to complete the design, then use code-reviewer subagent to review the generated code" --max-turns 10
Tip: In Headless mode, use --max-turns to limit Subagent execution turns.
Creating Subagents
Qoder CLI provides two ways to create Subagents: AI-assisted generation (Recommended) and manual configuration.
Method 1: AI-Assisted Generation (Recommended)
The simplest way to create a subagent. Just describe your needs in natural language and Qoder CLI generates the complete configuration.
Steps:
- Run
/agents in TUI to open the agents panel
- Press
Tab to switch to User or Project tab
- Select “Create new agent…” and press
Enter
- Enter the Subagent description and press
Enter to confirm
> /agents
------------------------------------------------------------------------------------------
Agents: User [Project] BuiltIn
-> Create new agent...
Agent list:
No project agents found.
Press Enter to select - Esc to exit - Tab to cycle tabs - Up/Down to navigate
After entering the description, Qoder CLI generates the configuration:
> /agents
------------------------------------------------------------------------------------------
Agents: User [Project] BuiltIn
Describe the agent:
> Help me review RESTful api design
Press Enter to select - Esc to exit - Tab to cycle tabs - Up/Down to navigate
After generation, find the configuration file in the corresponding directory for fine-tuning:
# Project tab
${project}/.qoder/agents/
# User tab
~/.qoder/agents/
Tip: We recommend starting with an AI-generated Subagent, then iterating to customize it for your specific needs. This approach gives you the best results - a solid foundation that you can customize.
Method 2: Manual Configuration (Advanced)
For complete control over Subagent configuration, manually create a Markdown configuration file.
---
name: api-reviewer
description: Review API designs for RESTful compliance and best practices, including endpoint structures, HTTP methods, status codes, and resource naming. Evaluates REST principles and suggests improvements.
tools: Read,Grep,Glob
---
You are an expert API design reviewer specializing in RESTful architecture principles and best practices. Your role is to evaluate API designs for compliance with REST conventions, scalability, maintainability, and developer experience.
When reviewing APIs, you will focus on:
1. Resource Naming
- Use nouns instead of verbs for resources
- Use plural forms for collections (e.g., /users not /user)
- Use kebab-case or snake_case consistently (prefer kebab-case)
- Avoid CRUD verbs in URLs
2. HTTP Methods Compliance
- GET: Retrieve resources (safe, idempotent)
- POST: Create resources or actions
- PUT: Update entire resources (idempotent)
- PATCH: Partial updates (idempotent)
- DELETE: Remove resources (idempotent)
3. Status Codes
- 200: Successful GET, PUT, PATCH
- 201: Successful POST with resource creation
- 204: Successful DELETE or update with no response body
- 400: Client errors (validation, malformed requests)
- 401/403: Authentication/authorization issues
- 404: Resource not found
- 409: Conflicts (e.g., duplicate resources)
- 500: Server errors
4. URL Structure
- Use hierarchical URLs for relationships (/users/123/orders)
- Keep URLs short but meaningful
- Use query parameters for filtering, sorting, pagination
- Version APIs in URL path (/api/v1/) or headers
5. Response Format
- Consistent JSON structure
- Proper error message formats
- Include HATEOAS links where appropriate
- Standardized timestamp formats
When providing feedback:
1. First identify any RESTful violations or anti-patterns
2. Explain why the current design is problematic
3. Provide specific recommendations for improvement
4. Reference relevant REST constraints or best practices
5. Consider scalability and future extensibility
Be thorough but constructive in your reviews. Focus on technical correctness while considering real-world implementation concerns.
Storage Location:
Save configuration files to the appropriate directory:
# Project-level (current project only, can be version controlled)
${project}/.qoder/agents/<agentName>.md
# User-level (all projects)
~/.qoder/agents/<agentName>.md
Storage Locations and Priority
| Location | Path | Priority | Use Case |
|---|
| Project-level | ${project}/.qoder/agents/<agentName>.md | High | Only affects current project, prompts are project-specific, typically committed to version control |
| User-level | ~/.qoder/agents/<agentName>.md | Low | Affects all projects on the system, prompts are general-purpose |
Note: When Subagent names conflict, project-level Subagents take precedence over user-level Subagents.
Configuration Field Reference
| Field | Required | Description | Example |
|---|
name | Yes | Unique identifier for the Subagent, use lowercase letters and hyphens | api-reviewer |
description | Yes | Natural language description of the Subagent’s purpose. The model selects Subagents based on this content | Review API designs for RESTful compliance |
tools | No | Comma-separated list of tool names. When omitted, inherits all tools from the main Agent. Default is * meaning all tools | Read,Grep,Glob |
Configure which tools a subagent can use by specifying tool names in the tools field.Tools include any built-in tools and MCP tools.
Tool configuration rules:
- Names are separated by commas
- Default is
* meaning all tools configured for the main Agent
- MCP tools are supported and automatically inherited by Subagents
Tip: We recommend granting Subagents only the necessary tools. This improves security and helps Subagents focus on relevant operations.
Testing Task Execution
Test with this example prompt:
@app.route('/api/do_login', methods=['POST'])
def do_login():
# ...
@app.route('/api/do_logout', methods=['GET'])
def do_logout():
# ...
Use api-reviewer to review the API interface design of this Flask application
After the prompt, CLI invokes the api-reviewer Subagent and delegates the API review task.
Best Practices
- Start with AI-Generated Agents: Generate initial subagents with AI, then iterate to match your specific needs
- Design Focused Subagents: Create subagents with single, clear responsibilities rather than trying to do everything
- Write Detailed Prompts: Include specific instructions, examples, and constraints in system prompts
- Limit Tool Access: Only grant tools necessary for the Subagent’s purpose. This improves security and helps the Subagent focus on relevant operations
- Version Control: Check project-level Subagents into version control so your team can benefit from and improve them collaboratively
FAQ
What’s the difference between a Subagent and the main Agent?
Subagents have independent context windows that don’t pollute the main conversation. Each Subagent can have different tool permissions and system prompts, making them focus on specific task types.
How do I view all available Subagents?
Run the /agents command in TUI to view all available Subagents (including built-in, user-level, and project-level).
Can I use multiple Subagents simultaneously?
Yes. Use chained invocation to call multiple Subagents in sequence to complete complex workflows.