Supercharge Claude Code : Custom Commands + Sub Agents - Step by Step Guide
Learn how Claude Code Sub-Agents with Custom Commands, empower you to build specialized AI team members for seamless, multi-step automation. Build your design team, marketing team, dev team in English
If you've been following along on my journey with Claude Code, you know I've been pretty excited about the waves it's made in the tech ecosystem. Since its release in February 2025, Claude Code has transformed how we work with code in plain English. But the latest addition—Claude Code Sub‑Agents—takes it to a whole new level. Creating Agents has never been so easy before … you just need to know what you want and write it in plain english.
What Are Claude Code Sub-Agents?
Sub‑agents are specialized AI assistants within Claude Code designed to handle specific task types. Each sub‑agent operates with its own context window, a custom system prompt, and tailored tool permissions, allowing Claude Code to delegate tasks automatically or let you invoke them explicitly.
official release document: Claude Code Sub agents
No Time to Read? Here’s the Scoop
Build specialised AI agents for specific roles like design, development, and auditing
Assign each agent the tools they need to work autonomously
Use custom commands to chain multiple agents for complex, multi-step workflows
Ideal for teams and solo builders looking to automate repetitive or multi-stage tasks
Key Benefits of Sub-Agents
Context Preservation
Each sub‑agent uses a separate context, preventing clutter in the main thread and helping maintain focus on high‑level objectives.
Specialized Expertise
You can define sub‑agents with detailed prompts and tool access tailored to their responsibilities—like a "code‑reviewer" or "performance‑optimizer." This results in more accurate and reliable results for specific domains.
Reusability & Sharing
Once defined, a sub‑agent can be reused across projects or shared with your team—enabling consistent, automated workflows for common tasks.
Fine‑Grained Permissions
You can restrict how much each sub‑agent can do: grant only Read/Edit, or even shell access as needed—enhancing security and control.
How to Set Up Sub-Agents in Claude Code
First update to the latest version of Claude Code
If you haven't yet installed Claude Code, use the command below to install it and follow the steps. You need to be either on a Pro Plan or a Max Plan to use it.
npm install -g @anthropic-ai/claude-code
If you are already using it, then update your Claude Code with the command below
claude update
Step-by-Step Guide to Creating Sub-Agents
Launch Claude Code and type
/agents
to open the Sub Agents menu.Click "Create New Agent."
Specify the scope: project-specific or global (user-level).
Choose your creation method: let Claude generate it automatically (recommended) or configure manually.
Define the agent's role. For example: "You're an expert software engineer who reviews my code for best practices."
Assign appropriate tools to your agent—options include MCP Tools, Edit tools, read-only tools, etc., based on your needs.
Select a background color to easily identify which agent is active.
Your new agent is ready to use.
Why Sub-Agents Are Revolutionary
The beauty of these Sub-Agents lies in how effortlessly they allow you to create specialized AI team members tailored to your unique workflows. Want a UI developer agent? A content auditor? A marketing assistant? You name it, you can create it.
Supercharging Workflows: Custom Commands + Sub-Agents
Let's assume we have created 2 agents:
front-end-developer
A senior front-end developer who can replicate any design given to it. Tool Access - All
ui-auditor
A senior UI Auditor who validates if the design built by the Front End Developer matches the specifications. Tools to give access - Playwright MCP, Edit, Read Tools
Claude Code supports custom slash commands that you can create to execute specific prompts or tasks quickly. Custom slash commands allow you to define frequently-used prompts as Markdown files that Claude Code can execute. Commands are organized by scope (project-specific or personal) and support namespacing through directory structures.
To know more about Custom Commands, read my blog - https://www.thetoolnerd.com/p/i-tested-claude-code-for-a-week?r=df3b7
In a Custom Command, you can define your custom workflow where you can assign different sub-agents.
Practical Example: Automated UI Development Workflow
Create Custom Command:
Go to ./claude in the project folder
Create a folder “commands”
Create a markdown file with the name of the command — “create-ui.md”
Example Command- “create-ui”
Create the UI based on the design - #$ARGUMENTS following these steps:
Analyze the design and extract key information including typography, fonts, colors, and layout
Create a user story for the page design
Assign the task to front-end-developer to build the design
When the design is completed, assign the UI audit to ui-auditor
ui-auditor will review the UI and identify any discrepancies compared to the original design. They'll create a list of needed changes and assign them back to front-end-developer
Repeat this process until the design is 95% accurate or for a maximum of 3 iterations
Collect feedback from the user
Based on user feedback, implement changes by following the same cycle
Once the user approves, close the tasks and create a summary
Stage the changes done.
Now run this in your terminal
claude
/create-ui <image.png>; #Give the image you want to replicate
Building Your Dream Team of AI Agents
The process is as intuitive as it gets. With a simple command, you can create a new agent, define its role—whether it's for design, development, auditing, marketing or anything else—and assign the tools it needs. It's like giving each agent a job description and the exact toolkit they need to excel.
Here's a curated list of URLs for GitHub repositories and collections focused on Claude Code subagents. These were compiled from recent web searches and X posts (as of July 30, 2025), highlighting community-shared resources for specialized AI subagents. I've included brief descriptions based on the sources, prioritizing unique and relevant ones.
GitHub Respositories
davepoon/claude-code-subagents-collection: A collection of 36 specialized subagents for tasks like backend architecture and React development. URL: https://github.com/davepoon/claude-code-subagents-collection
hesreallyhim/awesome-claude-code-agents: A curated list of custom subagents with community contributions for efficient workflows. URL: https://github.com/hesreallyhim/awesome-claude-code-agents
iannuttall/claude-agents: Custom subagents ready to copy into your project's .claude/agents/ directory. URL: https://github.com/iannuttall/claude-agents
wshobson/agents: 44 production-ready subagents for domains like RESTful API design and GraphQL schemas. URL: https://github.com/wshobson/agents
zhsama/claude-sub-agent: A workflow system using subagents for development phases like requirements analysis and validation. URL: https://github.com/zhsama/claude-sub-agent
lst97/claude-code-sub-agents: 35 specialized subagents to enhance workflows with domain-specific expertise. URL: https://github.com/lst97/claude-code-sub-agents
KJKMALLA/claude-code-subagents: Curated production-ready subagents for automation, code review, and debugging. URL: https://github.com/KJKMALLA/claude-code-subagents
webdevtodayjason/sub-agents: A CLI manager for subagents, including specialized AI assistants for development tasks. URL: https://github.com/webdevtodayjason/sub-agents
vijaythecoder/awesome-claude-agents: An awesome list of Claude subagents with community-sourced examples. URL: https://github.com/vijaythecoder/awesome-claude-agents
vanzan01/claude-code-sub-agent-collective: A collective of subagents for various coding and automation needs. URL: https://github.com/vanzan01/claude-code-sub-agent-collective
dl-ezo/claude-code-sub-agents: Collection focused on task-specific subagents for Claude Code. URL: https://github.com/dl-ezo/claude-code-sub-agents
Non GitHub Resources
Looking Ahead: The Future of AI Collaboration
I'm thrilled about the endless possibilities that Claude Code Sub-Agents and custom commands bring to the table.