[FEATURE] Agent Teams: add verification phase to team lifecycle

Resolved 💬 2 comments Opened Feb 11, 2026 by NathanNorman Closed Mar 12, 2026

Preflight Checklist

  • [x] I've searched existing issues for duplicates
  • [x] I've read the agent teams documentation
  • [x] I can reproduce this with the latest version of Claude Code

Problem Statement

The agent teams lifecycle has well-designed phases for startup (TeamCreate, TaskCreate, spawn teammates) and execution (agents work, send completion messages, go idle), but no built-in concept of a verification phase between "all agents report done" and "team is cleaned up."

In practice, this means:

  1. The lead agent falls into "coordinator mode" during execution — receiving completion messages, marking tasks done, sending shutdown requests, acknowledging idle notifications. By the time all agents report success, the lead's momentum carries it straight through to TeamDelete without verifying the work.
  1. Self-reported verification isn't verification. Agents report "I grepped and confirmed no issues" in their completion messages. This is output description, not independent validation. A fresh agent reading the same files with no knowledge of what was intended would catch things the implementing agent missed.
  1. The task system supports dependencies but doesn't enforce a completion gate. You can create a Task #5 "Verify all work" with addBlockedBy: [1, 2, 3, 4], but nothing reminds or requires the lead to do this. The structural fix exists in the tooling but isn't part of the default workflow.

Proposed Solution

Add an optional verification configuration to TeamCreate (or as a team-level setting) that:

  • Auto-creates a verification task that is blocked by all other tasks
  • Prevents TeamDelete while the verification task is pending
  • Optionally spawns a verification agent — a fresh agent with a verification-focused prompt that reads modified files and checks for common issues (syntax errors, leftover placeholders, pattern consistency)

Example UX:

TeamCreate({
  team_name: "my-team",
  verification: {
    enabled: true,
    auto_spawn_verifier: true,  // spawn a fresh agent for verification
    checks: ["no_console_errors", "no_placeholder_text", "lint_clean"]
  }
})

Or more simply: a --verify flag on TeamCreate that adds a blocked verification task and warns if you try to TeamDelete before it's completed.

Alternative Solutions

  1. Document the pattern — Add "always create a verification task" to the agent teams best practices docs. Low effort, helps awareness, but relies on the lead remembering.
  2. Post-team hook — A hook that fires on TeamDelete and runs user-defined verification scripts. More flexible but requires user setup.
  3. Status quo — Users create verification tasks manually. Works but is easy to skip under the momentum of shutdown/cleanup.

Priority

Medium — This is a workflow quality issue, not a blocker. Teams work fine without it; the output just isn't independently verified.

Use Case

A team of 4 agents modifies 20 files across a web project (HTML, JS). Each agent reports success with "grep confirmed no remaining issues." The lead marks all tasks complete, shuts down agents, and deletes the team. Later, the user discovers that one agent introduced a syntax error in an async wrapper and another left "Loading..." placeholder text that never gets populated because of a missing await. A verification phase would have caught both.

Additional Context

Related issues that address adjacent parts of the team lifecycle:

  • #24246 — Idle notification delays
  • #23615 — Shutdown improvements (broadcast shutdown, auto-shutdown)
  • #24052 — Production coordination patterns
  • #24385 — Pane cleanup on shutdown

This proposal focuses specifically on the gap between "agents report done" and "team is cleaned up" — the verification phase that the current lifecycle skips.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗