napkin
AGENTS.md428 starsChanged 2 months agoMITView on GitHub
Local-first CLI for Obsidian vaults. Operates directly on markdown files — no Obsidian app required. Designed as a memory system for AI agents using progressive disclosure. .napkin/ holds config. Content lives in the project directory:
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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 52
Output triple: Every command supports --json, --quiet, and human-readable output
- Distinctive: line 55
Fingerprint caching: search and overview cache their results keyed by vault file mtimes — any file change invalidates.
- Very specific: line 76
Import and register in src/main.ts as a Commander subcommand
- Very specific: line 77
Use the output() helper for triple output
- Very specific: line 78
Add tests in src/commands/<name>.test.ts
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
napkin
Local-first CLI for Obsidian vaults. Operates directly on markdown files — no Obsidian app required. Designed as a memory system for AI agents using progressive disclosure.
Commands
bun run dev -- <command> # Dev
bun test # Tests
bun run check # Biome lint + formatArchitecture
src/main.ts— Commander entry point, global --json/--quiet/--vault/--copy flagssrc/commands/— One file per command groupsrc/core/tokenizer.ts— Overview tokenizer (noise stripping, stopwords, term counts)src/templates/— Vault template definitions (coding, personal, research, company, product)src/utils/output.ts— Chalk output helpers, triple output (json/quiet/human)src/utils/exit-codes.ts— Standardized exit codessrc/utils/vault.ts— Vault discovery (walks up from cwd looking for .napkin/)src/utils/vault-internals.ts— Owner of napkin-internal files + skip directoriessrc/utils/files.ts— File listing, resolution (wikilink-style name or exact path)src/utils/frontmatter.ts— YAML frontmatter parse/set/removesrc/utils/config.ts— Unified config (load/save/update, syncs to .obsidian/)src/utils/markdown.ts— Extract headings, tasks, tags, links from markdownsrc/utils/fingerprint.ts— Whole-vault mtime fingerprint (keys both caches)src/utils/search-cache.ts— Search index cachesrc/utils/overview-cache.ts— Overview result cache (fingerprint + options key)skills/— Agent skills shipped in the npm package:distill(conversation → vault notes) andtend(periodic vault upkeep)
Vault Structure
.napkin/ holds config. Content lives in the project directory:
project/
.napkin/ # napkin config + caches
config.json # Unified config (syncs to .obsidian/)
search-cache.json # Auto-managed, safe to delete
overview-cache.json # Auto-managed, safe to delete
.obsidian/ # Obsidian config (auto-generated)
NAPKIN.md # Level 0 context note
decisions/ # Template-defined dirs
architecture/
Templates/ # Note templates
src/ # Project source (not in vault)Key Patterns
- Output triple: Every command supports
--json,--quiet, and human-readable output - Vault auto-detect: Walks up from cwd looking for
.napkin/directory .napkin/holds config + caches: Vault content lives in the project root;.napkin/holdsconfig.jsonand the auto-managed search/overview caches- Fingerprint caching: search and overview cache their results keyed by vault file mtimes — any file change invalidates; caches are safe to delete
- Search engine:
@shift-labs/ferrosearch— native, MiniSearch-compatible (index format included);minisearchremains a devDependency as the cache-migration test oracle - File resolution: positional
<file>or--fileresolves by name (like wikilinks),--pathrequires exact path from vault root - No Obsidian dependency: Pure file-system operations on markdown files
- Progressive disclosure: overview → search → read (4 levels, L0-L3)
- NAPKIN.md: Level 0 context note, rendered at top of overview
- Templates:
napkin init --template <name>scaffolds vault structure + note templates
Progressive Disclosure
| Level | Command | What it does |
| L0 | NAPKIN.md | Always-loaded context (rendered in overview) |
| L1 | napkin overview | Vault map with search-validated domain keywords per folder |
| L2 | napkin search <query> | BM25 + backlinks + recency ranked results with snippets |
| L3 | napkin read <file> | Full file content |
Adding a New Command
- Create
src/commands/<name>.ts - Export an async function with
(args, options: OutputOptions)signature - Import and register in
src/main.tsas a Commander subcommand - Use the
output()helper for triple output - Add tests in
src/commands/<name>.test.ts
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.

