> ## 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.

# Memory

> Standing instructions 9p reads at the start of every session.

Every session starts from zero unless you give it something to start from.
`9P.md` is that file.

## Two files

| File          | Scope                                                |
| ------------- | ---------------------------------------------------- |
| `~/.9p/9P.md` | Global — applies in every project                    |
| `./9P.md`     | Project — applies here, and wins where they disagree |

Both are loaded automatically. Create them with:

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

## What belongs in it

Standing instructions — the things you'd otherwise retype every session:

```markdown 9P.md theme={null}
# Project

Payments API. Node + Fastify + Postgres, deployed on Fly.

## Conventions
- Errors: return `Result<T, AppError>`, never throw across a module boundary
- Tests: Vitest, colocated as `*.test.ts`
- No default exports

## Workflow
- Run `npm run check` before saying a task is done
- Never edit `db/schema.sql` by hand — write a migration
```

What works: conventions that aren't obvious from the code, commands you always
want run, and hard rules ("never do X").

What doesn't: restating what the code already says. That goes stale and 9p will
trust it over the source.

<Warning>
  Memory is capped at 8,000 characters. Past that it's truncated — and a bloated
  `9P.md` crowds out the actual conversation. Keep it tight.
</Warning>

## Keeping it current

A useful line to include:

```markdown theme={null}
Update 9P.md before every commit if conventions changed.
```

## Beyond a single file

For anything larger than standing instructions — decisions, per-feature notes,
daily logs — use a [vault](/vault), which is a folder of linked markdown 9p can
navigate rather than load wholesale.

## Precedence

Global loads first, project second. Where they conflict, the project file wins
by appearing later. Both are injected as standing instructions, not as
conversation, so they survive `/clear`.
