> ## Documentation Index
> Fetch the complete documentation index at: https://docs.9thprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vault

> A folder of linked markdown that 9p navigates instead of re-reading your codebase.

A vault is a folder of markdown notes linked with `[[wiki links]]`. 9p reads the
index, follows links to what's relevant, and writes back what it learns. It's an
Obsidian vault if you point Obsidian at it, but Obsidian is optional. The
structure is what matters, not the app.

## Setup

```bash theme={null}
9p init          # choose "vault"
```

Creates the scaffold and records the path in `.9p/config.json`:

```
vault/
  INDEX.md        master map. Everything reachable from here
  jobs/           reusable procedures the agent follows step by step
  decisions/      what was decided and why
  daily/          one note per working day
  projects/       one folder per project, master note named after the folder
  graph/          generated codebase maps (9p map)
```

## Mapping the codebase

```bash theme={null}
9p map
```

Explores the project and writes concise wiki notes into `graph/`: an index plus
one note per module, each linking to related notes. Re-run it to refresh; it
updates notes in place rather than duplicating.

This routes on `economy` bias deliberately: it's bulk read-and-summarise across
a whole repo.

## The index-note pattern

The pattern that makes this work: **every folder has a master note named after
the folder**, wiki-linked to everything inside it.

```markdown vault/jobs/release/release.md theme={null}
# Release

1. Confirm CI is green on `main`
2. Follow [[changelog]] to write release notes
3. Run the steps in [[deploy-steps]]
4. Announce per [[announce-template]]
```

9p reads one note, follows the links, and arrives fully briefed. You don't have
to tell it which files to read.

## Decisions

The highest-value notes are the ones git can't reconstruct, *why* something is
the way it is:

```markdown vault/decisions/why-no-orm.md theme={null}
# Why we don't use an ORM

Decided 2026-03-14. Query shapes are join-heavy and we kept fighting the query
planner. Rejected: Prisma (migration story), Drizzle (fine, but the win didn't
justify the rewrite). Affects [[db-layer]], [[repository-pattern]].
```

Months later, "why was this decided?" has an answer.

## Daily notes

Ask 9p to log at the end of a session:

```
9p ❯ write today's daily note: what we finished, what's next, what's blocked
```

Put a short index at the top of each daily note. Future sessions scan indexes
instead of reading every note in full.

## Anti-bloat

Worth stating in your [`9P.md`](/memory):

```markdown theme={null}
Vault rules:
- Append to an existing note; only create a new note when genuinely necessary
- Every new note must be linked from its folder's master note
```

Without a rule like that you accumulate hundreds of near-duplicate notes, and a
sprawling vault is worse than none, the agent trusts stale notes over the code.

<Note>
  Point Obsidian at the folder if you want the graph view. It's a good way for
  *you* to see the shape of the knowledge; 9p reads the markdown either way.
</Note>
