CLAUDE CODE AGENTS: FUNDAMENTALS - Chapter 8, Exercise 1 Different Success Criteria, Different Uses for Bash ==================================================================================== QUESTION: Explain how "success" is defined differently for a coding agent (Chapter 5) versus a refactoring agent, and why that difference changes what each agent's own Bash access is actually used for. SOLUTION / EXPLANATION: A coding agent (Chapter 5) succeeds by producing NEW, correct behavior - the whole point of its task is that something the code didn't do before, it now does correctly. A refactoring agent succeeds by the opposite standard: the code's observable behavior must stay EXACTLY the same as it was before, with only its internal structure changing. One agent's success is defined by change; the other's is defined by the explicit absence of change. This directly changes what Bash access is actually for in each case. For the coding agent, running tests or the built code via Bash serves to verify that the new behavior actually works as intended - confirming something that didn't exist before now functions correctly. For the refactoring agent, Bash serves a specifically different purpose: running the same test suite both before and after the structural change, and confirming the results are IDENTICAL - not that something new works, but that nothing observable changed at all. So while both agents might use the exact same tool (Bash, running a test suite), what that tool is actually confirming differs fundamentally: "this new thing works correctly" for the coding agent, versus "this old thing still behaves exactly as it did before" for the refactoring agent. The tool is the same; the question it's being used to answer is the opposite. -------------------------------------------------------------------------- WHY THIS WORKS AS AN ANSWER: It states the opposite success criteria precisely (new correct behavior vs. no behavior change at all) and then explains specifically how that difference reshapes what running tests via Bash is actually verifying in each case, rather than treating "runs tests" as the same activity for both.