Linting is the next big thing for code that LLMs write

When an agent writes the code, a linter is the one instruction it can't ignore, so the rules you encode in it become the spec for how your team builds.

Linting gets a new job

Linting has been the least glamorous part of a codebase for as long as I've been writing JavaScript. It was there to stop arguments about semicolons and tabs vs spaces, and it got tunred off the moment it got in the way.

My hypothesis is that it's about to matter more than almost anything else in the toolchain. If an LLM is writing most of the code, then the linter stops being a style cop for people and becomes the most reliable way to tell an agent how we build things here.

Instructions files vs linters

Every agent setup now has an AGENTS.md or CLAUDE.md that describes the conventions. The agent reads it, mostly follows it, and sometimes doesn't, because a Markdown file is just context, there's nothing enforcing it.

A linter runs every time and gives the same answer every time, and the agent can't talk its way past a non-zero exit code. Factory put it well in Using Linters to Direct Agents, the instructions file is the why and the examples, and linting is the how and the guarantee, so "lint green" becomes the definition of done.

Birgitta Böckeler's harness engineering article describes the gap really well:

A coding agent has... no social accountability, no aesthetic disgust at a 300-line function, no intuition that “we don't do it that way here,” and no organisational memory. It doesn't know which convention is "load-bearing" and which is just habit, or whether the technically correct solution fits what the team is trying to do.

I think a linter is how you give it some of that back. Each rule is basically a "we don't do it that way here" written down, and it runs on every edit.

Writing the error messages for the agent

The thing that makes this interesting is who's reading the lint output. It used to be a person, who would probably already know why the rule exists. Now it's an agent in a loop, so the message itself becomes the instruction.

So it's worth writing rules that encode decisions as well as style, and writing the messages for the agent to read:

// eslint.config.js
export default [
  {
    rules: {
      "no-restricted-imports": ["error", {
        paths: [{
          name: "axios",
          message:
            "Use apiClient from src/lib/api instead. " +
            "It adds auth, retries and logging.",
        }],
      }],
    },
  },
];

That's a team decision that would otherwise live in a paragraph nobody reads. If you run it from a hook after every edit, the agent gets told the moment it reaches for the wrong thing, and the fix is right there in the same sentence.

Factory's open source eslint-plugin has a good set of examples, rules like require-test-files, structured-logging and no-use-effect-in-hooks, each one documented so an agent can adapt it to another stack. Their README is pretty clear that you should build your own rather than import theirs, which makes sense, since the rules are really a description of your own architecture.

Agents will cheat if they can

There's a catch. An agent told to get to green will find the shortest way there, and sometimes that's // eslint-disable-next-line, a skipped test or a loosened config.

agent-lint is the most interesting repo I found on this. It wraps the linters you already run (ruff, mypy, eslint, semgrep and others) in a ratchet, so findings get compared to a committed baseline, new ones fail, and the baseline only ever gets tighter. It also flags the shortcuts directly, suppressions added, tests skipped or removed, assertions deleted and linter config weakened. It's tiny and very new, but I think it's the right idea, the linter needs guarding as well.

What my Claude research found

The plateau result is the one I keep coming back to. A loop can only fix what the rules can see, so most of the value is in writing good rules, and the loop on its own won't get you much further.

Where this goes

If the hypothesis is right I think two things follow.

First, the instructions file gets smaller. Anything a linter can check moves into the linter, and the Markdown just keeps the reasons and the judgement calls.

Second, writing lint rules becomes real engineering work again. Custom rules used to be too expensive for most teams to bother with, but now an agent can write the rule, and then that rule directs every agent after it.

The tools for this are already starting to show up. ast-grep's agent skill teaches Claude to write structural rules and test them against example code before running them across the codebase. codemyrules goes a step further, it reads a project's decisions and the instructions in its agent docs, turns them into ESLint or ast-grep rules, slims the docs down, and wires the rules into a feedback loop for the agent, so that's both of these in one skill.

It's a similar shift to judging data tests instead of writing them, the code is getting cheap, and more of the work is deciding what correct actually means.