Sub-agents is a command line interface (CLI) tool designed to enhance Anthropic's Claude Code development environment. It allows developers to easily add, manage, and create AI "sub-agents" dedicated to specific programming tasks. These sub-agents are pre-configured AI assistants that are each specialized in one area, such as code review, testing, debugging, documentation, or API development. The core concept of the tool is "expert blending," where multiple highly specialized agents are used to work together rather than relying on one general-purpose AI to handle everything. The benefit is that each agent operates in an isolated context, with its own system prompts and specialized toolset, which improves task accuracy and efficiency, and reduces the "illusion" that a general-purpose AI can have when dealing with complex tasks. Sub-agents are designed to simplify and automate development workflows by providing out-of-the-box specialized agents and the flexibility to create custom agents.
Function List
- Specialized AI Agents: Provides a range of pre-built agents, each of which is an expert in a particular development area.
- Zero-configuration use: Pre-built agents work out-of-the-box with no additional configuration required.
- Height can be customized: Allows developers to create customized agents that meet their specific workflow needs.
- Intelligent Context Management: Each agent runs in an isolated context, avoiding interference between different tasks.
- Integration with Context-Forge: the ability to seamlessly integrate with
context-forge
The project and its PRP (Project Relationship Planning) document are used in conjunction. - command-line interface: Installation, initialization, list viewing, enabling/disabling and removal of agents can be done with simple commands.
- Independent proxy enforcement: Support for running agents independently of the Claude Code environment, facilitating automation and scripting.
- Web Dashboard: Provides a web interface for real-time monitoring and management of agent status, task history and performance metrics.
- hook system: Allows the definition of actions that are automatically triggered upon specific events (e.g., document editing, task completion) for workflow automation.
- Two installation ranges: Supports user-wide (available for all projects) and project-wide (available for the current project only) agent installations.
Using Help
Sub-agents is a powerful command line tool designed to enhance Claude Code with a series of specialized AI sub-agents. The following will detail how to install and use this tool, and how to operate its main features.
Installation process
You can install Sub-agents in several ways, the most recommended way is to use NPM.
1. NPM Installation (Recommended)
Open your terminal and run the following command for global installation:
npm install -g @webdevtoday/claude-agents
2. Yarn Installation
If you prefer to use Yarn, you can use the following command:
yarn global add @webdevtoday/claude-agents```
**3. 从源码安装**
你也可以直接从GitHub克隆源码进行安装,这适用于希望进行二次开发的用户:
```bash
git clone https://github.com/webdevtodayjason/sub-agents.git
cd sub-agents
npm install
npm link
Upon completion of the installationclaude-agents
command will be available in your terminal.
Getting Started
After a successful installation, you can access theinit
Command Quick Start.
For new projects:
In your project root directory, run the following command to initialize all available agents:
claude-agents init
You can then use thelist
command to see all available proxies:
claude-agents list
For projects that already use Context-Forge:
If your project is already using thecontext-forge
You can use a specialinit
command to ensure compatibility:
claude-agents init --respect-context-forge
This command intelligently places the proxy command in the.claude/commands/agents/
directory to avoid conflicts with your existing commands and will safely update theCLAUDE.md
Documentation.
Main Functions
1. Agent management
Sub-agents provides a complete set of commands to manage the agent lifecycle.
- Installation Agent: You can interactively install one or more agents.
claude-agents install
Or install all available agents at once:
claude-agents install --all
- View Agent: Lists all installed agents.
claude-agents list --installed
- Enable/Disable Proxy: You can enable or disable an agent at any time.
claude-agents disable test-runner claude-agents enable test-runner
- Remove Proxy: Remove an agent that is no longer needed.
claude-agents remove debugger ``` 或者进行批量卸载并清理相关文件: ```bash claude-agents uninstall --all --clean
2. Use of proxies in Claude Code
You can invoke proxies in Claude Code in two main ways:
- Slash Commands: Each agent is associated with a slash command for quick invocation. For example, to invoke the code review agent, simply type:
/review ``` 对于需要参数的代理,可以在命令后附带参数:
/debug login issue
- Task Tool: You can also use
Task
tools to execute more complex instructions.Task("project-planner: analyze all PRPs and create sprint plan")
3. Stand-alone operating agents
This is a very powerful feature that allows you to use agents directly in automation scripts or workflows without having to open Claude Code.
# 使用内联任务运行
claude-agents run marketing-writer --task "Write launch announcement for v2.0"
# 从文件读取任务
claude-agents run api-developer --file api-spec.md
# 以交互模式运行
claude-agents run tdd-specialist --interactive```
**4. 创建自定义代理**
如果预设的代理不能满足你的需求,你可以轻松创建自己的代理。
运行以下命令,工具会通过交互式问答引导你完成创建过程:
```bash
claude-agents create
You will be asked to define the name and description of the agent as well as the required tools. This makes it very easy to create highly customized AI assistants.
5. Using the Web Dashboard
To manage and monitor your agents more intuitively, Sub-agents provides a web dashboard.
Activate the dashboard:
claude-agents dashboard
You can also specify the port number:
claude-agents dashboard --port 8080
In the dashboard, you can see the real-time status, task execution history, and performance metrics of all your agents and quickly perform actions.
With the above steps, you will be able to skillfully use Sub-agents to boost your development productivity. This tool dramatically improves the quality and speed of code generation, review, and testing by breaking down large development tasks to AI experts in different areas.
application scenario
- Automated Code Review
Developers can call thecode-reviewer
Agent that performs a comprehensive quality, security, and performance analysis of newly submitted code. The agent automatically checks that the code follows best practices and suggests specific optimizations, thus reducing the burden of manual review. - Assisted debugging and bug fixing
When a complex bug is encountered, you can start thedebugger
Agent. Provide it with error messages or stack traces, and the agent will help analyze the root cause of the problem and try to provide fixes to speed up the resolution of the problem. - Rapid Prototyping
In the early stages of a project, multiple agents can be used in combination to quickly prototype an application. For example, using theproject-planner
planning function modules.api-developer
generating the back-end interface.frontend-developer
Building front-end interfaces dramatically reduces the time it takes to go from concept to prototype. - Generate and update technical documentation
Writing and maintaining documentation can be a time-consuming task.doc-writer
cap (a poem)api-documenter
The agent can automatically generate and update README files, API documentation (e.g., OpenAPI specifications), etc., based on code and comments, ensuring that the documentation is synchronized with the code. - Test Driven Development (TDD)
tdd-specialist
Agents can help developers practice test-driven development. Before writing functional code, you can let the agent create test cases based on the requirements, and then the developer can write the implementation code based on these tests.
QA
- What is the difference between Sub-agents and using Claude Code directly?
Sub-agents do not replace Claude Code, they enhance it. It solves the problem of a single general-purpose AI being unable to excel in all areas by introducing the concept of "specialized sub-agents". Each sub-agent focuses on a specific task, such as code review or debugging, in an isolated environment, which makes results more accurate and avoids contextual confusion between different tasks. - Do I have to pay for each agent individually?
Sub-agents itself is a free open source tool. However, it relies on Claude Code to perform its tasks, so you still need to have Anthropic's Claude Code access and pay accordingly based on its usage. Using multiple sub-agents may increase Token consumption. - Is it complicated to create custom proxies?
Uncomplicated. The tool provides an interactive command line toolclaude-agents create
, which will guide you through the creation process, including defining the name of the agent, its functional description, and the required tools. All you need to do is describe the agent's responsibilities in natural language, without having to write complex code. - Can these agents work together?
Yes. The tool is designed with the idea of having multiple agents working together. With the Hooks System, you can set up automation rules that allow one agent to trigger another agent when it completes a task. For example, when code editing is complete, you can automatically trigger thetest-runner
agent to run the test. - If I install an agent globally, will it affect all my projects?
Yes. Agents can be installed in two different scopes: the user scope (~/.claude/agents/
) and project scope (.claude/agents/
). Agents installed in the user scope are available in all your projects. If you only want the agent to serve specific projects, you can install it using the--project
flag to install it to the project scope.