AI NewsOpen sourceAnnouncement
CodeHygiene flags hard-to-read code written by an AI agent
CodeHygiene is an offline linter that flags hard-to-read code by its shape. The repository earned 285 stars in its first seven days.
Image: brianbell-x on GitHub
Why it mattersAI agents produce code that reads as messy to a reviewer. CodeHygiene gives the reviewer a short list of the lines to look at first.
The code an AI coding agent writes is correct more often than a reviewer expects. It is also rarely readable. A reviewer has to look at every line to know which ones to rewrite. CodeHygiene offers a shorter path to the same answer.
brianbell-x opened the CodeHygiene repository on 15 November 2026. It carries 285 stars at the time of this writing. The repository calls it an offline linter that flags hard-to-read code by its shape. It reads source code as a grid of bytes, not as words. It ignores names and spelling. It scores the shape of each line. CodeHygiene covers more than 20 programming languages. It runs on NumPy, with no network calls.
How the shape model works
CodeHygiene uses an 8 kilobyte file of ternary weights. The author programmed them by hand in a script called compile.py. Nothing in the model is trained. The author calls this a "system one" model. By that, the repository means a small set of rules that runs in one pass. There is no learning step. The output names the file. It shows a before and after score out of one. It shows the exact lines to look at. A sample in the README shows a Go file scoring 0.233 before and 0.881 after.
The faults the linter names are plain. Deep nesting. Dense lines. Cramped layouts. Duplicate blocks. Repetitive structures. Comment echoes. Each one has a code and a line number. The author lists Python, JavaScript and Go as explicit examples.
Where it plugs in
CodeHygiene installs three ways. It is an agent skill for Claude Code, Codex, Cursor and Copilot. One of those coding agents can run it before it shows a reviewer a pull request. It is a command line tool. A human can run it on a branch after the agent finishes. It is a library in Python or JavaScript. A continuous integration pipeline can block a merge on a low score.
The repository does not report any outside comparison with existing linters. The author does not state what a good score is in absolute terms. A team that adopts it has to pick its own threshold. Run it on a few merged pull requests first. Use the score as a gate after that.
Why a reviewer would use it
A reader of the diff on a pull request from an AI agent has one real question. Which lines should a human rewrite before the merge? A traditional linter answers that question in terms of language rules. CodeHygiene answers it in terms of how the line looks on the page. The two sets of flags rarely overlap. A function that passes every rule can still read badly. A function that fails one rule can still be clear.
The project is seven days old at the time of this writing. 285 stars in a week is a modest signal and a short record. A team that wants to use it as a merge gate should pin a commit first. Measure the false positive rate on its own code. Only then enforce the score.
Source
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.