The Weekly Fix
Three date formatters, two auth helpers, the same fetch wrapper re-implemented per feature. Why AI codebases bloat, and the two habits that stop it.
Code duplication piles up after weeks of vibe coding.
Three slightly different date formatters. Two auth helpers. The same fetch wrapper re-implemented per feature. GitClear measured 4x more duplication in AI-assisted codebases.
The model does not know your existing helpers exist unless you point at them. Each session starts blind, so it re-derives utilities you already have.
Two habits. First, keep a CLAUDE.md or AGENTS.md listing your utilities and where to find them, and feed it at session start. Second, after every feature ask the agent: did this duplicate logic from anywhere? Show me the closest existing helper. Even imperfect dedup beats the default.
Here is my utils/helpers index: [paste AGENTS.md or file list]. For the feature I am about to build โ [describe] โ tell me which existing helpers I should reuse instead of writing new ones. If something genuinely does not exist yet, say so.
Full entry in the database: Code duplication piles up after weeks of vibe coding โ