This is not a proposal. This documents existing but hidden functionality found in Claude Code v2.1.19 binary, plus speculation on how it could be used.
TeammateTool already exists in Claude Code. We extracted this from the compiled binary at ~/.local/share/claude/versions/2.1.19 using strings analysis. The feature is fully implemented but gated behind feature flags (I9() && qFB()).
# Location
~/.local/share/claude/versions/2.1.19 # Mach-O 64-bit executable
# Extract strings mentioning TeammateTool
strings ~/.local/share/claude/versions/2.1.19 | grep -i "TeammateTool"
# Extract team_name references
strings ~/.local/share/claude/versions/2.1.19 | grep -i "team_name"| Operation | Purpose |
|---|---|
spawnTeam |
Create a new team, become leader |
discoverTeams |
List available teams to join |
requestJoin |
Ask to join an existing team |
approveJoin |
Leader accepts a join request |
rejectJoin |
Leader declines a join request |
write |
Send message to specific teammate |
broadcast |
Send message to all teammates |
requestShutdown |
Ask a teammate to shut down |
approveShutdown |
Accept shutdown and exit |
rejectShutdown |
Decline shutdown, keep working |
approvePlan |
Leader approves teammate's plan |
rejectPlan |
Leader rejects plan with feedback |
cleanup |
Remove team directories |
"team_name is required for spawn operation. Either provide team_name in input
or call spawnTeam first to establish team context."
"team_name is required for broadcast operation. Either provide team_name in input,
set CLAUDE_CODE_TEAM_NAME, or create a team with spawnTeam first."
"proposed_name is required for requestJoin operation."
"does not exist. Call spawnTeam first to create the team."
| Variable | Purpose |
|---|---|
CLAUDE_CODE_TEAM_NAME |
Current team context |
CLAUDE_CODE_AGENT_ID |
Agent identifier |
CLAUDE_CODE_AGENT_NAME |
Agent display name |
CLAUDE_CODE_AGENT_TYPE |
Agent role/type |
CLAUDE_CODE_PLAN_MODE_REQUIRED |
Whether plan approval needed |
isEnabled() {
return I9() && qFB() // Two feature flags must be true
}| Backend | Terminal | Use Case |
|---|---|---|
| iTerm2 split panes | Native macOS | Visual side-by-side agents |
| tmux windows | Cross-platform | Server/headless |
| In-process | None | Same process, fastest |
~/.claude/
βββ teams/
β βββ {team-name}/
β βββ config.json # Team metadata, members
β βββ messages/ # Inter-agent mailbox
β βββ {session-id}/
βββ tasks/
β βββ {team-name}/ # Team-scoped tasks
β βββ 1.json
β βββ ...
Everything below is speculation based on how the API could be used once enabled.
Scenario: You open a PR and want thorough review from multiple perspectives.
You: "Review PR #1588 with a full team"
Claude (Leader):
βββ spawnTeam("pr-review-1588")
βββ spawn("security-sentinel", prompt="Review for vulnerabilities")
βββ spawn("performance-oracle", prompt="Check for N+1 queries, memory leaks")
βββ spawn("rails-expert", prompt="Check Rails conventions")
βββ spawn("test-coverage", prompt="Verify test coverage is adequate")
[All agents work in parallel, each in their own iTerm2 pane]
Leader polls for completion, aggregates findings:
βββ broadcast("Wrap up, send your findings")
βββ [Collects responses via inbox]
βββ requestShutdown("security-sentinel")
βββ requestShutdown("performance-oracle")
βββ ...
βββ cleanup()
Leader: "Here's the consolidated review with 3 critical, 5 moderate findings..."
What you'd see: 5 terminal panes, each showing a different agent working. The leader coordinates and synthesizes.
Scenario: Build a complete feature with specialized agents for each layer.
You: "Build user authentication with OAuth"
Claude (Leader):
βββ spawnTeam("auth-feature")
Phase 1 - Planning:
βββ spawn("architect", prompt="Design the OAuth flow", plan_mode_required=true)
βββ [architect creates plan, sends plan_approval_request]
βββ approvePlan("architect", request_id="...")
Phase 2 - Implementation (parallel):
βββ spawn("backend-dev", prompt="Implement OAuth controller and models")
βββ spawn("frontend-dev", prompt="Build login UI components")
βββ spawn("test-writer", prompt="Write integration tests", blockedBy=["backend-dev"])
Phase 3 - Integration:
βββ write("backend-dev", "Frontend is using /auth/callback endpoint")
βββ write("frontend-dev", "Backend expects redirect_uri param")
Phase 4 - Verification:
βββ spawn("qa-agent", prompt="Run full test suite and verify flow")
βββ broadcast("QA found issues in session handling, please fix")
Phase 5 - Shutdown:
βββ requestShutdown("backend-dev")
βββ [backend-dev]: approveShutdown() // Done with work
βββ requestShutdown("frontend-dev")
βββ [frontend-dev]: rejectShutdown(reason="Still fixing CSS") // Not done
βββ [Leader waits, retries later]
The magic: Agents communicate, block on dependencies, and the leader orchestrates without micromanaging.
Scenario: A production bug needs investigation from multiple angles.
You: "Users report checkout fails intermittently"
Claude (Leader):
βββ spawnTeam("bug-hunt-checkout")
Investigation (parallel):
βββ spawn("log-analyst", prompt="Search AppSignal for checkout errors")
βββ spawn("code-archaeologist", prompt="git log -p on checkout paths")
βββ spawn("reproducer", prompt="Try to reproduce in test environment")
βββ spawn("db-detective", prompt="Check for data anomalies in orders table")
[Agents work independently, report findings to leader]
log-analyst β write("team-lead", "Found timeout errors correlating with 3rd party API")
code-archaeologist β write("team-lead", "Recent change to retry logic looks suspicious")
reproducer β write("team-lead", "Reproduced! Happens when API returns 503")
Leader synthesizes:
βββ "Root cause: retry logic doesn't handle 503 correctly.
code-archaeologist, please prepare a fix."
βββ write("code-archaeologist", "Implement exponential backoff for 503 responses")
[Fix implemented, verified, PR created]
βββ broadcast("Bug fixed, shutting down")
βββ cleanup()
Scenario: Large refactoring with automatic work distribution.
You: "Refactor all service objects to use the new BaseService pattern"
Claude (Leader):
βββ spawnTeam("service-refactor")
Discovery:
βββ spawn("scout", prompt="Find all service objects that need refactoring")
βββ [scout returns list of 47 services]
Work Distribution:
βββ Creates 47 tasks with TaskCreate
βββ spawn("worker-1", prompt="Refactor services, claim tasks from list")
βββ spawn("worker-2", prompt="Refactor services, claim tasks from list")
βββ spawn("worker-3", prompt="Refactor services, claim tasks from list")
[Workers autonomously claim tasks via TaskUpdate]
worker-1: TaskUpdate(taskId="12", status="in_progress", owner="worker-1")
worker-2: TaskUpdate(taskId="7", status="in_progress", owner="worker-2")
[If worker-1 crashes, heartbeat timeout releases its task]
[worker-3 claims the abandoned task]
Verification:
βββ spawn("verifier", prompt="Run tests after each refactored service")
βββ [verifier monitors completed tasks, runs tests]
[All 47 tasks complete]
βββ broadcast("All services refactored, final test run passing")
βββ cleanup()
Key insight: Workers self-organize around a shared task queue. No central assignment needed.
Scenario: Evaluate multiple technical approaches before committing.
You: "Should we use Redis or PostgreSQL for our job queue?"
Claude (Leader):
βββ spawnTeam("tech-evaluation")
βββ spawn("redis-advocate", prompt="Make the case FOR Redis. Research benchmarks, patterns.")
βββ spawn("postgres-advocate", prompt="Make the case FOR PostgreSQL. Research benchmarks, patterns.")
βββ spawn("devil-advocate", prompt="Find problems with BOTH approaches in our context.")
βββ spawn("cost-analyst", prompt="Compare operational costs, hosting, maintenance.")
[Each agent researches independently]
Debate Phase:
βββ broadcast("Present your findings. Respond to each other's points.")
redis-advocate β broadcast("Redis is 10x faster for queue operations")
postgres-advocate β broadcast("But we already run Postgres, no new infrastructure")
devil-advocate β broadcast("Redis advocate ignores connection pool limits")
cost-analyst β broadcast("Redis adds $200/mo, Postgres is free")
Leader synthesizes:
βββ "Recommendation: Use PostgreSQL with SKIP LOCKED pattern.
Redis performance benefits don't justify operational complexity
for our 10k jobs/day scale."
βββ cleanup()
Scenario: Automated pre-deployment verification with multiple checkpoints.
You: "Deploy to production with full verification"
Claude (Leader):
βββ spawnTeam("deploy-2026-01-23")
Pre-flight (parallel, all must pass):
βββ spawn("test-runner", prompt="Run full test suite")
βββ spawn("security-scan", prompt="Run Brakeman and bundler-audit")
βββ spawn("migration-check", prompt="Verify migrations are safe and reversible")
βββ spawn("perf-baseline", prompt="Capture current performance metrics")
[All agents must approveShutdown before proceeding]
Gate Check:
βββ IF any agent rejectShutdown with failures β abort deployment
βββ ELSE proceed
Deploy:
βββ spawn("deployer", prompt="Run cap production deploy")
Post-deploy (parallel):
βββ spawn("smoke-tester", prompt="Hit critical endpoints, verify responses")
βββ spawn("perf-compare", prompt="Compare metrics to baseline")
βββ spawn("log-watcher", prompt="Monitor for error spikes for 5 minutes")
[If any post-deploy check fails]
βββ broadcast("ROLLBACK REQUIRED")
βββ spawn("rollback-agent", prompt="Execute rollback procedure")
Success:
βββ "Deployment complete. All checks passed."
βββ cleanup()
Scenario: Keep documentation in sync with code changes automatically.
You: "Update all docs affected by the API changes in this PR"
Claude (Leader):
βββ spawnTeam("docs-sync")
Analysis:
βββ spawn("change-detector", prompt="Identify all API changes in PR #1590")
βββ [Returns: 3 new endpoints, 2 modified, 1 deprecated]
Documentation (parallel):
βββ spawn("api-docs", prompt="Update OpenAPI spec for changed endpoints")
βββ spawn("readme-updater", prompt="Update README examples")
βββ spawn("changelog-writer", prompt="Add changelog entry")
βββ spawn("migration-guide", prompt="Write migration guide for deprecated endpoint")
Review:
βββ spawn("docs-reviewer", prompt="Check all doc changes for accuracy and style")
βββ [reviewer sends feedback via write() to specific agents]
βββ cleanup()
Scenario: Work on a massive codebase that exceeds context limits.
You: "Understand this entire 500-file codebase and answer questions"
Claude (Leader):
βββ spawnTeam("codebase-brain")
Specialists (each handles a domain):
βββ spawn("models-expert", prompt="Become expert on app/models/")
βββ spawn("controllers-expert", prompt="Become expert on app/controllers/")
βββ spawn("services-expert", prompt="Become expert on app/services/")
βββ spawn("jobs-expert", prompt="Become expert on app/jobs/")
βββ spawn("tests-expert", prompt="Become expert on test/")
[Each agent reads and indexes their domain]
Query Routing:
You: "How does user authentication work?"
Leader:
βββ broadcast("Who knows about authentication?")
βββ controllers-expert: "I handle SessionsController"
βββ models-expert: "I handle User model with has_secure_password"
βββ services-expert: "I handle AuthenticationService"
Leader:
βββ write("controllers-expert", "Explain the login flow")
βββ write("models-expert", "Explain the User auth methods")
βββ write("services-expert", "Explain AuthenticationService")
βββ [Synthesizes responses]
[Team persists across questions - no re-reading needed]
The breakthrough: Each agent maintains context for their domain. Combined, they "know" the entire codebase.
Leader creates team β Leader spawns workers β Workers report to leader β Leader synthesizes
Most common. One orchestrator, multiple specialists.
Leader creates team + tasks β Workers self-assign from task queue β Leader monitors
For embarrassingly parallel work. Workers are interchangeable.
Agent A (blockedBy: []) β Agent B (blockedBy: [A]) β Agent C (blockedBy: [B])
Sequential processing with handoffs. Each agent waits for predecessor.
Multiple agents with same task β Each proposes solution β Leader picks best
For decisions where you want diverse perspectives.
Worker agent does task β Watcher agent monitors β Watcher can trigger rollback
For critical operations needing safety checks.
| Failure Mode | How System Handles It |
|---|---|
| Agent crashes mid-task | Heartbeat timeout (5min) releases task |
| Leader crashes | Workers complete current work, then idle |
| Infinite loop in agent | requestShutdown β timeout β force kill |
| Deadlocked dependencies | Cycle detection at task creation |
| Agent refuses shutdown | Timeout β forced termination |
| Resource exhaustion | Max agents per team limit |
Confirm this exists on your system:
# Check Claude Code version
claude --version
# Find TeammateTool references
strings ~/.local/share/claude/versions/$(claude --version | cut -d' ' -f1) \
| grep "TeammateTool" | head -5
# Find all operations
strings ~/.local/share/claude/versions/$(claude --version | cut -d' ' -f1) \
| grep -E "spawnTeam|discoverTeams|requestJoin|approveJoin" | head -20
# Find environment variables
strings ~/.local/share/claude/versions/$(claude --version | cut -d' ' -f1) \
| grep "CLAUDE_CODE_TEAM" | head -10The future of Claude Code is multi-agent. The infrastructure exists:
- 13 TeammateTool operations
- File-based coordination
- Three spawn backends
- Inter-agent messaging
- Plan approval workflows
- Graceful shutdown protocol
It's waiting behind feature flags. When enabled, we'll see:
- Code review swarms
- Feature development teams
- Self-organizing refactors
- Research councils
- Deployment guardians
- Distributed codebase understanding
The primitives are there. The creativity is up to us.
Analysis: 2026-01-23 Claude Code: v2.1.19 Binary: ~/.local/share/claude/versions/2.1.19

Sneaky github... ok I just git commit'ed it to a new gist :-D
Download it here: teammate-tool.tar.gz
Ah, but a quick test looks like the patch target patterns in the latest claude update have changed enough that this patcher needs updating... I'll update it once my limits reset later on tonight
@jfichtner - 2 acccounts is one through work, one personal