---
description: claude-obsidian: LLM Wiki Pattern for Obsidian vaults. Always-on context for any project pointed at this repo.
globs:
  - "wiki/**/*.md"
  - ".raw/**/*"
  - "skills/**/SKILL.md"
alwaysApply: true
---

# claude-obsidian

A Claude Code plugin and Obsidian vault that builds persistent, compounding knowledge bases using Andrej Karpathy's LLM Wiki pattern. This repo works with Cursor's AI through the cross-platform Agent Skills format.

## What This Project Is

- **Vault root**: contains `wiki/` (agent-generated knowledge) and `.raw/` (source documents: immutable)
- **Hot cache**: `wiki/hot.md` (~500 tokens) holds recent session context
- **Index**: `wiki/index.md` is the master catalog Claude reads first
- **Skills**: 10 skills under `skills/<name>/SKILL.md` define ingest/query/lint/save/canvas/etc

## Skills Available

| Skill | When to use |
|---|---|
| `wiki` | Scaffold new vault, route to sub-skills |
| `wiki-ingest` | Ingest a file, URL, or image: creates 8-15 wiki pages |
| `wiki-query` | Answer questions from the wiki (Quick / Standard / Deep modes) |
| `wiki-lint` | Health check: orphans, dead links, gaps |
| `save` | File current conversation as a wiki note |
| `autoresearch` | Autonomous research loop |
| `canvas` | Create/edit Obsidian canvas files |
| `defuddle` | Clean web pages before ingest |
| `obsidian-markdown` | Obsidian syntax reference |
| `obsidian-bases` | Obsidian Bases (.base files) |

Read the relevant `skills/<name>/SKILL.md` file when the user's request matches a skill's trigger phrases.

## Critical Conventions

1. **Never modify `.raw/`**. Sources are immutable
2. **Read `wiki/hot.md` first** when starting a session (if it exists)
3. **Use wikilinks** (`[[Note Name]]`) for all internal references in wiki pages
4. **Frontmatter is flat YAML**. See `skills/wiki/references/frontmatter.md`
5. **Append to `wiki/log.md`**, never edit past entries
6. **Hot cache is overwritten** at session end (it's a cache, not a journal)

## Setup for Cursor

To make these skills first-class in Cursor, run:

```bash
ln -s "$(pwd)/skills" .cursor/skills
```

Or use the bundled installer:

```bash
bash bin/setup-multi-agent.sh
```

## Cross-Reference

- Plugin: https://github.com/AgriciDaniel/claude-obsidian
- Pattern: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
- Related: https://github.com/kepano/obsidian-skills
