Your agent forgets your rules. Write them down once.
Long sessions get summarised, new sessions start empty and models change. The decisions your team made are the first thing to go. Here's how Lintsure keeps them in front of the agent.
Lintsure blog · Agents · 5 min read
An AI agent only knows what's in its context right now. That's fine for the first hour. Then the session gets long, the context fills up and gets summarised, or you start a new session the next morning, or switch models. Each time, some of what the agent knew about your project is gone.
The code survives. The decisions behind it don't. "Money is stored in cents." "Don't touch migrations that already ran." "Ask before adding a package." Nobody wrote those down for the agent, so the agent quietly stops following them, and the code drifts away from what the team agreed.
What drift looks like
Drift is rarely dramatic. It's small edits that each look reasonable:
- A price handled as a decimal in one new file, after months of cents everywhere else.
- A migration that already ran in production, edited in place to "fix" it.
- A new package added for something the project already has a helper for.
- An import of a function that doesn't exist, because the agent remembered a name that was never there.
A reviewer can catch some of these later. It's cheaper if the agent never makes them.
How Lintsure keeps rules in front of the agent
- Rules live in the repo. They go in
.lintsure/rules.yml, next to the code, so every session and every agent reads the same file. - Edits are checked against them. Drift Guard checks each edit against your rules: code to avoid, files to protect, and whether new dependencies need asking first. It also checks the edit against the code that exists, such as imports of files or packages that aren't there and calls to functions that don't exist.
- Memory brings them back. At the start of a session, and after the context is reset or summarised, Lintsure puts your rules, decisions and open findings back in front of the agent, kept short. A rule that only applies to some files is shown when the agent edits one of them.
- The agent re-reads before big changes. The
lintsure-stay-on-trackskill tells the agent to read your project rules again before a large change in a long session.
An example
A small rules.yml for a shop:
mode: strict
rules:
- protect: "migrations/**"
say: "Don't change migrations that already ran."
- avoid: "\\.(skip|only)\\("
say: "Never skip tests."
- deps: ask
say: "Ask before adding packages."
- note: "Money is stored in cents, as integers."
when: "src/billing/**"
Three hours into a session, the agent goes to edit migrations/001.sql. The edit is refused with "Don't change migrations that already ran", and the agent writes a new migration instead. When it opens a file in src/billing/, the cents note is in front of it again, however long ago it was last mentioned.
Writing the rules
You don't have to start from a blank file. The lintsure-rules skill reads your project, suggests rules that fit it, and saves the ones you approve. Keep them short and specific: a rule the agent can act on beats a principle it has to interpret.
mode sets how firm Lintsure is. guide explains and lets the agent correct itself, strict refuses, and quiet only records.
Limits
Rules are patterns and file paths, not understanding. Lintsure can hold the agent to "don't edit migrations"; it can't tell whether a new pricing function is a good idea. And a rule nobody wrote can't be checked, so the first job is writing down what your team already agreed.
Get started
npx lintsure plugin
npx lintsure skills
Then ask your agent to run lintsure-rules.