https://ghuntley.com/stdlib/ applies to claude as well.
AI won't magically know your codebase unless it is pretty vanilla - but then you teach it. If it makes a mistake, teach it by adding a rule.
You have to confine the output space or else you quickly get whatever.