When a bug has several plausible causes, Claude Code’s experimental agent teams can investigate them separately and challenge each other’s evidence. Each teammate uses extra tokens, so this suits a stubborn bug more than a small fix.
You need a local code project, steps that reproduce the bug, and relevant logs or a failing test. These instructions use a macOS or Linux terminal with Claude Code installed and signed in, through a supported subscription or funded API access.
1. Open your terminal in the project folder and start a session with teams enabled:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude --teammate-mode in-process
All teammates will work in the same terminal; no extra terminal software is needed.
2. Paste this prompt, replacing the bracketed fields:
Investigate this bug without editing files.
Bug: [actual behavior and expected behavior]
Reproduce it: [steps or test command]
Evidence: [log excerpts or local file paths]
Create an agent team with three teammates. Assign each a different plausible cause based on this evidence. Give every teammate the full bug details.
Ask them to inspect the relevant code and run targeted tests where possible. Have them message each other with evidence that challenges the other explanations.
Wait for all three. Report the best-supported cause, file and line references, theories ruled out and why, and anything still uncertain. Propose the smallest test that could confirm or reject the leading explanation. Do not apply a fix yet.
3. Check the evidence before accepting the diagnosis. Run the proposed test and compare its actual output with the team’s prediction. If it disagrees, paste the result back and ask the team to revise its explanation. Agreement between agents alone does not confirm a cause.
4. When finished, ask the lead to shut down all teammates:
Ask all teammates to shut down. Give me a final summary of the evidence and the next debugging step.