Your coding agent fixed this error last month. In another project. Then it forgot.

nanaoki reads the Claude Code and Codex history already on your machine, finds the mistakes your agents keep repeating, and shows them the fix that worked last time, at the moment the same error comes back.

curl -fsSL https://raw.githubusercontent.com/JustinyAhin/nanaoki/main/install.sh | sh
View on GitHub Local. No LLM, no network, no account. Free, MIT.

The problem

Every session starts from zero.

Developers on Reddit, X and Hacker News describe the same loop. The agent hits an error, works it out, and the next session hits it again.

It made the same mistake again, then explained it already knew this breaks things.

r/ClaudeCode, on a MISTAKES.md file

The rule is in CLAUDE.md, written correctly, and it still gets ignored. It was read a hundred messages ago.

r/ClaudeCode

Every "no, not like that" is gone the second the session ends.

X

You're relying on Claude to find the file, then find the mistake, then follow the rule.

r/ClaudeCode, on the same thread

Lightly edited from public Reddit and X posts.

So I counted it on my own history.

9 months of Claude Code and Codex logs on my laptop: 3,030 Codex sessions and about 18K tool errors.

40%

of the errors from Sep to Nov had a cause my agents had already fixed between Feb and Aug.

68%

of those repeats had the fix only in a different project.

465

sessions across 54 projects hit the same zsh quoting error, the top repeat.

181

sessions where I typed some version of "don't make any changes yet".

Why not just CLAUDE.md

I tested the rules file first.

I took 108 real repeats from my history and replayed them. Two AI judges (Claude and GPT, 93% agreement) scored whether each setup would have prevented what happened next.

Setup
Repeats prevented
Context per trigger
No memory
Prevented0%
Context0 tokens
An AGENTS.md written from the earlier historyLoaded into context on every turn
Prevented~31%
Context~1,700 tokens, every turn
nanaoki lessons, shown at the moment of the errorOnly the lessons that match the error
Prevented53-59%
Context~36 tokens

A rules file is good for stable decisions, like "commit only when I say so". On those it wins, so nanaoki rules suggest proposes lines for your file. It loses on the long tail of one-off errors, and on fixes that live in another repo.

Read these numbers with care. They come from one person's data, on my own history, and from a replay scored by models, not live use. Run it on your history and see what yours are.

How it works

From old sessions to the right fix, at the right moment.

One Go binary. Everything it finds comes from regex rules over logs that are already on disk.

  1. ObserveRead the Claude Code and Codex sessions in ~/.claude and ~/.codex.
  2. DetectFind error causes that come back, and the later command that worked.
  3. LessonTurn each fix into a short lesson: what failed, what fixed it, where.
  4. EnforceGuards warn before a known-bad command and give the fixed one.
  5. SearchFull-text search over every prompt, reply and tool output.
nanaoki --split auto

Your number, in one command

Errors in the last third of your history whose cause an earlier session already fixed, and in which project. (The 40% above is a fixed Feb-Aug / Sep-Nov split; auto picks its own thirds, so here it says 41%.)

nanaoki report, repeat-after-fix section: 2,323 of 5,698 error episodes hit a cause that was already fixed, with a table of the top repeated causes.
Guard and lesson messages that the agent sees before and after a command.
Plugin hooks

Warn before, remind after

Before a known-bad command, the agent gets the fixed command. After a failure, it gets the lesson from the session that fixed it, even in another repo.

nanaoki search results, grouped by session with highlighted matches.
nanaoki search

"Did we fix this before?"

Answers rank above tool calls that only grep for the words. The past-sessions skill tells your agent to use it.

nanaoki

The full report

Coverage, repeated errors, time lost, rules you keep typing, a monthly trend, and a suggested fix for each top item. --format json gives the file and line behind each number.

Top of the nanaoki report: coverage and the most repeated errors.

Screenshots use --anon, which hides project names, session ids and home paths. Use it when you share your report.

Install

Two minutes to your own number.

1. Get the binary

macOS or Linux. Windows: the zip on the releases page.

curl

curl -fsSL https://raw.githubusercontent.com/JustinyAhin/nanaoki/main/install.sh | sh

Homebrew

brew install JustinyAhin/tap/nanaoki

Go 1.26+

go install github.com/JustinyAhin/nanaoki/cmd/nanaoki@latest

2. See your numbers

Errors in the last third of your history whose cause was already fixed in the first two thirds.

nanaoki --split auto

3. Stop the repeats

Install the hooks. They refresh the lessons once a day in the background.

nanaoki setup claude
nanaoki setup codex

For Codex, trust the hooks in /hooks after setup.

Privacy

Your sessions stay on your machine.

Session logs hold your code, your clients and your mistakes. nanaoki was built to read them without sending a byte anywhere.

  • Local only. No account, no telemetry, no server.
  • No LLM. Every count comes from regex rules you can read.
  • No network. It makes no network calls. The one exception: nanaoki setup claude asks the claude CLI to fetch the plugin from GitHub.
  • Read-only. It reads ~/.claude and ~/.codex and never changes them.
  • One folder. It writes only to ~/.local/share/nanaoki/. Delete it to remove everything.

FAQ

Questions

Does it send my code anywhere?

No. nanaoki makes no network calls and has no account. The index, the lessons and the report stay in ~/.local/share/nanaoki/. The only network step is nanaoki setup claude, which asks the claude CLI to fetch the plugin from GitHub.

Which agents does it work with?

Claude Code and Codex. It reads both histories and finds fixes across them, so a fix from a Codex session can show up in Claude Code. It runs on macOS, Linux and Windows.

Does it slow my agent down?

One hook call takes about 15 ms at p95 on my laptop. If a hook fails, it fails open and the agent goes on. The hooks stay quiet on probes like test -f or a grep with no match.

What does it cost?

Nothing. It is free and open source under the MIT license.

Do I still need CLAUDE.md or AGENTS.md?

Yes, for stable decisions. In my replay the file beat lessons on those. nanaoki rules suggest prints lines for your file from the instructions you keep typing. It never writes the file.

My history is short. Is it worth it?

Claude Code deletes transcripts after 30 days by default. Set "cleanupPeriodDays": 3650 in ~/.claude/settings.json to keep them. The report gets more useful as the history grows.