Cases

Ten times my coding agent repeated a fix it already knew. Two of them still got through.

These come from 9 months of my own Claude Code and Codex history. Each one is an error that an earlier session had already worked out, often in another repo, and that came back anyway.

I replayed every case with only the history from before that moment, and checked what nanaoki would have shown the agent. Most of the time it had the fix. Sometimes it didn't, so the misses are here too.

The message in each terminal is what nanaoki 0.1.1 prints today for the same error. I changed project names, paths and hosts. The error and the shape of the fix are real.

The verdicts come from my replay, scored by a Claude judge, on my own data. "AGENTS.md alone" is a file written from the same history and loaded on every turn.

3

caught by a guard before the command ran

5

prevented by the lesson shown after the first failure

2

missed. One lesson was wrong, one rule had no error to hook onto.

3 of 10

prevented by the AGENTS.md file alone

Showing 10 of 10

01 Shell #zsh-glob

zsh gives up on a glob that matches nothing

$ ls -a ../web/.dev.vars* (eval):1: no matches found: ../web/.dev.vars*
Before
Fixed in project-a, about 8 months earlier
This time
project-b
AGENTS.md alone
Prevented

This is my most common repeat: 471 sessions across 56 projects. Bash passes an unmatched glob through, but zsh stops the whole command. The agent adds quotes and moves on, then the next session does the same thing.

Caught by a guard before running The glob matched no file, so the guard warned and gave the quoted command.
before the command runs · PreToolUse
● Bash(ls -a ../web/.dev.vars*)└ nanaoki guard: [zsh_glob] zsh fails with "no matches found" when an unquoted glob matches no file: `../web/.dev.vars*`. Quote words with [ ] * ? (URLs, [slug] routes, --include=*.md). Suggested command: ls -a '../web/.dev.vars*'
02 Shell #zsh-equals

A row of equals signs breaks a zsh command

$ ax "…/listing/1234" --md; echo =====; ax "…/listing/5678" --md (eval):1: ===== not found
Before
Hit and fixed in project-c, about 2.5 weeks earlier
This time
a scratch folder
AGENTS.md alone
Not prevented

The agent wanted a separator between two outputs. In zsh, a word that starts with = expands to the path of a command, so ===== goes looking for a program called ====. My AGENTS.md had notes on zsh quoting, but nothing about =.

Blocked by a guard before running The command can't work as written, so this guard blocks it instead of warning.
before the command runs · PreToolUse
● Bash(ax "https://jobs.example.com/listing/1234" --md --budget 1500; echo =====; ax "https://jobs.example.com/listing/5678" --md)└ Blocked by hook. nanaoki guard: [zsh_eq] In zsh an unquoted word that starts with '=' expands to a command path, so `=====` fails with "not found". Quote it. Suggested command: ax "https://jobs.example.com/listing/1234" --md --budget 1500; echo '====='; ax "https://jobs.example.com/listing/5678" --md
03 Node/JS #node-version

The build wants Node 22. The shell has another one.

$ npm run build Toolchain check failed: expected Node 22.x for this project.
Before
Fixed in the same project, 7 hours earlier
This time
project-d
AGENTS.md alone
Not prevented

The repo pins Node 22, and a newer Node was first on PATH. One session found the fix. Seven hours later, a new session started from zero. The only Node advice in my AGENTS.md was "use bun", which does nothing for a version pin.

Caught by a guard before running The guard compares the pin with the node on PATH. If the build runs anyway, the lesson comes after the failure.
before and after · PreToolUse, PostToolUseFailure
● Bash(npm run build)└ nanaoki guard: [node_version] The repo pins Node 22 (.nvmrc) but node on PATH is 26. Switch first. Suggested command: nvm use 22 && <command>If it runs anyway:└ Toolchain check failed: expected Node 22.x for this project.└ This error matches lessons from your earlier sessions (nanaoki): [L1] The project pins a Node major version. Use the pinned version (fnm/nvm use) before install/build. Fix seen: APP_NODE=~/.nvm/versions/node/v22.22.0/bin/node npm … (project-d, 2026-09)
04 Node/JS #missing-script

A script name carried over from another repo

$ bun run gen error: Script not found "gen"
Before
Fixed in project-e, about 4.5 months earlier
This time
project-f
AGENTS.md alone
Not prevented

Most of my repos have a gen script. This one didn't. The fix is boring: read package.json before guessing. My AGENTS.md made it worse, because it told the agent to run bun run gen.

Prevented by the lesson
after the failure · PostToolUseFailure
● Bash(bun run gen)└ error: Script not found "gen"└ This error matches lessons from your earlier sessions (nanaoki): [L1] The package.json script does not exist in this workspace. Read package.json scripts first. Fix seen: bun run format:check (project-e, 2026-04)
05 Framework #sveltekit-resolve

SvelteKit lint wants resolve() on every internal link

$ bun run lint 24:25 error Unexpected href link without resolve() svelte/no-navigation-without-resolve
Before
Fixed in project-g, about 4 months earlier
This time
project-h
AGENTS.md alone
Not prevented

A newer eslint rule. Three of my SvelteKit repos hit it between September and November, and each time the agent worked out the fix from scratch. My AGENTS.md only said that two other repos had turned the rule off, which points the wrong way.

Prevented by the lesson
after the failure · PostToolUseFailure
● Bash(bun run lint)└ 24:25 error Unexpected href link without resolve() svelte/no-navigation-without-resolve└ This error matches lessons from your earlier sessions (nanaoki): [L1] SvelteKit lint: wrap internal hrefs/goto with resolve() from $app/paths (svelte/no-navigation-without-resolve). Fix seen: bunx eslint <5 files> (project-g, 2026-05)

git log in a repo with no commits yet

$ git status --short --branch && git diff --stat && git log -1 --oneline fatal: your current branch 'main' does not have any commits yet
Before
Fixed in project-i, about 5 weeks earlier
This time
project-j
AGENTS.md alone
Not prevented

A fresh repo. The agent always opens with the same look around, and git log fails until the first commit. The lesson worked, but only just. It shows the command that worked and leaves out the reason.

Prevented by the lesson
after the failure · PostToolUseFailure
● Bash(git status --short --branch && git diff --stat && git log -1 --oneline)└ fatal: your current branch 'main' does not have any commits yet└ This error matches lessons from your earlier sessions (nanaoki): [L1] Error `fatal: your current branch <q> does not have any commits yet` after `git status --short && git log --oneline -8 && if test -f web/package.json; then sed -n '1,240p' web/package.json; fi` was fixed by: git status --short; git diff --stat; git diff -- <4 files> … (project-i, 2026-08)
07 Shell #not-json

Parsing output that wasn't clean JSON

$ python3 -I -c 'import json,glob; …' json.decoder.JSONDecodeError: Extra data: line 2 column 1
Before
Fixed in project-k, about 6 months earlier
This time
project-l
AGENTS.md alone
Not prevented (the second judge said yes)

Six months earlier it was a CLI that printed a warning before its JSON. This time the files had more after the first JSON value. It's the same mistake: the agent parsed first and looked at the input second. The judge put this one at 50%, right on the line, because the earlier fix was a jq pipe and not Python.

Prevented by the lesson
after the failure · PostToolUseFailure
● Bash(python3 -I -c 'import json,glob; [json.load(open(f)) for f in sorted(glob.glob("data/q*.json"))]')└ json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 2817)└ This error matches lessons from your earlier sessions (nanaoki): [L1] CLI output was not JSON (banner, warning, or error text). Check the exit code and strip non-JSON lines before parsing. Fix seen: seo-cli keywords "…" | jq -r … (project-k, 2026-04)
08 Preferences #dont-change-yet

"Don't make any changes yet"

> how could this be fixed? just asking, don't make any changes yet
Before
I typed some version of it in 183 sessions
This time
project-m
AGENTS.md alone
Prevented

This repeat is mine, not the agent's. I ask a question and the agent starts editing files. nanaoki shows the rule at the first prompt of a session when the words match. The AGENTS.md file got it too. A rule this stable belongs in the file, and nanaoki rules suggest proposes the line for you.

Prevented by the lesson
first prompt of the session · UserPromptSubmit
> how could this be fixed? just asking, don't make any changes yet└ Lessons from your earlier sessions (nanaoki): [L1] don't make any changes yet [L2] but don't make any changes yet
09 Shell #wrong-lesson

A missing file, read as a missing tool

$ rg -n "deploy" apps/cms/CLAUDE.md apps/web/CLAUDE.md rg: apps/cms/CLAUDE.md: No such file or directory (os error 2)
Before
Same error in the same project, about 4 months earlier
This time
project-g
AGENTS.md alone
Not prevented

The agent guessed a path that didn't exist. nanaoki matched the error to the wrong cause and said the tool was missing. The tool was fine, and the file just wasn't there. A lesson that points the wrong way costs more than no lesson at all.

Missed The lesson matched the words of the error, not its cause.
after the failure · PostToolUseFailure
● Bash(rg -n "deploy" apps/cms/CLAUDE.md apps/web/CLAUDE.md)└ rg: apps/cms/CLAUDE.md: No such file or directory (os error 2)└ This error matches lessons from your earlier sessions (nanaoki): [L1] A CLI was not installed or has another name. Check with 'command -v' once, then use the right name. Fix seen: rg -n "…" … (project-n, 2026-02)
10 Preferences #code-comments

Comments that only restate the code

No error. The agent writes the code comments I keep asking it not to write.
Before
Asked for in earlier sessions. The AGENTS.md written from them has the line.
This time
project-o
AGENTS.md alone
Prevented (the second judge said no)

My rule is to comment only when the code can't explain itself. Nothing fails when the agent ignores it, so no hook fires after an error. The first prompt of the session didn't share enough words with the rule either. This is what the always-loaded file is good at.

Missed A style rule has no error for a hook to match.
first prompt of the session · UserPromptSubmit
> add the helper for the share card and comment the code└ (nanaoki printed nothing)

Your turn

Find the repeats in your own history.

My numbers come from my laptop. Yours will be different. The report takes about two minutes and tells you which errors your agents keep fixing twice.

1. Get the binary

brew tap JustinyAhin/tapbrew trust JustinyAhin/tapbrew install nanaoki

2. See your number

nanaoki --split auto

3. Install the hooks

nanaoki setup claude