Custom Sub-agent Registration Failure in Claude Code
Bug Description
Bug Report: Claude Code Sub-agent Not Recognized Despite Proper Configuration
Environment:
- Claude Code Version: 1.0.70 (outdated - latest is 1.0.69)
- Platform: macOS (Darwin 24.5.0)
- Directory: /Users/greg/codebase/stayinpattaya
Issue Description:
Custom sub-agent production-server is not being recognized by the Claude Code system despite being properly configured.
Expected Behavior:
The production-server agent should be available when using the Task tool with subagent_type: "production-server"
Actual Behavior:
System returns error: "Agent type 'production-server' not found. Available agents: general-purpose, database-guardian, aws-infrastructure-specialist, docker-ops, code-quality-enforcer, security-scanner, tracking-specialist, api-tester,
git-task-recorder"
Configuration Details:
- Agent file location: /Users/greg/codebase/stayinpattaya/.claude/agents/production-server.md
- File format follows correct YAML frontmatter structure:
---
name: production-server
description: EC2 server management specialist for StayInPattaya production server...
tools: Bash, Read, Write, Grep, Glob
---
Steps to Reproduce:
- Created agent file in .claude/agents/production-server.md
- Used correct YAML frontmatter format matching other working agents
- Attempted to call agent via Task tool
- System does not recognize the agent
Additional Context:
- Other custom agents in the same directory are working (database-guardian, aws-infrastructure-specialist, etc.)
- File permissions and format appear correct
- May be related to CLI version discrepancy (using 1.0.70 when latest is 1.0.69)
- No obvious documentation on agent registration or reload procedures
Possible Root Causes:
- CLI version incompatibility
- Agent registration/loading mechanism not detecting new files
- Missing agent reload/refresh capability
- Undocumented configuration requirements
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.69
- Feedback ID:
Errors
[{"error":"Error: Agent file /Users/greg/codebase/stayinpattaya/.claude/agents/production-RDS-database-specialist.md is missing required 'name' in frontmatter\n at mH8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1971:1372)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1971:678\n at Array.map (<anonymous>)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1971:621\n at async file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1971:469\n at async HlB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2809:4)\n at async Object.prompt (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2879:1218)\n at async JlB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2776:191)\n at async Promise.all (index 0)\n at async Promise.all (index 0)","timestamp":"2025-08-06T12:21:29.260Z"},{"error":"Error: Request was aborted.\n at BS.makeRequest (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1279:3840)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runNextTicks (node:internal/process/task_queues:69:3)\n at process.processTimers (node:internal/timers:540:9)","timestamp":"2025-08-06T12:21:39.937Z"},{"error":"Error: Request was aborted.\n at BS.makeRequest (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1279:3840)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-08-06T12:21:59.887Z"},{"error":"Error: Agent type 'ec2' not found. Available agents: general-purpose, database-guardian, aws-infrastructure-specialist, docker-ops, code-quality-enforcer, security-scanner, tracking-specialist, api-tester, git-task-recorder, production-server\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2879:2015)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Wj8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2786:10455)\n at async Yu1 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2786:6732)\n at async rjB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1917:1384)\n at async Ij8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2786:5843)\n at async Gj8 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2786:5328)\n at async pS (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2786:3792)\n at async CA (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3264:2691)","timestamp":"2025-08-06T12:22:26.655Z"},{"error":"Error: Request was aborted.\n at rZ1._createMess
Note: Error logs were truncated.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗