You can give an agent all the rules and skills in the world.

You can carefully explain your preferred patterns, conventions, architecture, naming schemes, and best practices. You can build an elaborate harness around it.

But there’s one rule the agent seems to care about more than almost everything else:

Follow the patterns already present in the surrounding code.

It’s about time we start treating it as a first-class feature.

We recently ran into this with translation files. Our rules say translations should use nested, snake_case keys, grouped by subdomain, with one file per domain.

Sounds straightforward.

Except our codebase also had years of legacy translations. Because of an internal integration, we couldn’t easily change them. Those legacy keys were often PascalCase or camelCase, weren’t properly nested, and weren’t consistently grouped.

So Claude would happily follow our translation rules when creating something new... until it encountered one of those legacy files.

Then it would start mimicking what was actually there.

We could add another rule. Then another. We could write a skill explaining the legacy exceptions. We could tell the agent exactly when not to copy the surrounding pattern.

Or we could fix the underlying problem.

Bite the bullet and clean up the legacy.

Once the code actually reflects the patterns we want, the agent doesn’t need a giant instruction manual to tell it what to do. The code itself becomes the instruction.

And I think this applies far beyond translations.

Every shitty pattern in your codebase is something you’re implicitly teaching your agents.

Inconsistent naming. Weird abstractions. Duplicated logic. Outdated APIs. Half-migrated architectures. "Temporary" conventions that have been around for three years.

You can keep fighting the agent’s tendency to reproduce those patterns.

Or you can turn that tendency into a superpower.

Double down on good practices. Make the codebase itself the strongest source of truth.

The economics have changed too. Cleanup and rework are dramatically cheaper when an agent can do a large part of the work. The payoff isn’t just nicer code for humans anymore. You’re also making every future agent interaction better.

Maybe the most important agentic workflow improvement isn’t another rule or skill.

Maybe it’s deleting the bad example that’s teaching the agent the wrong thing.