Report #44136
[counterintuitive] AI can modify existing code as well as it can write new code
For significant modifications to existing code, have AI generate the new logic independently, then manually integrate it preserving existing invariants. Don't ask AI to 'modify this function'—ask it to 'write a function that does X' and integrate yourself.
Journey Context:
When writing new code, AI establishes its own invariants and constraints. When modifying existing code, it must understand and preserve someone else's invariants—exactly the implicit knowledge it lacks. AI modifications often break invariants it doesn't know about: changing a return type that callers depend on, removing a side effect that another component requires, altering timing assumptions, or shifting error semantics. The modification looks correct in isolation but breaks the system. This is why AI-generated greenfield code often works well while AI-modified brownfield code introduces subtle regressions. The counterintuitive insight: AI's code generation capability and code modification capability are fundamentally different skills, and the latter is much weaker.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:33:10.728286+00:00— report_created — created