team-debug

A command for investigating complex bugs with several coding agents working on different possible causes. It uses competing hypotheses, meaning each explanation is checked against evidence rather than accepted immediately.

In plain words
What is it for?
Use it with an error message, bug description, or file to generate hypotheses, gather evidence in parallel, and determine the most likely root cause.
Why use it?
It reduces confirmation bias and speeds up investigations when a failure may have multiple causes. The investigation can be limited to selected files, a module, or the whole project.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/wshobson/agents/team-debug
Clone the repo
git clone --depth 1 https://github.com/wshobson/agents
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 870 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.00870
Opus 5 $0.00005 $0.00435
Sonnet 5 $0.00002 $0.00174
Haiku 4.5 $0.00001 $0.00087

Measured 2d ago against content hash 95eadf79ca76, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

team-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-teams/commands/team-debug.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Team Debug

Debug complex issues using the Analysis of Competing Hypotheses (ACH) methodology. Multiple debugger agents investigate different hypotheses in parallel, gathering evidence to confirm or falsify each one.

Pre-flight Checks

  1. Verify CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set
  2. Parse $ARGUMENTS:
    • <error-description-or-file>: description of the bug, error message, or path to a file exhibiting the issue
    • --hypotheses N: number of hypotheses to generate (default: 3)
    • --scope: investigation scope — files (specific files), module (module/package), project (entire project)

Phase 1: Initial Triage

  1. Analyze the error description or file:
    • If file path: read the file, look for obvious issues, collect error context
    • If error description: search the codebase for related code, error messages, stack traces
  2. Identify the symptom clearly: what is failing, when, and how
  3. Gather initial context: recent git changes, related tests, configuration

Phase 2: Hypothesis Generation

Generate N hypotheses about the root cause, covering different failure mode categories:

  1. Logic Error — Incorrect algorithm, wrong condition, off-by-one, missing edge case
  2. Data Issue — Invalid input, type mismatch, null/undefined, encoding problem
  3. State Problem — Race condition, stale cache, incorrect initialization, mutation bug
  4. Integration Failure — API contract violation, version mismatch, configuration error
  5. Resource Issue — Memory leak, connection exhaustion, timeout, disk space
  6. Environment — Missing dependency, wrong version, platform-specific behavior

Present hypotheses to user: "Generated {N} hypotheses. Spawning investigators..."

Phase 3: Investigation

  1. Use TeamCreate tool to create the team with team_name: "debug-{timestamp}" and description
  2. For each hypothesis, use Agent tool to spawn a teammate:
    • name: investigator-{n} (e.g., "investigator-1")
    • subagent_type: "agent-teams:team-debugger"
    • prompt: Include the hypothesis, investigation scope, and relevant context
  3. Use TaskCreate for each investigator's task:
    • Subject: "Investigate hypothesis: {hypothesis summary}"
    • Description: Full hypothesis statement, scope boundaries, evidence criteria

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 92 lines · 11 tokens per session scan A 95eadf79ca76

Subscribe to this mod's changes

team-debug is a command published in the GitHub repository wshobson/agents (39,318 stars, last pushed yesterday), licensed MIT. It adds 11 tokens to every session and 870 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.