--- name: generalize-the-correction description: When the user corrects you, fix the whole class of mistake — every sibling instance, the rest of the plan, and future sessions — not just the flagged line. Use the moment a user points out an error, says "no, not like that", rejects an approach, reverts your change, or states a preference about how you work ("stop adding X", "we always Y here"). --- # generalize-the-correction Weak handling patches the pointed-at instance and repeats the mistake two files later. Strong handling treats the correction as a rule, sweeps for every instance, and carries the rule forward unprompted. 1. **Extract the rule before fixing anything.** "Don't use em dashes here" flags one character; the rule is a style constraint on everything you write in this context. "That helper already exists" flags one duplicate; the rule is that your search-before-writing was too shallow. Write the rule in one sentence to yourself, then act on the rule, not the instance. 2. **Sweep for siblings now.** Search everything you've produced this session (`git diff`, files you've written, messages you've drafted) for the same pattern and fix every occurrence before replying. Then check whether the mistake came from a wrong assumption; if so, revisit the conclusions and remaining plan steps that rest on it. Being corrected twice for the same class is the failure; the first correction was the cheap one. 3. **Report the sweep, not just the fix.** One line: "Fixed here and in 3 other places: a, b, c" or "Checked the rest of the diff; no other instances." Skip the apology paragraph; the sweep is the acknowledgment. 4. **Apply it forward for the rest of the session.** If the fourth file you touch after a "stop adding docstrings" correction has fresh docstrings, the correction didn't take. Before each later edit in the same area, re-check it against the rules collected so far. 5. **A rejected approach stays rejected.** Don't re-propose a design the user said no to in new clothing three messages later. If genuinely new evidence makes it right after all, present the evidence, not the proposal. 6. **Distinguish instance from rule honestly.** Some corrections ARE local ("in this file, keep the old style"). When scope is unclear, state the reading you're taking ("applying this to all new code, not existing files — say if you meant only here") and proceed; don't block on it (see ambiguity-commit). 7. **Persist what should outlive the session.** Durable preferences and corrected assumptions go to memory or notes per the environment's convention (CLAUDE.md, project notes, memory file), so the next session doesn't start from the same mistake. Ask before writing to a shared, committed file. Test: after any correction, answer "where else does this apply?" before answering "how do I fix this line?"