Skip to content

Enable agent teams (SendMessage) by default - #288

Open
pufit wants to merge 1 commit into
mainfrom
pufit/agent-teams
Open

Enable agent teams (SendMessage) by default#288
pufit wants to merge 1 commit into
mainfrom
pufit/agent-teams

Conversation

@pufit

@pufit pufit commented Aug 7, 2026

Copy link
Copy Markdown
Member

What

Adds agent.agent_teams (default true), which sets CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 for the CLI subprocess.

Why

The CLI gates the SendMessage tool behind that flag, but the Agent tool advertises it regardless — its own description says "Use SendMessage with the agent's ID or name to continue a previously spawned agent with its context intact", and every spawn result repeats it (use SendMessage with to: '<id>'). With the flag off, the model is told to resume sub-agents with a tool that was never registered: it tries, and it fails. Upstream report: anthropics/claude-code#35240

Nerve loads no settings files (setting_sources=[]), so ~/.claude/settings.json can't carry the flag the way it does for CLI/extension users — the env dict built in the claude backend is the only route in.

Verified

Probed with a standalone SDK client using Nerve's exact option shape (setting_sources=[], explicit env, stream-json transport), CLI 2.1.207:

SendMessage in init tools model's attempt
flag unset (today) replies TOOL_MISSING
flag set loads the schema via ToolSearch and calls it

The raw claude -p path lists SendMessage in the init handshake either way, so the SDK option shape had to be reproduced to see the real gate.

Notes

  • Teammates stay opt-in per turn — the model still has to spawn them — and each costs a full context window. The flag only makes the tool exist.
  • Known upstream limitation: the CLI cannot restore in-process teammates on resume. A session whose client is recycled (idle timeout, restart, crash retry) comes back without them, and the lead may message teammates that no longer exist. Documented next to the option.
  • Hot-reloadable: applies to sessions started after POST /api/config/reload, same seam as the rest of agent.*.
  • Backend-only; no frontend change. 3029 passed.

Generated by Nerve

The CLI gates SendMessage behind CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS,
but the Agent tool advertises it either way — its description and every
spawn result tell the model to resume a sub-agent with SendMessage, so
the model reaches for a tool that was never registered.

Nerve loads no settings files (setting_sources=[]), so the env dict is
the flag's only route into the CLI. Add agent.agent_teams (default true)
and emit the var from the claude backend.
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