napkin
Skill9 starsChanged 2 months agoMITView on GitHub
Error learning loop. Keeps a mistakes.log at the repo root, one line per mistake with its root cause and a prevention rule. Reads it before writing code and names the entries it is avoiding; appends a new entry the moment a test fails because of Claude's change, the user corrects Claude, a review finds a defect, or a command fails on a wrong assumption. Use when the user says "napkin", "log this mistake", "don't do that again" or "you did this before", before writing code in any repo that has mistakes.log, and right after any self-caused error. Composes with ponytail and claude-mem.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- letitbk/claude-academic-setuptheir own version, first seen Nov 1, 2026
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- tammai/bigin-skillstheir own version, first seen Oct 11, 2026
- 01sadra/napkintheir own version, first seen Aug 20, 2026
- ReaperOAK/ForgeOStheir own version, first seen Jun 8, 2026
- madeinlowcode/skills-claude-codetheir own version, first seen Apr 3, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- github/awesome-copilot★ 42ksame name
- blader/napkin★ 591same name
- letitbk/claude-academic-setup★ 219same name
- madeinlowcode/skills-claude-code★ 7same name
- 01sadra/napkin★ 2same name
- seaneoliver/claude-code-starter★ 2same name
- tammai/bigin-skills★ 1same name
- ReaperOAK/ForgeOS★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context/CLAUDE.mdCLAUDE.md
- api-designSkill
- backendSkill
- cavemanSkill
- claude-memSkill
- commitSkill
- evaluator-optimizerSkill
- founder-skillSkill
- frontend-design-systemSkill
- interactive-live-testingSkill
- module-planningSkill
- multi-agent-orchestrationSkill
- plan-featureSkill
- ponytailSkill
- prSkill
- ralph-loopSkill
- review-boardSkill
- reviewSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- verification-before-completionSkill
- verificationSkill
- work-recordingSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Read before code: Before writing or editing code, grep mistakes.log for the files, modules, libraries and kinds of change you are about to …
- Very specific: line 24
One line per entry, append-only: Never edit or delete a past entry.
- Distinctive: line 68
Next id: read the last entry's id and add one.
- Very specific: line 74
Before code, when entries match: one line, Avoiding M-NNN (<rule, short>), M-NNN (<rule, short>).
- Very specific: line 75
After logging: one line, Logged M-NNN: <rule>.
- Distinctive: line 82
With ponytail: run the napkin check first.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Napkin: the error learning loop
You are an engineer who keeps a napkin in their pocket, writes down every mistake the moment it happens, and reads the napkin before starting anything new. You are not embarrassed by mistakes. You are embarrassed by repeating one.
Input: $ARGUMENTS
The problem this fixes
Claude makes the same mistake in session 9 that it made, and was corrected for, in session 2: the wrong import path, a test-runner flag that does not exist, the API that returns cents rather than dollars. The correction lived in a chat that is gone. Napkin turns each correction into a durable, greppable rule that is checked before the next attempt.
Rules
- Read before code. Before writing or editing code, grep
mistakes.logfor the files, modules, libraries and kinds of change you are about to touch. Name the matching entries in one line before the code. No match means say nothing. - Log at the moment of error, not at the end. Append an entry as soon as one of these happens: a test or build fails because of your change; the user corrects you; a review (human or agent) finds a defect you introduced; a command fails because you assumed a path, flag, name or config. Fix first if it is quick, then log, in the same turn.
- Root cause, not symptom. "Test failed" is a symptom. "Assumed
amountwas dollars; the API returns integer cents" is a cause. If you cannot name the cause, debugging is not finished. - Every entry ends in a rule. The rule is an instruction a future session can follow without any context: imperative, specific, checkable. "Be careful with money" is not a rule. "Convert API amounts with
toMoney(); never divide by 100 inline" is. - One line per entry, append-only. Never edit or delete a past entry. If a rule turns out wrong, append a new entry that supersedes it (
supersedes M-007). - Promote on the third strike. When the same rule is hit three times, propose promoting it to the project's permanent rules (the gotchas section of
CLAUDE.md, or a.claude/rules/file) and mark the entrypromoted. The log is the inbox; the rules are the law. - Codebase facts only. Log mistakes about this project's code, tools and conventions. Preferences about how the user likes to work belong in Claude's own memory, not here. Never log secrets or personal data.
Format
M-001 | 2026-11-28 | billing/invoice.ts | Divided the API amount by 100 inline, double-converting it | Amounts arrive as integer cents and toMoney() already converts | Use toMoney(); never divide amounts inlineFields, separated by |: id (increasing, never reused), date, area (file, module or tool), what went wrong, root cause, rule. Append | promoted or | supersedes M-NNN when it applies.
The first time, create the file with a one-line header:
# mistakes.log | id | date | area | mistake | root cause | rule | append-only, see the napkin skillExamples
Example 1: a weak entry and a strong one
Bad: M-004 | 2026-11-20 | tests | Tests broke | Oops | Be more careful
Good: M-004 | 2026-11-20 | vitest | Ran "npx vitest --watch=false", which this repo's vitest 0.34 rejects | Assumed the v1 CLI flag | Use "npx vitest run" for one-shot runs
Example 2: reading the napkin before code
Task: add a refund endpoint in billing/.
Bad: write the endpoint straight away, and divide the refund amount by 100 inline again.
Good: grep -n -i "billing\|amount\|refund" mistakes.log returns M-001 and M-012, so the output opens with Avoiding M-001 (use toMoney(), no inline /100) and M-012 (refunds need the idempotency key header). Then the code.
Example 3: the user corrects you
User: "No, we don't use axios here, it's the fetch wrapper in lib/http.ts."
Good: fix the code to use lib/http.ts, then append M-015 | 2026-11-28 | lib/http.ts | Imported axios for a new client call | Did not check for an existing HTTP wrapper | Use lib/http.ts for all HTTP; grep for an existing wrapper before importing a client, and say in one line that it was logged.
Tool usage
- Before code:
grep -n -i "<file>\|<module>\|<library>" mistakes.log. Read the whole file only when it is under 100 lines. - Logging: append to the end of the file in a single write (an Edit anchored on the last line, or
>>). Never rewrite the file. - Next id: read the last entry's id and add one.
- Promotion: count strikes with
grep -c "<rule keyword>" mistakes.log. Propose the promotion to the user; never editCLAUDE.mdor rule files silently. - Size: once the log passes 200 lines, propose a consolidation: promote recurring rules, and move entries older than the latest promotion into
mistakes.archive.log. Never delete.
Output format
- Before code, when entries match: one line,
Avoiding M-NNN (<rule, short>), M-NNN (<rule, short>). - After logging: one line,
Logged M-NNN: <rule>. - On a third strike: one line,
M-NNN has hit 3 times. Promote "<rule>" to CLAUDE.md?
Nothing else. Napkin should cost a line of output, not a paragraph.
Composition
- With ponytail: run the napkin check first; a logged rule beats a shorter solution.
- With claude-mem:
PROJECT_CONTEXT.mdlinks tomistakes.login its See also section and never copies entries. - With the kit's systematic-debugging skill: debugging finds the root cause; napkin makes the lesson permanent.
- With the Operating Standard: a logged mistake is an honest finding; never leave one out to make a report look tidy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

