CLAUDE CODE AGENTS: ADVANCED ORCHESTRATION - Chapter 8, Exercise 1 Finding Which Step Caused a Bad Implementation ==================================================================================== QUESTION: A three-agent chain (research, plan, implement) produces an incorrect implementation. Describe how you would go about finding which step actually caused the problem, using this chapter's own guidance. SOLUTION / EXPLANATION: This chapter is explicit that a wrong final result could have originated at any step in the chain, not necessarily the last one - and specifically recommends checking the earliest step first, rather than assuming the implementation step (where the problem became visible) is automatically where it was actually caused. Following that guidance, the investigation would proceed step by step from the start of the chain: 1. Check the RESEARCH agent's own findings first. Were they factually correct? If the research itself identified the wrong cause, location, or context, everything built on top of it downstream is compromised through no fault of the later agents - they were working from bad input, exactly the "bad input, not a bad agent" distinction this chapter draws. 2. If the research was correct, check the PLANNING agent's own proposed approach next. Did it correctly reflect the actual research findings, and was the approach itself sound? A plan that misinterprets correct research, or proposes a flawed approach despite good input, is where the problem would actually be found at this step. 3. If both the research and the plan were correct, the problem must be in the IMPLEMENTATION step itself - the coding agent either didn't follow the plan correctly, or introduced its own separate mistake despite having correct information and a sound plan to work from. Working through the chain in this order - earliest step first - finds the actual origin of the problem methodically, rather than assuming (simply because the wrong output surfaced at the implementation stage) that the coding agent itself must be at fault. -------------------------------------------------------------------------- WHY THIS WORKS AS AN ANSWER: It applies the chapter's own "check the earliest step first" guidance as an explicit, ordered procedure through all three steps, and connects checking research and planning first to the chapter's own "bad input vs. bad agent" distinction rather than jumping straight to blaming the final implementation step.