blader

napkin

by @blader in Tools
53
2
# Install this skill:
npx skills add blader/napkin

Or install specific skill: npx add-skill https://github.com/blader/napkin

# Description

|

# SKILL.md


name: napkin
description: |
Maintain a per-repo napkin file that tracks mistakes, corrections, and
what works. Activates EVERY session, unconditionally. Read the napkin
before doing anything. Write to it continuously as you work β€” not just at
session boundaries. Log your own mistakes, not just user corrections. The
napkin lives in the repo at .claude/napkin.md.
author: Codex
version: 5.0.0
date: 2026-02-06


Napkin

You maintain a per-repo markdown file that tracks mistakes, corrections, and
patterns that work or don't. You read it before doing anything and update it
continuously as you work β€” whenever you learn something worth recording.

This skill is always active. Every session. No trigger required.

Session Start: Read Your Notes

First thing, every session β€” read .claude/napkin.md before doing anything
else. Internalize what's there and apply it silently. Don't announce that you
read it. Just apply what you know.

If no napkin exists yet, create one at .claude/napkin.md:

# Napkin

## Corrections
| Date | Source | What Went Wrong | What To Do Instead |
|------|--------|----------------|-------------------|

## User Preferences
- (accumulate here as you learn them)

## Patterns That Work
- (approaches that succeeded)

## Patterns That Don't Work
- (approaches that failed and why)

## Domain Notes
- (project/domain context that matters)

Adapt the sections to fit the repo's domain. Design something you can usefully
consume.

Continuous Updates

Update the napkin as you work, not just at session start and end. Write to
it whenever you learn something worth recording:

  • You hit an error and figure out why. Log it immediately. Don't wait.
  • The user corrects you. Log what you did and what they wanted instead.
  • You catch your own mistake. Log it. Your mistakes count the same as
    user corrections β€” maybe more, because you're the one who knows what went
    wrong internally.
  • You try something and it fails. Log the approach and why it didn't work
    so you don't repeat it.
  • You try something and it works well. Log the pattern.
  • You re-read the napkin mid-task because you're about to do something
    you've gotten wrong before. Good. Do this.

The napkin is a living document. Treat it like working memory that persists
across sessions, not a journal you write in once.

What to Log

Log anything that would change your behavior if you read it next session:

  • Your own mistakes: wrong assumptions, bad approaches, misread code,
    failed commands, incorrect fixes you had to redo.
  • User corrections: anything the user told you to do differently.
  • Tool/environment surprises: things about this repo, its tooling, or its
    patterns that you didn't expect.
  • Preferences: how the user likes things done β€” style, structure, process.
  • What worked: approaches that succeeded, especially non-obvious ones.

Be specific. "Made an error" is useless. "Assumed the API returns a list but
it returns a paginated object with .items" is actionable.

Napkin Maintenance

Every 5-10 sessions, or when the file exceeds ~150 lines, consolidate:

  • Merge redundant entries into a single rule.
  • Promote repeated corrections to User Preferences.
  • Remove entries that are now captured as top-level rules.
  • Archive resolved or outdated notes.
  • Keep total length under 200 lines of high-signal content.

A 50-line napkin of hard-won rules beats a 500-line log of raw entries.

Example

Early in a session β€” you misread a function signature and pass args in the
wrong order. You catch it yourself. Log it:

| 2026-02-06 | self | Passed (name, id) to createUser but signature is (id, name) | Check function signatures before calling, this codebase doesn't follow conventional arg ordering |

Mid-session β€” user corrects your import style. Log it:

| 2026-02-06 | user | Used relative imports | This repo uses absolute imports from `src/` β€” always |

Later β€” you re-read the napkin before editing another file and use
absolute imports without being told. That's the loop working.

# README.md

Napkin

A skill for Claude Code that gives the agent persistent memory of its mistakes.

The agent maintains a markdown file in your repo (.claude/napkin.md) where it tracks what went wrong, what you corrected, and what worked. It reads the file at session start and writes to it continuously as it works. By session 3-5 the behavior shift is significant β€” the agent stops making mistakes you've already corrected and starts pre-empting issues before you catch them.

Baby continual learning in a markdown file.

Install

Claude Code

git clone https://github.com/blader/napkin.git ~/.claude/skills/napkin

Codex

git clone https://github.com/blader/napkin.git ~/.codex/skills/napkin

That's it. The skill activates every session, unconditionally.

How it works

  1. Session start: Agent reads .claude/napkin.md in the current repo. If it doesn't exist, it creates one.
  2. During work: Agent logs mistakes (its own and yours), corrections, patterns, preferences β€” as they happen, not just at session end.
  3. Over sessions: The napkin compounds. Session 1 is normal. Session 3 the agent is catching things before you do. Session 5 it's a different tool.

What gets logged

  • Agent's own mistakes β€” wrong assumptions, bad approaches, failed commands
  • Your corrections β€” anything you told it to do differently
  • Tool/environment surprises β€” things about the repo that weren't obvious
  • Your preferences β€” how you like things done
  • What worked β€” successful approaches worth repeating

The napkin

Lives at .claude/napkin.md in each repo. One per repo. The agent designs the initial structure and adapts it to the project's domain.

You can .gitignore it or commit it β€” your call. Committing it means other contributors' agents benefit from the same learned patterns. Ignoring it keeps it personal.

License

MIT

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.