Feature Request: Dynamic agent discovery from .claude/agents/ directory

Resolved 💬 2 comments Opened Mar 8, 2026 by JamesTroy Closed Mar 8, 2026

Summary

Agent .md files in ~/.claude/agents/ are not automatically discovered and made available to the Task tool. Only hardcoded agents appear in the available agents list.

Current Behavior

  • Agent files exist at ~/.claude/agents/engineering/mobile-app-builder.md with proper frontmatter
  • The Task tool has a fixed list of available agents
  • Agents like Mobile App Builder are NOT available even though the file exists
  • Agents like BarkPark iOS Lead ARE available (presumably registered elsewhere)

Expected Behavior

The Task tool should dynamically discover and load agents from:

  1. ~/.claude/agents/ (global agents)
  2. <project>/.claude/agents/ (project-specific agents)

Agent File Format

Agents use standard frontmatter:
\\\`yaml
---
name: Mobile App Builder
description: Use when building React Native, iOS, or Android features...
model: sonnet
tools: Read, Write, Edit, Bash, Grep, Glob
permissionMode: acceptEdits
memory: project
skills:

  • self-critique-loop
  • code-review-standards

---
\\\`

Use Case

Users building custom agent ecosystems (like a 250+ agent studio) need dynamic discovery to:

  • Add new agents without modifying Claude Code config
  • Share project-specific agents via .claude/agents/ in repos
  • Iterate on agent prompts without restarting Claude Code

Environment

  • Claude Code version: Latest
  • OS: macOS
  • 251 agent files currently not being discovered

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗