In software engineering, there's a principle called DRYDRY "Don't Repeat Yourself." A principle that says: every piece of knowledge should live in exactly one place. If you're copying and pasting, something's wrong. — Don't Repeat Yourself. The idea is simple: if a piece of knowledge lives in two places, sooner or later one of them will fall out of date. So centralize it.
This principle applies perfectly to anyone working with AI agentsAgent An AI that acts autonomously — instead of just answering questions, it carries out tasks on its own: reads code, creates files, runs tests. Think of it as a very fast digital intern.. If every time the AI does something wrong you fix it by hand and move on, you're repeating yourself. The problem will come back next session, next project, next month.
A perfect case came up today. I asked Claude CodeClaude Code Anthropic's command-line tool. You build software by chatting with AI right in the terminal — it reads your code, edits files, and runs tests. to spin up a dev server so I could test a page. It tried to use port 3000 — which was already taken by another service. Instead of just saying "use another port" and moving on, I had it solve the problem for real: create a global rule so this mistake never happens again.
It edited my global CLAUDE.mdCLAUDE.md A config file that tells Claude Code how to work on your project. It works like a best-practices handbook the AI reads before it acts. and added:
ALWAYS check whether the port is available BEFORE starting any server. If the port is taken, do NOT kill the process — use an alternate port or ask the user.
Done. From now on, in any project, in any conversation, Claude Code will check the port before spinning up a server. I'll never have to fix this again.
The lesson: when an agentAgent An AI that acts autonomously — instead of just answering questions, it carries out tasks on its own: reads code, creates files, runs tests. Think of it as a very fast digital intern. makes a mistake, don't just fix the instance — fix the cause. Put the rule in the config file. Teach it once, never repeat. That's DRY applied to AI.
Marcelo Cajueiro