DEV Community

dosaygo
dosaygo

Posted on Fully Autonomous

Make Cursor and Claude Code follow the same team rules

Half the team works in Cursor and the other half in Claude Code. Someone uses Copilot in the editor, and a Codex job runs at night. Each agent reads its own instruction file, and each file was written by a different person on a different day. The Cursor rules say errors are never swallowed. CLAUDE.md says nothing about errors, and has a paragraph about a queue that was deleted in March. The same ticket, given to two agents, comes back as two designs.

You notice this at review. One pull request extends the existing module and the other builds a second one beside it, and both authors followed the rules their agent was given. The rules were different.

The fix is plain: keep the rules once, in the repository, and make every agent's instruction file a short pointer to them.

One rules directory, several pointer files

Put the rules in one directory at the root of the repository. Ours is .ai-lint/. It holds a checklist, the principles for each language, and a list of rejected patterns, each with an ID.

Then each agent gets the file it already reads, and that file says the same few things:

Before producing code:
- Read .ai-lint/CHECKLIST.md
- Read the doctrine and rejects for the language in hand
Rejects outrank preferences.
Do not use a rejected pattern unless an override is explicitly requested.
Enter fullscreen mode Exit fullscreen mode

For Claude Code that file is CLAUDE.md. For Cursor it is .cursor/AGENTS.md. For Copilot it is .github/copilot-instructions.md. The pointer files are ten or twenty lines each and they almost never change. Everything that does change lives in one place, so a rule is edited in one commit and every agent picks it up on the next prompt.

Do not paste the rules themselves into each agent's file. Three copies of a rule are three things to keep in step, and they will drift apart within a month.

Give every rule a name

"Follow our architecture conventions" cannot be checked. A rule with an ID can. When an agent refuses a plan, it should say which rule it refused under, and a reviewer should be able to open that rule and read it.

This is what makes two agents comparable. If Cursor cites AR-R2 for a change and Claude Code writes the same change without comment, the wiring on the Claude side is broken, and you know it in one prompt.

Test it that way after setup. Give each agent the same request that breaks a rule, for example a module that tracks sessions in a global variable. A wired agent names the reject, says why it exists, and offers the aligned version or asks whether you want an override. An agent that writes the code without a word is not reading the rules.

Write exceptions down

Rules that can never be broken get ignored quietly. Give the team one way to break a rule on purpose: an override block with four fields, Override, Reason, Risk and Mitigation. The agent proposes it, a person accepts it, and it lands in the diff where the next reader finds it.

Then there is a record. When the same override shows up three times, the rule is wrong for your codebase and you change the rule.

Keep the rules from going stale

Stale rules do more harm than missing ones, because the agent follows them. Three habits hold up:

  1. Change the rule in the same pull request that changes the code it describes. If a module moves, the line that names it moves with it.
  2. Keep history out of the rules. A rule says what to do now. The story of the incident belongs in the commit message.
  3. Delete a rule nobody has cited or overridden in a long time, after reading it once more. A short file gets read; a long one gets skimmed.

Since the rules are ordinary files in the repository, they get the same review as code. That is the whole mechanism. Nothing has to be synced and there is no service to run.

What we sell for this

AI Lint is that directory, already written. It is a .ai-lint/ folder with a pre-code checklist, an override protocol, architecture and security doctrine, and named rejects such as AR-R2: Parallel Solutions and SEC-R1: Radioactive Secrets, plus wiring files for Cursor, Claude Code, Copilot and other agents. It ships as a ZIP that works offline in a private repository. It is guidance for the agent: a linter or type checker still does the mechanical checks, and a person still reads the diff.

The free edition is for personal use by individuals only and covers the checklist, the security baseline and a JavaScript sample. A company needs a Company license. The Company Bundle is $499 once for one legal entity with unlimited internal users, covers nine languages plus Django and Spring, and you may edit any file to add your own house rules.

Buy the AI Lint Company Bundle

Top comments (0)