Dreamwrite Project Format (v1)
A Dreamwrite project is an ordinary folder of Markdown files. Everything Dreamwrite knows about a project can be read and edited with any text editor, synced with any file-sync service, and versioned with git. The app never requires a proprietary container.
The Glass Orchard/ ← project root (any folder name)
dreamwrite.yaml ← project manifest (settings, labels, statuses, …)
AGENTS.md ← guidance for AI assistants working on the project
dictionary.txt ← optional: project spelling dictionary, one word per line
Manuscript/ ← the draft (Scrivener's "Draft"); compiled in order
_folder.md ← optional: the folder's own text + metadata
01 Part One/
_folder.md
01 Arrival.md
02 The Orchard.md
02 Part Two/
01 Frost.md
Characters/ ← any number of top-level folders
01 Mara Voss.md
Places/
Timeline/ ← optional: timeline-only events (documents with a story-date)
Research/
01 Map of Vell.png
01 Map of Vell.png.meta.yaml ← optional sidecar metadata for non-text files
02 Orchard reference.pdf
Notes/
Templates/ ← document templates (Scrivener "Templates" folder)
Trash/
.dreamwrite/ ← app-managed data; preserve snapshots and production revision locks
snapshots/<doc-id>/<timestamp>[ title].md
originals/<doc-id>/<timestamp> <file name> ← files as they were before "Convert to UTF-8"
history.jsonl ← writing history (daily word counts)
state.json ← UI state (tabs, splits, folders, cursor and scroll positions)
index/ ← this disk's: caches, and where each item is (see below)
nodes.bin ← metadata index: makes opening large projects fast
identity.json, identity.log ← where each item is, by id, on this disk (see below)
exports/ ← files assistants compiled (MCP `compile`); safe to delete
Editor positions are optional UI state in .dreamwrite/state.json, not document
frontmatter. editorPositions maps document IDs to CodeMirror-compatible selection
ranges (anchor, head, and primary range index main). Positions are clamped to
the current text length after external edits. editorScroll maps the JSON-encoded
view mode and selected IDs to scroll offsets and, for a long Document View, a visible
document anchor and offset. Unknown state keys are retained. Restoring these values
does not modify authored files; cursor/scroll updates are staged and debounced.
Ordering and hierarchy
The folder tree is the binder. Children are ordered by a numeric prefix
(NN␠, zero-padded to at least two digits) on the file or folder name. Items without
a prefix sort after prefixed items, alphabetically. Dreamwrite renumbers siblings when
items are moved; external tools may add unprefixed files and Dreamwrite will adopt them.
Top-level folders are ordered by binder.roots in dreamwrite.yaml; unlisted
top-level folders appear after listed ones. Special roles are assigned in the
manifest (roles.manuscript, roles.research, roles.trash, roles.templates),
defaulting to the folder names shown above.
Documents
| Extension | Kind | Notes |
|---|---|---|
.md | text | Markdown with YAML front matter |
.fountain | script | Screenplay in Fountain with YAML front matter |
folder + _folder.md | folder | a folder may have its own text, like Scrivener |
| anything else | file | research material: PDF, images, audio, video, HTML, … |
The title is title: in front matter; if absent it is the file name without its
numeric prefix and extension. Renaming a document in the app renames its file (the
title is sanitized for the filesystem; the exact title is kept in front matter).
File names made from titles work on every platform: / \ : * ? " < > | become -,
leading and trailing dots and spaces (and a trailing ~) are dropped, Windows device
names get a _ (CON → CON_, com1.txt → com1_.txt), and the name is cut to 80
characters and 150 bytes (UTF-8) without splitting a character, so the order prefix,
the extension and a .meta.yaml sidecar always fit the usual 255-byte limit. A path
longer than the platform allows (260 characters on Windows) is refused with a message.
Moving, renaming and renumbering items is all or nothing: if any rename fails (a file
locked by another program, no permission), the ones already done are undone. While an
operation runs, items briefly carry hidden temporary names that remember their real
name: .dwmove-<ULID>-<name> (renumbering), .dwmv-<ULID>-<name> (moving to another
folder) and .dwnew-<ULID>… (creating or importing). If Dreamwrite is interrupted
(a crash, a power cut), the next scan puts such items back under their names (adding
“(recovered)” if the name is taken) once they are older than 30 seconds. Creating an item in a
folder that has moved or gone outside Dreamwrite since the binder read it (a sync, a file manager)
is refused, and the binder reads the project again: writing it would make a folder of the old name
again, without the folder's own text.
Front matter
All fields are optional. Unknown fields are preserved.
---
id: 01J9ZK3Q6W8X4T2B5N7M1C0D9E # stable id (ULID); assigned on first open
title: "Arrival"
synopsis: Mara reaches Vell at dusk and finds the orchard already frozen.
label: Scene # one of project labels (colors in manifest)
status: First Draft # one of project statuses
keywords: [Mara, orchard, frost]
compile: true # include in compile (default true in Manuscript)
section: Scene # section type used by compile formats
target: 2500 # document word-count target
language: de-DE # optional: spelling and quote style for this document
icon: leaf # icon name
pov: Mara # custom metadata fields are top-level keys
story-date: 1912-11-03 # YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDTHH:MM (Timeline)
story-end: 1912-11-04 # optional end of the story time, shown as a span
plotline: Main # list field used as Plot Grid rows (any list field works)
notes: |
Document notes (Markdown). Scrivener's per-document notes.
bookmarks:
- "[[Mara Voss]]"
- https://example.com/reference
---
A document (or a folder's _folder.md) without an id is valid. Dreamwrite knows it by an id it
writes into the file the first time it writes that file anyway: a save, a binder move, renumber or
retitle, or (in a project synced with Dreamwrite Cloud) a sync cycle. It never rewrites an unchanged
file only to add one. A folder without text of its own is known by when it was made and which folder
it is (its birth time and inode, where the disk keeps them), and where the disk keeps no birth time by
the project's record of where each item is (below), so renaming or renumbering it in the binder keeps its
id without a file written into it; renamed outside Dreamwrite, it gets a new one. Ids are ULIDs; a cycle's first id for a document the server has without one is
a ULID with no time in it (all zeros in its first ten characters), derived from the project, the path
and that version, so that every device gives the same one (see docs/DREAMWRITE-CLOUD.md, "Which
document a file is").
Codex entries (documents in top-level folders such as Characters, Places, World, Items or Factions, or any document labelled Character / Location) may also have:
aliases: [Mara] # other names, used to find mentions in scenes
relations: # explicit relationships (Relationship Map)
- { to: Ilse Brandt, type: sister }
Folders shown on the freeform corkboard keep their cards' positions in their own
front matter (freeform: {<child id>: [x, y]}). Boards imported from Scapple also
carry freeform-links: [{from: <id>, to: <id>, arrow: true}] (the connections
between notes) and freeform-shapes: [{x, y, w, h, label}] (background shapes).
A sync service's conflict copy keeps its original's id, by design: that's what finds the original.
When Dreamwrite writes a copy's file (its metadata changed, the copy trashed), it adds copy-id:, the
name it knows the copy by, so that the copy's snapshots and open tabs are still its own after a rename
and a restart. It's never a document's id.
Custom metadata fields are declared in dreamwrite.yaml (metadata:) with a type
(text, checkbox, list, date, number), but any key round-trips.
The Trash
Moving an item to the Trash (a folder's in its _folder.md) writes where it came from, so Put
back can return it there:
trashed-from: 01J9ZK3Q6W8X4T2B5N7M1C0D9F # the folder's id
trashed-place: # its place in that folder
from: 01J9ZK3Q6W8X4T2B5N7M1C0D9F # the folder this place was taken in
folder: Characters # only when that is a top-level folder: its name (NFC)
index: 1 # its index among the folder's items then
follows: [01J9ZK3Q6W8X4T2B5N7M1C0DA0] # the items before it, nearest first (up to 4)
precedes: [01J9ZK3Q6W8X4T2B5N7M1C0DA1, 01J9ZK3Q6W8X4T2B5N7M1C0DA2] # after it, nearest first
at: 2026-11-12T10:31:05.123Z # when it was trashed (UTC, RFC 3339)
Neighbours are named by id, and only items whose id is written in their file (the same on every
device); conflict copies aren't counted. Items trashed together name each other. Put back takes
both keys away and puts the item in that folder (a top-level folder found by folder when its id
isn't known here: one without a text of its own has an id of its own on each device; names compare
in Unicode normal form C, as a Mac spells them in NFD and other devices in NFC), right after
the nearest item it followed that is in the folder now; failing that, right before the nearest it
preceded; failing that, at index, or the end. Several put back at once go in the order they
stood, so they come back together and in order, whichever was trashed first and in whatever order
they're asked for: the latest trashing goes back first, and items trashed together in the order
they stood. Each place was taken in the folder as the trashings before it left it, so undoing them
in turn rebuilds it. Which trashing was the later the places themselves say: one that names
another of the items among its neighbours was taken while that one was still in the folder, so it
goes back after it (two that name each other were trashed together). Only items whose places can't
tell (too far apart to name each other) go by at, newest first, then by index; places without
at (an older Dreamwrite's) after those with one. at comes from the trashing device's clock, so
only those may come back in the order of two devices' clocks that disagree. Both keys travel with the file, so an item trashed on one device is put back
in place on another.
Without trashed-place (an item trashed by an older Dreamwrite, or by hand), or with one whose
from isn't trashed-from (left by an older Dreamwrite's Put back, which removes only
trashed-from, and from a later trashing in another folder), the item goes to the end of its
folder, as it always did; without a folder that's still there (and not in the Trash), to the end
of the Manuscript. A stale trashed-place from the same folder puts it beside its neighbours of
that earlier time. Trashed on two devices at once, the server's trashed-from and trashed-place
stand together and whole (merged key by key they would be a place the item never had, or a place
naming another folder), with no conflict copy and no note.
Dreamwrite 0.10.12 and 0.10.13 recorded a place as trashed-between: [previous, next] instead, the
ids of the item's two neighbours ("" at an edge). An item with that key and no trashed-place
is put back beside the neighbour it followed, else before the one it preceded, else at the start
if it stood first. The key is no longer written, and goes when the item is put back or trashed
again.
Body syntax
CommonMark + GFM (tables, task lists, strikethrough, autolinks) plus:
| Syntax | Meaning |
|---|---|
[[Title]], [[Title|shown text]], [[Title#Heading]] | link to another binder item (updated automatically on rename) |
^[text] | inline footnote; [^label] + [^label]: text also supported |
{>>comment<<} | inline annotation / comment |
{==text==}{>>comment<<} | comment anchored to text |
{>>@Name: comment<<} | comment with author |
{++inserted++}, {--deleted--}, {~~old~>new~~} | tracked changes (CriticMarkup); accepted/rejected in-app |
{++new++}{>>@Name<<} | tracked change with its author (an author-only comment; see below) |
{==highlight==} | highlight |
[text]{.style} / ::: style … ::: | named character / paragraph style (Pandoc syntax) |
<$n>, <$wc>, <$title>, … | compile placeholders (see Compile) |
%% comment %% | author-only comment, stripped at compile |
*** or * * * on its own line | scene break (rendered by compile per format) |
<!-- pagebreak --> on its own line | page break (written by the importers for Word/ODT/RTF page breaks) |
[text]{.underline}, [text]{.smallcaps} | underline / small caps (imported from Word, ODT, RTF, HTML) |
 | images; paths relative to the document (wrap paths containing spaces in <…>, or use %20); a trailing attribute block such as {width=50%} sets its display size |
$E = mc^2$, $$ … $$ on their own lines | inline / display LaTeX math |
[@key], [@key, p. 12], [see @a; @b], [-@key] | citation of bibliography entries (Pandoc syntax); - suppresses the author |
@key, @key [p. 4] | in-text citation ("Doe (2020)") |
{#fig:x} after an image, : Caption {#tbl:x} after a table, # Heading {#sec:x}, $$…$$ {#eq:x} | cross-reference labels |
@fig:x, [@fig:x], [-@fig:x], @Fig:x | cross-references ("figure 1", "1", "Figure 1") |
::: {#refs} … ::: or <$bibliography> | where the compiled bibliography goes (default: after the last chapter) |
Images
Image paths are relative to the document (for a folder's text, to _folder.md).
Use  for paths with spaces or parentheses;
percent-encoded paths also work. Legacy unwrapped paths with spaces still preview
and compile when the referenced file exists. Opening a document never migrates its
text. A small Fix image path button below a resolved legacy image wraps its path
in <…>; this is an ordinary undoable edit.
Dropping image files from the desktop or browser onto a Markdown editor copies them into the project's Research folder (created if needed), then inserts relative image links at the drop position. The original files stay in place. Undo removes the inserted links and keeps the imported assets. Dragging an existing binder image inserts a link without copying it.
Pandoc image attributes go immediately after the image, for example:
{#fig:vell .map width="50%" height='2in'}
The block accepts #id, .class, and key=value with unquoted, single-quoted or
double-quoted values. Width and height accept %, px, in, cm, mm, pt, and
pc; bare numbers mean pixels at 96 dpi. HTML/EPUB use CSS dimensions. DOCX, ODT,
and PDF/Typst use the requested physical size; percentage width refers to the page's
text width after margins and gutter, and percentage height to its text height.
A single dimension keeps the image's aspect ratio; two dimensions set both axes.
Invalid or unsupported sizes are ignored. Markdown/Pandoc export preserves the
attribute block, including unknown attributes. Resizing in the editor changes only
width. An image alone in a paragraph remains a figure with its caption; #fig:
labels also retain figure numbering and cross-references.
dreamwrite.yaml
The supported version marker is the integer format: 1. Plain folders without a
manifest and manifests without a format marker retain unversioned compatibility;
they are not treated as a historical format 0. Explicit other markers (including
zero, negative/fractional numbers, strings and null) are refused before opening
can recover temporary files or write caches/presence locks. If the marker changes
externally while open, writes are paused until it is restored by the originating
application or opened with a version that supports it. Reads and filesystem change
notifications remain available, and the UI shows a persistent notice until the
marker is restored. Closing always releases the presence lock, skipping history
writes while the guard is active. The last verified decision is cached by file
length, modification time and file identity where available; unchanged metadata
does not cause another marker read. I/O failures retain the last verified
decision and retry on later operations; a file that has never been readable reports
its I/O error. Missing manifests retain plain-folder compatibility. Failed watcher
batches report an error and trigger a full rescan on the next filesystem event.
Malformed YAML retains the existing document-recovery behavior, while settings
remain protected against overwrite. No older version is currently defined, so
there is no invented migration or automatic version rewrite. Any future migration
must define its input format and create a verified backup before changing files.
format: 1
title: The Glass Orchard
author: Russell Busch
language: en-US
binder:
roots: [Manuscript, Characters, Places, Research, Notes, Templates, Trash]
roles: { manuscript: Manuscript, research: Research, trash: Trash, templates: Templates }
labels:
- { name: Scene, color: "#6ea8fe" }
- { name: Chapter, color: "#f0a860" }
statuses: [To Do, First Draft, Revised Draft, Final Draft, Done]
keywords:
- { name: Mara, color: "#e07a5f" }
metadata:
- { key: pov, name: POV, type: list, options: [Mara, Ilse, Tomas] }
- { key: story-date, name: Story date, type: date }
plotlines: # Plot Grid row colors (names are the field's options)
- { name: Main, color: "#e07a5f" }
sectionTypes: [Part, Chapter, Scene, Front Matter, Back Matter]
targets: { draft: 90000, session: 1000, deadline: 2027-03-01, countFrom: manuscript,
countFootnotes: true, countComments: false } # what word counts include
typography: { smartQuotes: true, smartDashes: true } # overrides the app preference
collections:
- { name: Needs revision, ids: [01J9…] }
- { name: Mara scenes, search: { query: "keyword:Mara" } }
compile: { presets: [...] } # see docs/COMPILE.md
citations: # bibliography for [@key] citations (see docs/COMPILE.md, Citations)
bibliography: references.bib # .bib / CSL-JSON .json / Hayagriva .yaml; a list, or an absolute path (Zotero auto-export)
style: apa # bundled CSL style name or a .csl file
locale: en-US # optional
zotero: false # also search a running Zotero (Better BibTeX) in the citation picker
git: { autoCommit: onClose } # onClose | hourly | off (default)
backup: { onClose: true, intervalMinutes: 30, keep: 25, folder: ~/Backups/Glass, maxSizeMB: 2048 }
revisions: { current: Blue, sets: [White, Blue, Pink] } # scripts, see below
Script revisions
Screenplays in production are revised in coloured sets. revisions names the revision
being written and the colour sequence (the default sequence is shown):
revisions:
current: Blue # changes since the last lock are Blue revisions
sets: [White, Blue, Pink, Yellow, Green, Goldenrod, Buff, Salmon, Cherry]
Locking a revision (Script → Lock Script Revision, command script.lockRevision)
saves the text of every .fountain document in the Manuscript as the baseline in
.dreamwrite/revisions/baseline/<id>.fountain, records the lock (name, date) in
.dreamwrite/revisions/state.json, and moves current to the next colour. The state also contains a production page
map (pages.documents, pages.pages, pages.scenes): the locked source texts,
source line/column anchors, original page labels, and scene numbers. Keep this file
when copying a production project. Existing pages retain their labels; overflow
uses A/B suffixes, while empty locked intervals print as OMITTED pages. Relocking
captures inserted pages without renumbering the original pages. script.unlockRevision
clears page/scene locks and revision tracking, restoring ordinary pagination. Lines that
differ from the baseline are revised: the screenplay PDF marks them with an asterisk in
the right margin and puts “Blue Rev. 09/30/26” in the header of those pages (options in
compile presets under script). Documents are never changed by locking. PDF, FDX, script reports and the editor use
the same locked labels. script.paginate accepts both id and unsaved text so the
editor can resolve production anchors before saving; its labels array and each
break's label carry printable numbers (the numeric page remains a physical index).
compilePreset (written by the UK stage, radio and comic templates) names the preset
used for page counts in the script editor.
Script formats
compilePreset may select screenplay, stage-play, uk-stage-play, radio-drama
(numbered BBC radio), bbc-radio-scene, bbc-radio-taped, bbc-taped-drama, bbc-tv, or comic-script.
Project Settings → Script Format stores optional project-wide layout defaults:
script:
format: bbcTapedDrama # auto, screenplay, stagePlay, ukStage, radio, bbcRadioScene, bbcRadioTaped, bbcTapedDrama, bbcTv, comic
elements:
action: { left: 0, right: 0, caps: false, spaceBefore: 1 }
dialogue: { left: 1, right: 1.5, lineSpacing: 2 }
Elements are scene, action, character, parenthetical, dialogue, transition,
centered, lyric, and note. Left/right margins are inches inward from the body
text margins (a six-inch screenplay text area); spacing uses 12-point Courier lines.
spaceBefore is 0–10 lines; lineSpacing is 1–3. Omitted properties inherit the
format's defaults. Editor pagination and PDF compile share these metrics. Compile
presets can override them under options.script.elements. Layout changes retain
production page identities, creating overflow pages where necessary.
Assistant and checker conventions
- Character and place sheets (documents under
Characters/,Places/, … or labelled Character/Location) may declarealiases: [Mara, Miss Voss](other names used in the text) andborn: 1889-04-02(or a year); thenamesandtimelinechecks use them. check-ignore: [style, dialogue/said-bookism](ortrue) in front matter silences checks for a document;{>>dw-ignore<<}or{>>dw-ignore: style/passive<<}inside a paragraph (or on its own line just before it) silences them for that paragraph.dreamwrite.yamlmay containcheck: { ignore: [style/filler], allow: [Vel, grey], maxSentenceWords: 40, echoWindow: 40 }.- Suggestions from assistants are ordinary CriticMarkup; a comment written directly
after a change (
{~~old~>new~~}{>>@Claude: reason<<}) belongs to that change, and further adjacent comments are replies. Seedocs/AGENTS-INTEGRATION.md.
Assistant policy and private items
What connected assistants (the MCP server) may do is set in dreamwrite.yaml:
assistants:
enabled: true # false: every tool is refused and no resources are listed
allowDirectEdits: false # write_document, and new documents in the Manuscript or Templates
allowMetadata: false # set_metadata (synopses, status, labels, titles)
The defaults (shown) make assistants suggest-only: they read, search, run checks,
propose CriticMarkup suggestions, comment, and create new documents outside the
Manuscript and Templates. The app preferences (prefs.json in the app's config
folder) may hold assistants: {enabled: false}, which turns assistants off for every
project on the computer; a project can't override it. There is one resolution —
defaults, then the project, then the app-wide switch — used by every tool, the
resource list and the tool list.
Private items. assistants: false in a document's front matter (or a folder's
_folder.md, covering everything inside it; ai: false is accepted too) hides it
from assistants. Privacy is transitive: nothing derived from a private item appears in
any assistant-visible output — outline, reads, search, check findings (names, aliases
and progressions from a private sheet aren't used), statistics and word frequencies,
the project dictionary's sheet names, review items, resources, and compiled exports.
An assistant compile leaves out private documents and anything that reaches them —
<$include:…> transclusion, private front/back matter folders, collection and
selection members, embedded images inside private folders, and private items of other
books in a box set (a book whose project has assistants turned off is refused) — and
its result says that private items were left out. A preset whose compile folder is
private, and Pandoc output in a project with private items, are refused.
Where exports may be written. Compile and export commands never replace the
author's files. From the app or the CLI, an output path may not be a project
document or metadata sidecar, dreamwrite.yaml, AGENTS.md, CLAUDE.md,
dictionary.txt, or anything inside .dreamwrite/ (except .dreamwrite/exports/)
or .git/ — of any open project. Assistant exports go to .dreamwrite/exports/ (the
default; a relative output is a file name there, without ..), or to a new file
outside the project folder: in an existing folder that isn't hidden and isn't inside
another Dreamwrite project, with the format's extension. Paths are resolved before
they are checked, so .. segments and symbolic links count as where they lead.
Post-processing commands and compile hooks don't run for assistant exports.
Authors, change comments and replies
A comment is {>>text<<}; {>>@Name: text<<} gives it an author. A comment with
only a name, {>>@Name<<} (or {>>@Ann Example:<<} — without a colon the whole
comment is the name), is an author-only comment: it has no text of its own.
Comments written directly after a change (no space between) belong to it:
| Markup | Meaning |
|---|---|
{++ quietly++}{>>@Ann Example<<} | an insertion by Ann Example, with no comment |
{~~cat~>dog~~}{>>@Claude: livelier<<} | a substitution by Claude, with Claude's comment |
{--very --}{>>@Ann<<}{>>@Bob: agreed<<} | a deletion by Ann, and a comment on it by Bob |
{++x++}{>>@Claude: why<<}{>>@Ann: ok<<}{>>@Bob: fine<<} | Claude's change and comment, then two replies |
- If the first comment is author-only, it names the change's author and is not shown as a comment.
- The first comment with text is the change's comment. Its author is the change's author unless an author-only comment came first.
- Every further adjacent comment is a reply in the thread.
The same holds after an anchored comment or a lone comment:
{==passage==}{>>@Ed: unclear<<}{>>@Ann: fixed<<} is a comment by Ed with a reply by
Ann. A change without an author is attributed to the project author when exported.
Dates are not recorded in the text.
Word, LibreOffice and RTF round trips use this convention: DOCX/ODT export writes each
change with its author (w:author, dc:creator), the change's comment as a Word
comment anchored on the changed text, and replies as a real Word thread
(commentsExtended.xml); importing turns them back into the same markup, and Word
highlights into {==highlights==}. Compiled DOCX files carry a hidden bookmark
_dw_<id>_<hash> around each document's text so an editor's returned copy can be
imported onto the original documents as suggestions (File › Import Edited Word File as
Suggestions…, import.reviewDocx / import.applyReviewDocx).
Planning, codex and research data
These keys are optional; Dreamwrite writes them when you use the matching feature.
In dreamwrite.yaml:
targets:
sessionMinutes: 45 # daily writing-time target (alongside `session` words)
streak: target # streaks count days that met the target; `any` = any writing day
calendar: # an invented calendar for story dates (Timeline, timeline check)
name: Reckoning of Vell
months: [{ name: Frostmoon, days: 30 }, { name: Thaw, days: 31 }]
weekdays: [Moonday, Tideday] # optional
era: AR # optional, shown after years
leap: { every: 4, month: 2 } # optional: that month gains a day every N years
shared: # folders shared with other books of a series
- ../Series Bible/Characters
check:
fillers: [basically] # your own style lists, added to the built-in ones
hedges: [kind of]
cliches: [crack of dawn]
redundancies: ["end result => result"]
remove: [very] # built-in phrases never to flag
languagetool: # optional grammar checking; off unless enabled
enabled: true
url: http://localhost:8081
language: auto
consent: http://localhost:8081 # the server you agreed to send text to
stats:
stopwords: [the, a, …] # your "common words" list for word frequency
Story dates in a project with a calendar keep the YYYY-MM-DD form, with MM
counting that calendar's months. .dreamwrite/replace-history.json records project-wide
replaces (for one-step undo) and .dreamwrite/sprints.jsonl the writing sprints.
In front matter:
| Key | Where | Meaning |
|---|---|---|
progressions: [{at, note, set: {…}}] | codex entries | state from a scene (title or id) or story date on, e.g. set: {status: dead} |
portrait: <image title> | character sheets | image shown in the Inspector |
born, gender, role | character sheets | used by the timeline check and script statistics |
codexType: character|place|item|faction|lore | Templates documents | which codex folder a template is for |
beat, structure | chapters and scenes | created by Insert Story Structure |
nameList: true | any document | the body is a name list for the name generator ([female], [male], [surname] sections) |
freeform: {links, notes, images, refs} | folders | the freeform canvas's connectors, sticky notes, images and linked cards |
pins: [{x, y, to, label}] | image sidecars | map pins (fractions of the image size) linking to documents by title |
pdfAnnotations: [{page, rects, text, note, color}] | PDF sidecars | your highlights and notes (the PDF is never modified) |
A linked research file is a NN Title.dwlink file containing target: (absolute path)
and relative: (relative to the project folder); the file itself is not copied.
Snapshots, history, backups
Snapshots are complete copies of a document at a point in time, stored under
.dreamwrite/snapshots/<id>/.
Saving never overwrites a change made outside Dreamwrite. Each save from the editor
names the version its text started from (a hash of the body it loaded); if the text on
disk is no longer that version (a sync service, an assistant, another editor or
window changed it), the save is refused and both versions are kept as snapshots
(“Changed outside Dreamwrite …” and “Your unsaved changes …”) until the author keeps
one. MCP read_document returns the base in structuredContent.base; pass it as the
optional base of write_document for the same conflict checks. Writers without a
base version (the CLI, scripts, older MCP clients) still keep an
outside change they haven't seen as a snapshot before overwriting it. Saves go to a
uniquely named hidden temp file (.<name>.<ULID>.dwtmp) that is synced and renamed
over the document, and on Unix the folder is synced too.
A document that isn't UTF-8 text opens read-only. Convert to UTF-8 rewrites it as
UTF-8 (UTF-16 with a byte-order mark is decoded as such, other bytes as Windows-1252)
after copying the original file, byte for byte, to .dreamwrite/originals/<id>/. Writing history is appended to
.dreamwrite/history.jsonl (one JSON object per day). Automatic backups are zip
archives named <Title> <YYYY-MM-DD HHMM>.zip, written outside the project (default:
the platform data folder, …/Dreamwrite/Backups/<Title>; set backup.folder to change
it). They exclude .git, .dreamwrite/index, lock.json, tmp/ and import/, and of
.dreamwrite/cloud/ (this folder's Dreamwrite Cloud data) all but the sync's trash and set-aside
versions (trash/, conflicts/) and the notes the writer hasn't seen (lasting-notes.json,
lasting-notes.pending/), which point to snapshots; the newest
backup.keep are kept. Whether anything changed since the last backup doesn't count
.dreamwrite/cloud/ (every sync cycle rewrites its record) or state.json. A zip made to share (Export,
backup.now with share), a Save As copy and a template carry none of the device's own state, one list
for all of them (dw_cloud_proto::paths::DEVICE_LOCAL, also what never syncs and what git ignores):
.dreamwrite/index/, cloud/, copies.json, copies-pending/, project-id.json (an import gets an id of its own),
lock.json, state.json, exports/, conflict-resolutions/, new.json, import/ and tmp/. A Save
As copy, being on this computer, keeps copies.json and copies-pending/ (its conflict copies are still this computer's
words; the record's entries are marked with this installation, so elsewhere they aren't taken for that
computer's). A
backup for this folder keeps what a restore here needs, as above, and a restored backup never brings
another folder's sync record.
A project larger than backup.maxSizeMB (default 2048, i.e. 2 GB; 0 for no limit) is
not backed up: the writer is told its size and the folder holding most of it.
Where each item is
.dreamwrite/index/identity.json is the core's record, for every project, of where each binder item is:
{"v":2,"items":{"<id>":{"p":"Manuscript/02 Frost.md","i":1234,"b":…,"s":…,"m":…,"k":[…]}}}, one entry
per item, with which file or folder it is on this disk: i its inode (on Windows its creation time),
b its birth time in nanoseconds where the disk keeps one, a file's size s and modification time m
(ms) as Dreamwrite last wrote or read it, and for a folder k, up to eight of the ids directly in it;
any missing is 0 or empty, not known. Between reads of the project, identity.log beside it takes one
JSON line an operation: {"move":<from>,"to":<to>} written before each binder rename (everything under a
folder goes with it), {"set":<id>,"item":{…}} for an item saved or made. The next read folds the log in
and writes the file whole (atomically); so does a process whose log passes 256 lines. An entry counts only
where the disk agrees with it: lost, stale or copied, it's ignored, never trusted. An inode alone isn't
enough, as a file system gives a freed one to the next file made, at the same path too (ext4 and f2fs; FAT
numbers files by where their entry sits; NTFS hands a file made where one was deleted that one's creation
time): an item without an id of its own takes the record's id only while path, inode, birth time where
known, and for a folder one of the items it had, all agree; a document without an id is never carried
(its id is its path and birth time or inode, as before). A file that carries its id in its front matter
is told from a copy of it by path, inode and birth time. A record of format 1 is ignored. "f": true marks a
file a read found carrying an id the record had as another file (a copy whose original was deleted):
the record follows it, but it isn't the binder's word for it, so a sync that merges another device's
change into it keeps its words as a snapshot first; the binder's own move clears it. It's what
tells, among files with one id, which one is the document (see docs/DREAMWRITE-CLOUD.md, "Which
document a file is"), and what keeps the id of a folder without text that the binder moves. It belongs to this folder on this disk: it never syncs, and isn't in
git, backups or copies of the project. Deleting it is safe; ids that only it held (a folder without text
on a disk without birth times) then come from paths again.
The metadata index
.dreamwrite/index/nodes.bin lets a project open without re-parsing every document.
For each text document (by path) it holds the front-matter block exactly as it is in
the file, the metadata parsed from it, and the body's length, a 64-bit hash and word
count. Opening still reads every file; a document is only parsed again when its
front-matter bytes or its body hash differ from the index, so the index can never make
Dreamwrite show (or save) metadata that isn't in the file, even when an edit keeps the
file's size and modification time. Research sidecars and files that aren't UTF-8 are
always read directly.
The index is a pure cache in a private binary format. It starts with a magic number,
a format version, a fingerprint of the Dreamwrite build, the project folder it was made
for and a checksum; Dreamwrite ignores and rebuilds it when any of these doesn't match
(a damaged or truncated file, another version, a copied or moved project). It is
written atomically after opening when something changed, only for projects with a
dreamwrite.yaml, and never by a read-only (shared) view. It is safe to delete at any
time, is excluded from backups and is ignored by git.
Version control
A project can be a git repository (or live inside one). Dreamwrite's built-in version
control uses the git command-line tool when it is installed; initializing adds a line to .gitignore
for each entry of the device's own state (see "Backups" above: .dreamwrite/index/, .dreamwrite/cloud/,
.dreamwrite/copies.json, .dreamwrite/project-id.json and the rest) and *.dwtmp (a commit of everything
adds any line missing, and a repository that tracks .dreamwrite/cloud/ or .dreamwrite/copies.json
from before stops, git rm --cached, the files staying in the folder). With
git.autoCommit, changes are committed when the project closes (onClose) or at most
hourly while writing (hourly), with messages like
"Writing session: +1,204 words in 5 documents".
Spelling
dictionary.txt in the project root holds project-specific words (one per line, #
starts a comment) and is not a binder item. Titles of items in folders named
Characters, Places, Locations, People, Cast, Settings or World, items labelled
Character or Location, and keywords are accepted automatically.
Compatibility promises
- Dreamwrite never rewrites a file it has not changed.
- Compiling or exporting never replaces a project document or setting (see "Assistant policy and private items").
- Front-matter key order and unknown keys are preserved.
- A project remains valid if
.dreamwrite/is deleted (snapshots, history, UI state, and production revision baselines/page locks are lost). - Files added, edited, renamed or deleted externally are picked up live.