Local disk structure

All documents you create in Moment are stored as markdown files on your local device. There is no database, no proprietary format, and no server required to read or edit them. This page describes how documents are organized on disk.

The documents directory

All Moment docs live in the ~/.moment/documents/ directory. Each document is stored in its own subdirectory, named with a unique identifier:

Each of these directories is a self-contained Git/Jujitsu repository.

Anatomy of a document

Inside a document directory, you will find the following structure:

moment.yml

The moment.yml file is the document manifest. It contains metadata about the document and all of its pages. A typical moment.yml looks like this:

Key fields in moment.yml:

id: The unique identifier for the document, matching the directory name.

schemaVersion: The version of the document schema.

title: The display title of the document.

created: The timestamp when the document was created.

pagesMetadata: A list of all pages in the document. Each entry contains:

id: The unique page identifier. This determines the page's subdirectory name under pages/.

slug: The URL-friendly slug used for routing.

title: The display title of the page.

archived: Whether the page is archived.

parentPageID: The id of the parent page, or null for top-level pages. This defines the page hierarchy shown in the sidebar.

path: (optional) A custom path to the page file, relative to the document root. If omitted, the default location is used (see below).

type: (optional) The page type. Can be markdown (default), canvas, or request. Request pages provide a Postman-style interface for building network requests and are stored as .yml files instead of .md.

If the document has been configured for publishing, moment.yml will also contain a publishSettings section with template and URL configuration.

The pages/ directory

The pages/ directory contains one subdirectory per page. To find a page on disk:

Look up the page in moment.yml by its id or slug.

If the page has a path field, the file is at that path relative to the document root.

Otherwise, the default location for markdown pages is pages/<pageId>/index.md. For request pages, it is the same path but with a .yml extension instead of .md.

index.md

Every Markdown page directory contains an index.md file. This is the page content, written in standard Markdown. This is the file you are editing when you type in the Moment editor, and it is the file that gets rendered when someone views the page.

The related/ directory

Some page directories contain a related/ subdirectory. This is where page assets such as images are stored. When you add an image to a page in the Moment editor, the image file is placed in the page's related/ directory and referenced from index.md.

Each document is a Git repository

Every document directory is initialized as a Git repository. This means:

Full version history. Every committed change is recorded and can be inspected with git log.

Diffs and rollback. You can use git diff to see what has changed, and standard Git operations to inspect or revert changes.

Branching and merging. The Git repository supports all standard Git operations.

The Moment desktop app provides a built-in UI for committing changes and viewing history (see Committing changes), but you can also interact with the repository directly from the command line.

AGENTS.md file

When creating a new document, we also add an AGENTS.md specific to Moment documents, which is versioned. We will update this for you unless you provide explicit permission to do so.