CLAUDE CODE AGENTS: FUNDAMENTALS - Chapter 11 (Capstone), Exercise 2 Why Upgrading an Old Banner Format Is Refactoring, Not Coding ==================================================================================== QUESTION: Explain why Step 6 (upgrading an old banner comment format) is described as a refactoring task rather than a coding task, using this course's own Chapter 8 distinction. SOLUTION / EXPLANATION: Chapter 8 draws a specific distinction between these two agent types based on their success criterion: a coding agent (Chapter 5) succeeds by producing new, correct behavior - something the code or content didn't do before, now working correctly. A refactoring agent succeeds by the opposite standard: the actual content and meaning must stay exactly, provably the same, with only structure or formatting changing. Upgrading an old single-line course-header comment to the project's current fuller banner format fits the refactoring definition precisely. The lesson's own actual content - its course name, chapter topic, and educational material - doesn't change at all; only the formatting of the metadata describing it changes, from one comment style to another. Nothing new is being added to what a reader of the lesson actually learns, and nothing about the lesson's own behavior or meaning is different before and after - exactly Chapter 8's own "no observable difference, only structure changes" standard. If this were treated as a coding task instead, there would be a real risk of scope creep: a coding agent's whole framing is producing new, improved behavior, which could tempt it into also "improving" the lesson content itself while it's already in the file changing the banner - exactly the kind of unrequested change Chapter 5's own tip box warns against. Framing this explicitly as a refactoring task, with the explicit constraint that lesson content must stay identical, keeps the change scoped to exactly what was asked: the banner format, and nothing else. -------------------------------------------------------------------------- WHY THIS WORKS AS AN ANSWER: It applies Chapter 8's own success-criterion distinction (new behavior vs. identical behavior) directly to this specific task, and explains the concrete risk (unrequested content changes) that framing it as a coding task instead would introduce.