feat(models): name delegated agents by model tier - #9
Merged
Merged
Conversation
Subagents launched without a name all render under their type label, so a batch of parallel workers appears as several identical `general-purpose` rows with nothing to distinguish them, and none can be reached with SendMessage. Require a name on every Agent call, carrying the model tier and numbered monotonically across the session. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Subagents launched without a
nameall render under their type label. A batch of parallel workers therefore shows up as several identicalgeneral-purposerows with nothing to tell them apart, and none of them can be addressed withSendMessage.This adds an Agent names section to
models.mdrequiring a name on everyAgentcall, with the model tier in it (opus-agent-1,sonnet-agent-1, …) and numbering that runs monotonically across the session rather than restarting per batch, so a number is never reused.The Implementation bullet now cross-references the new section, since that is where parallel agents get launched.
Why the name, and not a custom agent type
A custom type in
~/.claude/agents/would change the type label itself, but it would need one definition file per distinguishable worker and still provide no numbering. It would also requireapply.sh, theMakefile, andtests/apply.batsto grow an install path for agent definitions, which they do not have today. The per-callnamegets the same result with a doctrine line and no tooling change.Verification
name: "opus-agent-1"is accepted and the agent registers and runs asopus-agent-1, displayed alongside its type rather than replacing it. Names must start with a letter or digit and may contain only letters, digits, underscores, and hyphens.make test— all 13 bats cases pass (apply.shis untouched by this change).Note for a follow-up, not addressed here
If
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is ever enabled, a named subagent spawned from the main conversation launches as a teammate instead of a subagent. Agent teams are off by default and there is noenvkey insettings.json, so this doctrine is safe as written — but naming agents is the thing that would activate that coupling later.🤖 Generated with Claude Code