Skip to content

feat(models): name delegated agents by model tier - #9

Merged
gsdevme merged 1 commit into
mainfrom
feat/agent-names
Sep 17, 2026
Merged

gsdevme merged 1 commit into
mainfrom
feat/agent-names

Conversation

@gsdevme

@gsdevme gsdevme commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

Subagents launched without a name all render under their type label. A batch of parallel workers therefore shows up as several identical general-purpose rows with nothing to tell them apart, and none of them can be addressed with SendMessage.

This adds an Agent names section to models.md requiring a name on every Agent call, 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 require apply.sh, the Makefile, and tests/apply.bats to grow an install path for agent definitions, which they do not have today. The per-call name gets the same result with a doctrine line and no tooling change.

Verification

  • Behaviour confirmed against Claude Code before writing the doctrine: a call passing name: "opus-agent-1" is accepted and the agent registers and runs as opus-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.sh is untouched by this change).

Note for a follow-up, not addressed here

If CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is 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 no env key in settings.json, so this doctrine is safe as written — but naming agents is the thing that would activate that coupling later.

🤖 Generated with Claude Code

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>
@gsdevme
gsdevme merged commit 47dde92 into main Sep 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant