Lintsure checks while your agent writes
Your project rules are checked before each edit is saved, and the guards look at every change right after. The agent fixes what's caught in the same session, and your PR reviewer takes it from there.
Lintsure blog · Product · 5 min read
Your AI agent now writes a lot of your code. Lintsure checks that code as it's written, so problems get fixed in the same session instead of turning up after a push.
It works inside the agent you already use. Your own project rules are checked before an edit is saved, and an edit that breaks one is refused. Right after each save, Lintsure's guards look at what changed and send the agent a note when something needs fixing. By the time you push, the easy mistakes are already gone, and your PR reviewer can spend its time on the hard ones.
How it works
Lintsure connects to your agent through a plugin. It's built and tested in Claude Code. The plugins for Cursor, Codex and Gemini CLI are new and still being tested.
- Your agent starts an edit.
- Before the file is saved, Lintsure checks the edit against your rules in
.lintsure/rules.yml. An edit that breaks one is refused, with the rule it broke. - Right after the save, the guards look at what changed. Secret Guard spots keys and tokens. Test Guard notices tests being deleted or weakened. Scope Guard flags hand edits to lock files, CI workflow files and
.envfiles. Package Guard checks new dependencies. - When a guard finds something, it sends the agent a note saying what to fix. The agent fixes it, usually in the same turn.
- Before a risky command runs, Danger Guard asks you first. In its strict setting it refuses outright.
When you push, the Lintsure Action runs the engine's scan rules on the pull request, a second line of checks that doesn't depend on which agent wrote the code.
The checks run on your machine and your code isn't sent anywhere. The one lookup Lintsure makes is when Package Guard checks a new package's name and version against npm and the OSV vulnerability database.
An example
Say your agent is adding a Stripe checkout and writes the live key straight into the file:
// src/checkout.ts
const stripe = new Stripe("sk_live_51Hx…9qT");
As soon as the file is saved, Secret Guard tells the agent there's a key in src/checkout.ts, and that a real key should be replaced. The agent rewrites the line in the same turn:
const stripe = new Stripe(process.env.STRIPE_KEY);
The key is caught before it's committed or pushed. It was written to disk for a moment, so if it was a real key, replace it, as the guard says. Without a check at this point, the same mistake surfaces after the push, once the key is already in your git history.
Works alongside your PR reviewer
Pull request review, by people or by AI, happens after the code is pushed. It's good at judging logic and design. Lintsure works earlier and does a different job:
| Lintsure | PR review | |
|---|---|---|
| When | While the agent writes, and again on push | After the pull request opens |
| How | Fixed rules, the same answer every time | Judgement, by a person or a model |
| Where | On your machine | On the pull request |
| Best at | Leaked secrets, risky commands, broken team rules | Logic, design, intent |
Use both. When rule breaks are caught early, review time goes to the questions that need judgement.
What Lintsure doesn't do
Rules catch what they're written for. Lintsure won't judge whether your design is right, and it won't find every logic flaw. That's what review is for. It also can't tell you that you meet a standard; it shows where your code stands against the rules it checks, and a qualified person makes that call.
Get started
Lintsure is free and open source, and runs on your machine.
npx lintsure plugin # the guards and your rules, inside your agent
npx lintsure skills # the skills your agent can use
npx lintsure setup # the scan tool, over MCP
Then start a session and ask your agent to run lintsure-setup.