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
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.
The rule is in CLAUDE.md, written correctly, and it still gets ignored. It was read a hundred messages ago.
Every "no, not like that" is gone the second the session ends.
You're relying on Claude to find the file, then find the mistake, then follow the rule.
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.
of the errors from Sep to Nov had a cause my agents had already fixed between Feb and Aug.
of those repeats had the fix only in a different project.
sessions across 54 projects hit the same zsh quoting error, the top repeat.
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.
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.
- ObserveRead the Claude Code and Codex sessions in
~/.claudeand~/.codex. - DetectFind error causes that come back, and the later command that worked.
- LessonTurn each fix into a short lesson: what failed, what fixed it, where.
- EnforceGuards warn before a known-bad command and give the fixed one.
- SearchFull-text search over every prompt, reply and tool output.
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%.)
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.
"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.
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.
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 | shHomebrew
brew install JustinyAhin/tap/nanaokiGo 1.26+
go install github.com/JustinyAhin/nanaoki/cmd/nanaoki@latest2. See your numbers
Errors in the last third of your history whose cause was already fixed in the first two thirds.
nanaoki --split auto3. Stop the repeats
Install the hooks. They refresh the lessons once a day in the background.
nanaoki setup claudenanaoki setup codexFor 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 claudeasks theclaudeCLI to fetch the plugin from GitHub. - Read-only. It reads
~/.claudeand~/.codexand 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.