Use sub-agent tools to extend agent capabilities dynamically
Sub-agents are specialized agent configurations that can be added as tools to your main agent. They allow you to extend agent capabilities dynamically without modifying the core configuration, enabling modular and reusable agent architectures.
Sub-agents are essentially other agent configurations that get loaded as tools. When your main agent needs specialized capabilities, it can invoke a sub-agent tool, which runs its own agent instance with its own configuration, tools, and system prompt.
Sub-agents are an experimental feature. Enable them by setting experimentalFeatures.subAgents: true in your agent configuration.
Add sub-agents to any CLI execution using the --with-subagent flag:
Copy
# Add a single sub-agentqckfx --with-subagent browser "Research the latest React patterns"# Add multiple sub-agentsqckfx --with-subagent browser database "Analyze our data architecture"# Combine with agent configqckfx -a my-agent --with-subagent browser "Enhanced analysis with web research"
Sub-agents use the same configuration schema as regular agents:
Copy
{ "environment": "local", "defaultModel": "claude-sonnet-4", "systemPrompt": "You are a specialized web research assistant...", "tools": ["bash", "file_read", "file_write"], "logLevel": "info"}
{ "environment": "local", "defaultModel": "claude-sonnet-4", "systemPrompt": "You are a web research specialist. When given a research query, you help gather information from the web, analyze trends, and provide comprehensive insights. Focus on finding authoritative sources and current information.", "tools": ["bash", "file_read", "file_write", "grep"], "logLevel": "info"}
{ "environment": "local", "defaultModel": "claude-sonnet-4", "systemPrompt": "You are a database architecture specialist. You help analyze database schemas, optimize queries, design data models, and troubleshoot database performance issues. You understand SQL, NoSQL, and various database systems.", "tools": ["bash", "file_read", "grep", "file_write"], "logLevel": "debug"}
// If you add --with-subagent browser database// Your agent will have these additional tools available:{ name: "browser", description: "Sub-agent defined in .qckfx/sub-agents/browser.json", // ... tool implementation}{ name: "database", description: "Sub-agent defined in .qckfx/sub-agents/database.json", // ... tool implementation}
Structure your sub-agents around specific capabilities:
Copy
.qckfx/sub-agents/├── browser.json # Web research and browsing├── database.json # Database analysis and design├── security.json # Security analysis and auditing├── documentation.json # Documentation generation└── testing.json # Test generation and analysis
{ "systemPrompt": "You are a security auditing specialist. Focus on identifying vulnerabilities, analyzing security patterns, and recommending security best practices. Always consider OWASP guidelines and current threat landscapes."}
{ "environment": "local", "defaultModel": "claude-sonnet-4", "systemPrompt": "You are a research assistant specializing in gathering and analyzing information. Provide comprehensive, well-sourced insights on any topic.", "tools": ["bash", "file_read", "file_write", "grep"]}
{ "environment": "local", "defaultModel": "claude-sonnet-4", "systemPrompt": "You are a senior code reviewer. Analyze code for quality, performance, security, and maintainability. Provide constructive feedback and suggestions.", "tools": ["file_read", "grep", "bash"]}