Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
staleIssue is inactiveIssue is inactive
Description
Summary
Add support for custom agent definitions in the .claude/agents/ directory, allowing users to define reusable subagents that can be invoked via the Task tool.
Problem
Currently, the Task tool only supports built-in subagent types:
Bashgeneral-purposeExplorePlanclaude-code-guidestatusline-setup
When attempting to use a custom agent defined in .claude/agents/:
Task(
subagent_type: "logic-designer", # Custom agent name
prompt: "..."
)The error returned is:
Agent type 'logic-designer' not found. Available agents: Bash, general-purpose, statusline-setup, Explore, Plan, claude-code-guide
Current State
Users can create agent definition files in .claude/agents/ with proper frontmatter:
---
name: logic-designer
description: Design evaluation logic using P+Q+P framework
allowed-tools: Read, Glob, Grep, AskUserQuestion
---
# Agent Instructions
...However, these custom agents are not recognized by the Task tool.
Proposed Solution
- Scan
.claude/agents/directory on startup for*.mdfiles - Parse frontmatter to extract:
name- Agent identifier forsubagent_typedescription- Shown in agent listingsallowed-tools- Restrict tool access for the agent
- Register custom agents alongside built-in agents
- Inject agent instructions as system context when the agent is spawned
Expected Behavior
# Should work after implementation
Task(
subagent_type: "logic-designer", # Matches 'name' in frontmatter
prompt: "Design a calculator parser"
)The agent would:
- Have access only to tools specified in
allowed-tools - Receive the markdown content as its system instructions
- Be listed in available agents
Use Cases
- Domain-specific agents - Create specialized agents for specific frameworks/languages
- Team standardization - Share agent definitions across projects
- Workflow automation - Define agents for common multi-step tasks
- P+Q+P Framework agents - Agents that follow specific reasoning patterns
Workaround
Currently using general-purpose agent with full instructions injected into the prompt, but this:
- Doesn't respect
allowed-toolsrestrictions - Requires copying full agent content each time
- Loses the reusability benefit
Environment
- Claude Code CLI
- Custom agents in
.claude/agents/*.md
Related
This would complement the existing .claude/skills/ functionality, providing a complete extensibility model:
- Skills - For simple, template-based operations
- Agents - For complex, reasoning-heavy tasks requiring multiple decisions
Reacted by Jonah Schulte
Metadata
Metadata
Assignees
Labels
staleIssue is inactiveIssue is inactive
Activity
jschulte commentedon Jan 30, 2026
Real-World Use Case: BMAD Method Multi-Agent Orchestration
I'm a heavy user of BMAD-METHOD, an open-source framework for AI-assisted software development that uses specialized agent personas for different workflow phases. This feature would be transformational for BMAD users.
Current Pain Point
BMAD defines 10+ specialized agents with distinct personas, expertise, and communication styles:
These agents are registered as Skills via
.claude/commands/bmad_*.mdlaunchers and work perfectly in the main conversation. However, our multi-agent workflows need to spawn these as background Task agents for parallel execution.What's Blocked
Example workflow (
story-pipeline):Workaround required:
Using
general-purposemeans:Concrete Impact
analystmarket research +architecttechnical research simultaneously with specialized personasteaagent's testing expertise isn't available in background validation tasksProposed Solution Alignment
Your proposed
.claude/agents/directory approach would solve this perfectly. Our agents are already defined in a compatible format:If Task tool could discover and spawn these as
subagent_type: "dev", it would:Supporting Evidence
We just hit this exact error today:
The agent tried to spawn a BMAD agent as a Task subagent, which is the intuitive behavior users expect.
Would love to help test this feature if there's a beta or experimental flag. Happy to provide additional use cases from the BMAD community.
github-actions commentedon Feb 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 7, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.