never-again

free · open source · MIT

Your coding agent fixes a bug, then makes the same mistake next week.

Mistakes that can't repeat.

Whether you're prototyping your first app or shipping production code, never-again turns every mistake you fix into a rule Claude Code can't break.

save time · save tokens · ship with confidence

$git clone --depth 1 https://github.com/malaysherasia-ai/claude-never-again.git && bash claude-never-again/install.sh .

macos, linux, wsl and windows · python 3.7+ · runs on your machine · claude code, codex, gemini cli, copilot and antigravity

how it works

One question per bug.

Can a script catch this before it happens? If it can, the lesson becomes a hook, and a hook costs one line to carry. If it cannot, the lesson becomes one line in a rules file. That file has a cap, keeps the rules that fire most at the top, and loads per package, because models follow fewer rules as the list gets longer.

Pipeline: capture, triage, hook, warn, block, with an advisory branch to LESSONS.md A packet moves left to right through five nodes. At triage it may branch upward to LESSONS.md instead. LESSONS.md advisory 17/40 loaded 17 Capture symptom · cause · rule on: "never again" Triage can a script catch it? before X, fail if Y Hook hooks/na/L001.sh PreToolUse + git pre-commit Warn decision: ask streak 0 / 5 Block decision: deny warn

    
in flightasksdeniedenforced
1 line
per hook, per turn
40
rules per file, default cap
ask → deny
warn first, human promotes
$0
forever, mit licensed

fix it once. never again.

Built for both sides of the keyboard.

Whether you vibe-code with Claude Code or ship software for a living, never-again gives you back the time, tokens and patience you spend fixing the same thing twice.

New to code? Building with AI?

vibe coding · prototyping · no code background needed

You describe what you want, and Claude Code builds it. Then a bug you already fixed comes back, and you're explaining it again and paying for every word. never-again remembers the fix and stops the repeat before it happens.

It writes the rule for you. When a rule is triggered, you answer one yes-or-no question.

Seasoned developer?

hooks · git pre-commit · monorepos · any agent

Your CLAUDE.md is 200 lines long, and the agent still skips part of it. never-again turns the lessons a script can check into hooks. A hook costs nothing until it fires, and the agent can't ignore a denied tool call.

The same hooks run from git, so a commit from any tool or terminal meets them.

install

Two minutes, using tools you already have.

If you have never installed a Claude Code skill before, this is the whole process. Open a terminal in your project folder, pick the column for your computer, and run the commands in order. You can run the installer again whenever you want a newer version: it adds a marked block to CLAUDE.md instead of overwriting the file, and it leaves an existing LESSONS.md alone.

macOS · Linux · WSL

requires git, bash, python 3.7+

  1. Clone and install into the repo you want guarded.
    # from your project root
    $ git clone --depth 1 https://github.com/malaysherasia-ai/claude-never-again.git
    $ bash claude-never-again/install.sh .
  2. Commit what it wrote. LESSONS.md, .claude/ and the hooks are team knowledge. The fire log and a few other local files stay on your machine, and the installer gitignores them for you.
  3. Fix a bug, then say "never again." Claude writes down the symptom, the cause and the rule, then decides whether a script can catch it.
  4. Answer the first warnings. Each new hook asks before it blocks. Your answers are recorded on their own. After five right calls in a row, you can promote the hook from ask to deny with na promote L001.

Windows

requires git for windows, python 3.7+ · fixed in v0.1.1

  1. Install Git for Windows (it includes Git Bash, which runs the hooks). You can stay in PowerShell.
  2. Check that Python really runs. python -c "import sys" must exit 0. If Windows opens the Microsoft Store instead, that is the alias stub. Turn it off under Settings, Apps, App execution aliases, or point NA_PYTHON at a real Python.
  3. Clone and install.
    git clone --depth 1 https://github.com/malaysherasia-ai/claude-never-again.git
    & "C:\Program Files\Git\bin\bash.exe" claude-never-again/install.sh .
  4. Commit, then fix a bug and say "never again." The same from here on.
    Stats: python .claude\never-again\na.

Don't use the terminal? Ask Claude Code.

auto mode off · it asks before each step · git and python 3.7+ still required

Paste this into Claude Code inside your project:

Install never-again from https://github.com/malaysherasia-ai/claude-never-again into this project and explain what it added.

Claude Code's auto mode won't run an installer it has never seen, so turn auto mode off first. It will then ask before each step; say yes. If it stops at the settings file or the git hooks, it tells you what to paste, and the docs show the two pieces.

github · counted, not generated

The numbers, as GitHub counts them.

Stars and forks from the repository, clones from GitHub's traffic API. Baked into this page once a day, then checked every minute while you have it open. When nothing changed, nothing moves.

1
stars
2,074
clones · all time
since 13 Sep, counted daily
425
clones · last 14 days
-13 vs the week before
408
unique cloners · 14 days

snapshotsource: github.com/malaysherasia-ai/claude-never-again

why it exists

A note costs tokens every turn. A hook costs one line until it fires.

Five reasons the same lesson works better as a script than as a sentence.

01

Stop paying rent on reminders.

Your AI rereads every note you give it, and you pay for that every time. A rule costs nothing until it's needed.

A 200-line CLAUDE.md costs about 2,500 tokens on every turn. Over a 100-turn session, that is 250,000 tokens spent re-reading advice. Prompt caching makes that cheap in money. It does not make it cheap in attention, and attention is what makes rules get followed.

basis: ~12 tokens per line

200
lines
~2,500
tokens per turn
100
turns
250,000
tokens re-reading advice
02

One line until it fires.

A hook sits outside the conversation. It costs nothing to carry and runs only when the moment it watches for arrives.

The protection is the same either way. A hook's check runs outside the context window, so it never competes with your code for room. It runs from git too, so a commit from any tool meets it.

03

A rule, not a reminder.

Your AI can skip a sticky note. It can't walk through a locked door.

A hook's deny runs before every permission mode, including --dangerously-skip-permissions. And the same check runs from git, so a commit from a terminal meets it too.

04

Short list, most important first.

AI follows short lists better, so never-again keeps each list to 40 rules and puts the most-used rules at the top.

IFScale (Distyl AI, 2025) tested 20 models on 10 to 500 rules at once, in a report-writing task. At 500, the best model followed 68% of them, and rules given earlier were followed more often than later ones. That task is not coding, so the tool borrows the direction, not the number.

So the rules file has a cap, na sort puts the most-fired rules first, and rules load per package.

20
models measured
10 → 500
concurrent instructions
68%
best model, at 500
05

Nothing about you leaves your computer.

No account, no telemetry, no cloud. The only thing it ever asks the internet is whether a newer release exists.

There is no account to create and no telemetry. The tool talks to GitHub for two things only: na upgrade, when you run it, and a once-a-day look at which release is newest. Neither sends anything but the request. Your stats come from a Python script that counts lines in files you already have.

2
requests, both about releases
0
accounts
0
telemetry
06

Updates are your call.

It tells you when a newer release exists. Installing it is always a command you run yourself.

After a commit, at most once a day, the after-commit hook asks GitHub which release is newest and remembers the answer. The next commit, and na itself, then say one line: never-again 1.4.0 is out: na upgrade. You decide when each repo moves. Offline, it stays quiet and asks again the next day. "updates": "off" in state.json stops the check.

comparison

Why not just write it in CLAUDE.md?

Often you should, and never-again will tell you when. The difference is what happens to the rule after you write it.

  A line in CLAUDE.md A never-again hook
Cost per turn ~12 tokens, on every turn, forever 1 lineuntil it fires
When it is wrong The agent may follow it anyway In warn mode you are asked and your answer is recorded. In block mode the call is denied and Claude is told why.
Survives a long session Competes with everything else in context Outside the context window entirely
Survives a permission bypass No deny runs before every permission mode
Ordering Whatever order it was written in na sort ranks by real fire counts
Scope Loaded everywhere, always Per package, and only for the commits and file types it watches
Evidence it works None A fire log, counted by na
Best for Judgement: taste, naming, architecture, tone Anything a script can check

None of this is an argument against CLAUDE.md. Plenty of rules need judgement that no script can make, and those belong in prose. never-again keeps its own LESSONS.md for exactly that, capped and ordered, and one of the four rungs on its triage ladder is to file nothing at all. The narrower claim is that when a script can check a rule, paying tokens to remember it is a choice.

questions

Questions worth asking first.

I'm not a developer. Is this for me?

Yes, if you build with Claude Code. You can ask Claude Code to install it for you. After that it runs in the background and only asks you a quick yes-or-no question when a rule is triggered.

What's a "hook"?

A tiny check that runs before your AI takes an action. If the check fails, the action is stopped. It works like a spell-checker that won't let you hit send until the typo is fixed.

Do I need to write rules myself?

No. When you fix a bug, never-again decides whether the fix can become an automatic check or should stay a short note, and it writes that rule for you.

Does this replace CLAUDE.md?

No. It adds a marked block to your existing CLAUDE.md that points at LESSONS.md, and it never edits outside that block. Rules that need judgement still live in prose. What changes is that rules a script can check stop being prose.

What happens when a hook is wrong?

Every new hook starts in warn mode. It asks instead of blocking. Your answer is recorded on its own: stopping counts as the hook being right, going ahead does not. If it was a false alarm, na wrong L001 says so and resets its streak. A hook that cries wolf gets narrowed, not promoted. Promotion to deny is always a human command, and na demote always reverses it.

Will it slow down every command?

No. One dispatcher runs for commits only, and it runs just the hooks that watch the file types you changed. A commit hook never runs on a file read. Ten hooks or two hundred cost the same one setup. A hook that fires on everything gets resented within a day, and the skill says so.

Does it work on Windows?

Yes, from v0.1.1. Before that it did not work. On Windows, command -v python3 finds the Microsoft Store alias stub, which exits without running anything, and every hook swallowed the failure and stayed silent. Hooks looked installed and never fired. The resolver now requires an interpreter that actually executes a statement and exits 0, and a hook with no usable interpreter says so instead of dying quietly.

What leaves my machine?

Two requests to GitHub, both about releases, and nothing else. na upgrade fetches a release when you run it. After a commit, at most once a day, the after-commit hook asks which release is newest and remembers the answer; it sends nothing but the request, and "updates": "off" in state.json turns it off. There is no account and no telemetry. na is a Python script that counts lines in files you already have. The fire log stays local and gitignored. LESSONS.md and the hooks are committed, because they are team knowledge.

What happens when LESSONS.md hits the cap?

You cannot add another rule until one is promoted to a hook or retired, and Claude has to say so plainly and suggest which one to drop. The default is 40 per file. The number that really matters is how many rules load per turn from where you are working. na reports that as "loaded here" and warns above 60. When the warning fires, split by package, retire or promote. Do not raise the threshold.

Can hooks promote themselves to blocking?

No, and that is on purpose. After five right calls in a row the tool says so once. You run na promote L001 or you do not. By default that command only works on a branch, so the change gets reviewed like code. Nothing in the tool raises enforcement on its own.

Is it really free?

MIT licensed, no paid tier, nothing hosted to pay for later. It is a skill, a few shell scripts and a Python script in your repo.