Custom subagent never appears as dispatchable subagent_type despite valid .claude/agents/*.md (works for siblings, same commit)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 22, 2026

Bug: custom subagent never appears as dispatchable subagent_type despite valid .claude/agents/*.md

Summary

A project-level custom subagent defined in .claude/agents/<name>.md never
appears in the Agent tool's dispatchable subagent_type list, even though
every other custom agent defined the same way in the same directory works
fine. Confirmed across multiple full app restarts and two different agent
names.

Repro steps

  1. In a git repo with an existing working custom agent set (this repo has

feature_builder.md, signal_creator.md, strategy_builder.md,
plan_builder.md, spec_builder.md, all functioning), add one more file:
.claude/agents/story_builder.md with valid YAML frontmatter (name,
description, tools) matching the exact same shape as the working
agents (verified byte-for-byte structurally identical: CRLF line endings,
UTF-8 no BOM, single-line description, comma-separated tools: list).

  1. Fully quit and reopen the Claude Code app (not just a new conversation).
  2. Start a new conversation on the branch/worktree containing the file.
  3. Check the "Available agent types" system reminder / attempt

Agent({subagent_type: "story_builder", ...}).

  1. Result: story_builder is absent from the list; dispatch fails with

"Agent type not found". All sibling agents from the same directory and
same commit load fine.

What was ruled out

  • Mid-session file cache: ruled out — deleted and recreated the file

byte-identical mid-conversation; still failed identically (a mid-session
edit should be irrelevant to a registry that's read once at process start,
and it was).

  • Cross-branch/worktree confusion: ruled out — confirmed the file exists

on the exact branch checked out at the session's cwd, via a clean
--no-ff merge commit, verified with git ls-tree and git show --stat.

  • App-level cache surviving a "restart": tested — a full quit+reopen

(user-confirmed, not just a new chat tab) still did not surface the file.

  • Naming collision (theory: story_builder collides with something

reserved, since the harness self-identifies as "FleetView"): tested by
renaming to kanban_story_builder (git mv, committed, byte-identical
content otherwise). Still absent after another confirmed full restart.

  • Encoding/line-ending/BOM difference vs. working files: checked via

xxd — identical CRLF, UTF-8, no BOM, same frontmatter shape as
plan_builder.md/spec_builder.md, which load fine from the same commit.

  • Duplicate file confusion from a leftover git worktree: ruled out —

the duplicate copy in the now-merged worktree is byte-identical, and
plan_builder.md has the same kind of leftover duplicate yet loads fine.

What still works

  • plan_builder.md and spec_builder.md, added and committed in the exact

same merge commit as the originally-named story_builder.md, both load
and dispatch correctly, every time, across all the sessions above.

  • No difference has been found between the broken file and the working

files other than the name/description/file basename content itself.

Environment

  • Windows 11, Claude Code CLI ("FleetView" branded instance)
  • Git repo, project-level .claude/agents/ (not global ~/.claude/agents,

which does not exist on this machine)

  • Repo: nse_202607, branch docs/story-plan-spec-agents-design,

commits 7205187 (original story_builder.md added) and a48368e
(renamed to kanban_story_builder.md)

Ask

Is there an additional registration step, size/count limit on custom
agents, or reserved-name list beyond what's visible in .claude/agents/
that would explain one specific file never being picked up while five
siblings in the same directory work normally?

View original on GitHub ↗