AI assistants and Dreamwrite
Dreamwrite projects are plain Markdown, so any assistant can read them. To let assistants contribute safely — proofreading, line editing, continuity checking, style sheets, reports — Dreamwrite provides four pieces:
| Piece | What it gives the assistant |
|---|---|
dreamwrite CLI | Outline, read, search, check, suggest, review, snapshot, compile from a shell |
dreamwrite mcp | The same as a Model Context Protocol server (tools, resources, prompts) |
| Deterministic checks | check.run: names, spelling variants, repetition, style, punctuation, dialogue, timeline, links, metadata, markup — fast, offline |
Skills (skills/) | Instructions for doing each job well: proofread, line-edit, copyedit-style-sheet, continuity-check, developmental-edit, beta-reader, dialogue-audit, repetition-audit, synopsis-and-outline, pitch-materials, character-bible, fact-check, sensitivity-read, translation-draft, screenplay-format, compile-and-publish, and the base dreamwrite-project skill |
The central idea: assistants propose, authors decide. Edits arrive as CriticMarkup
suggestions ({~~old~>new~~}{>>@Claude (AI): reason<<}) that the author accepts or
rejects in Dreamwrite's review pane. By default a project is suggest-only; direct
rewrites and metadata edits need the author's explicit permission, and always snapshot
the document first.
Dreamwrite itself contains no AI and makes no network requests: you bring the assistant (Claude Code, Codex, Claude Desktop, Cursor, …) and connect it to your local project.
Install the command-line tool
The app is also the dreamwrite command. In the app, Tools › Connect an AI Assistant ›
Install Command-Line Tool puts a small dreamwrite launcher on your PATH, and the same
dialog shows the commands below with this installation's paths filled in. Without the
launcher, run the app itself with cli (or mcp) first:
| Installation | The command |
|---|---|
| macOS, deb, rpm | /Applications/Dreamwrite.app/Contents/MacOS/dreamwrite-app cli, dreamwrite-app cli |
| Windows | dreamwrite.exe, next to the app |
| AppImage | /path/to/Dreamwrite.AppImage cli |
| Snap Store | dreamwrite-studio.dreamwrite (or dreamwrite, once the store's alias is installed: sudo snap alias dreamwrite-studio.dreamwrite dreamwrite) |
| Flathub | flatpak run com.dreamwritestudio.Dreamwrite cli |
From a checkout of this repository, cargo build --release -p dw-cli builds it as
target/release/dreamwrite. Check with dreamwrite --version.
Every command works on the project given with -p/--project, or the nearest folder
above the current directory containing dreamwrite.yaml. Documents can be named by id,
path (Manuscript/01 Part One/02 Frost.md, or with titles: Manuscript/Part One/Frost),
or title. Add --json for machine-readable output.
cd "~/Writing/The Glass Orchard"
dreamwrite outline # binder with ids, labels, status, words, synopses
dreamwrite cat Arrival --meta # one document with front matter
dreamwrite cat --manuscript --limit 5000 # the draft in order, paged by words
dreamwrite check --checks names,timeline # deterministic checks
dreamwrite suggest Arrival --find "the the" --replace "the" --comment "doubled word"
dreamwrite review list # pending suggestions and comments
dreamwrite help agents # the guide assistants should read
Connect an MCP client
The server speaks MCP (protocol 2025-06-18, also accepting 2025-03-26 and
2024-11-05) over stdio. Point it at a project with --project; without it, the
server uses the project containing its working directory, and every tool also accepts
a project argument.
Claude Code
claude mcp add dreamwrite -- dreamwrite mcp --project "/path/to/The Glass Orchard"
# or, to share it with everyone working in the project folder (.mcp.json):
cd "/path/to/The Glass Orchard" && claude mcp add --scope project dreamwrite -- dreamwrite mcp
Codex CLI — in ~/.codex/config.toml:
[mcp_servers.dreamwrite]
command = "dreamwrite"
args = ["mcp", "--project", "/path/to/The Glass Orchard"]
Claude Desktop, Cursor, VS Code, Gemini CLI and other clients — the usual
mcpServers entry:
{
"mcpServers": {
"dreamwrite": { "command": "dreamwrite", "args": ["mcp", "--project", "/path/to/The Glass Orchard"] }
}
}
Suggestions and comments are signed with the client's name (Claude, Codex, …) or
--author "Name".
Tools
| Tool | Purpose |
|---|---|
project_outline | Binder tree with ids, titles, labels, status, words, synopses |
read_document | Front matter + body of one document |
read_manuscript | The manuscript in compile order, paged by words (offset, limit) |
search | Full-text/regex search with filters (label:, status:, keyword:, in:manuscript, meta.pov:) |
run_checks | Deterministic checks; findings with line, byte offsets and suggested fixes |
get_metadata / set_metadata | Document front matter (or project settings); id is protected; set_metadata only when metadata changes are allowed |
suggest_edits | The default way to edit: CriticMarkup suggestions, all-or-nothing |
add_comment | Comment anchored to a passage |
list_review_items | Pending suggestions and comments |
write_document | Replace a body (snapshot first) — only when direct edits are allowed, and on request |
create_document | New document or folder (reports go in Notes/; the Manuscript and Templates need direct edits) |
project_dictionary | The project dictionary and sheet names — words never to flag |
take_snapshot | Snapshot a document |
project_stats | Word counts, targets, readability |
character_sheet | Character/place sheets and where each name appears |
compile | Compile with a preset or format into .dreamwrite/exports/ (or a new file outside the project); private items are left out (listed when the compile engine is present) |
Search results are paged by matching document. MCP search accepts offset (default
0), limit (default 20, range 1–200), and max_per_doc (default 10, range 1–1000).
Its text reports full totals and the next offset; structuredContent contains
documents, matches, offset, limit, nextOffset (null at the end), and a
hits summary. Continue with nextOffset to inspect every matching document.
Private documents are excluded before computing totals and pages.
CLI dreamwrite search orchard --limit 50 --offset 50 retrieves the second page.
The default limit is 50; --limit 0 requests every matching document. --max
(default 20) controls snippets per document, and --json stays an array of hits.
For command API clients, search.run returns an array with defaults of 100 documents,
20 snippets per document and a 500-snippet page budget. offset skips matching
documents; limit: 0 explicitly requests all documents (default 200 snippets each).
maxMatchesPerDoc controls snippets independently of document paging. The page
budget always permits at least one snippet per returned document, so it is a soft
cap. Use search.query for a page with full documents, matches and more totals.
A document's count is complete even when its snippets are truncated.
The server re-reads the project before each call, so edits made in the app or an editor are always seen; the app picks up the assistant's changes through its file watcher.
Resources: dreamwrite://outline, dreamwrite://manuscript, and every document as
dreamwrite://doc/<id> (also advertised as a resource template).
Prompts: proofread, line-edit, continuity-check, developmental-feedback,
beta-read — each takes optional doc (a document or folder) and focus.
Permissions and privacy
What an assistant may do is a project setting (Tools › Connect an AI Assistant, stored
in dreamwrite.yaml), enforced by the MCP server:
assistants:
enabled: true # false: every tool is refused, no resources are listed
allowDirectEdits: false # write_document, and creating documents in the Manuscript or Templates
allowMetadata: false # set_metadata (synopses, status, labels, titles)
Without permission, write_document and set_metadata aren't offered in tools/list
and are refused with a message telling the assistant to suggest instead. Allow
assistants on this computer in the same dialog is the app-wide switch
(assistants.enabled in the app preferences): off, it refuses every tool in every
project, whatever the project says. The server resolves the policy one way for
everything (defaults, then the project, then the app-wide switch), including the tool
list of a server started without --project.
Exports. compile never replaces the author's files. Without output (or with
just a file name) the file goes in the project's export folder, .dreamwrite/exports/;
an absolute output must be a new file outside the project folder, in an existing,
non-hidden folder that isn't inside another Dreamwrite project, with the format's
extension. Paths into the project, existing files, .. escapes and links back into
the project are refused, and post-processing commands and compile hooks don't run.
(The app and the CLI apply the same rule to the author's own compiles and exports,
minus the assistant-only limits: nothing may replace a project document, sidecar,
dreamwrite.yaml, AGENTS.md, dictionary.txt, or files in .dreamwrite/ or
.git/.)
Private documents. Front matter assistants: false on a document or a folder (and
so everything in it) hides it from assistants: it's left out of project_outline,
read_manuscript, search, run_checks, list_review_items, project_stats,
project_dictionary, character sheets, compile and resources, and reading or
editing it is refused (the refusal doesn't name it). Privacy is transitive: those
tools work on the project without its private items, so names and aliases from a
private sheet, its words in statistics, and its text through <$include:…>, front or
back matter, collections, embedded images or another book of a box set never reach
the assistant. compile leaves such content out and says so in its result (rather
than refusing), so the export may be incomplete; it refuses when the preset's compile
folder is private, for Pandoc output in a project with private items, and for a box
set containing a project with assistants turned off. Snapshots, history, git and
backups aren't exposed over MCP at all. Assistants can't change the flag. Hide items from the Agents dialog or with Hide from Assistants in the
command palette. (This governs Dreamwrite's tools; an assistant that also has
unrestricted shell or file access to the folder is asked by the skills to respect it,
but only the operating system can enforce that.)
Provenance. Everything the MCP server writes is attributed @Name (AI) — the name
comes from the client (Claude, Codex, …) or --author — so assistant work is
recognizable in the file itself, shown with a bot avatar and an AI tag in Review, and
filterable. When the author accepts an assistant's change, the accepted text is
appended to .dreamwrite/provenance.jsonl; documents an assistant creates get
created-by: in their front matter.
Activity log. Every tool call (time, client, tool, documents, refused or not) is
appended to .dreamwrite/assistant-log.jsonl and shown in the Agents dialog, with
Clear. For read_manuscript the documents are the ones on the page returned.
Snapshots. Accepting or rejecting several suggestions at once, Accept All, and accepting any single assistant change first snapshot each affected document.
Hiding the tools. The app preference Show assistant review tools hides the toolbar's Review button and the assistant dialog in menus and the palette (the Review view stays available from View › Review for human collaborators).
Install the skills
Skills are folders with a SKILL.md (YAML front matter name and description, then
instructions), following the Agent Skills convention. They are bundled in the binary:
dreamwrite skills list
dreamwrite skills install # ~/.claude/skills (personal, Claude Code)
dreamwrite skills install --dest "/path/to/project/.claude/skills" # one project, Claude Code
dreamwrite skills install --dest "/path/to/project/.agents/skills" # tools using .agents/
dreamwrite skills install --dest ~/.codex/skills --only proofread,line-edit
The Snap Store version can't write hidden folders in the home folder, so from the snap pass a
project's .claude/skills or .agents/skills; the app's install buttons do the same.
Existing files that differ are not overwritten without --force. Assistants without
skills support can read dreamwrite help agents (the base skill) and the AGENTS.md
that Dreamwrite writes into every new project.
The review workflow in the app
- The assistant proposes:
suggest_edits/dreamwrite suggestinsert{~~old~>new~~},{++added++}or{--removed--}, each followed by{>>@Assistant: reason<<};add_commentinserts{==passage==}{>>@Assistant: note<<}. - The editor shows them as tracked changes; the review pane lists every item with its
author, reason and replies (
review.list). - The author accepts or rejects items one by one or all at once (
review.accept,review.reject), replies (review.reply), and resolves comments. Resolving keeps the thread in the text, marked with a final{>>@Name: [resolved]<<}reply; it can be reopened (review.reopen), a later reply reopens it, and Delete Resolved (review.deleteResolved) clears them. Strip Notation (review.strip) removes comments, highlights and%%notes%%after snapshotting. Compile always uses the accepted reading.
Human co-authors and editors
- Review copies: File › Share for Review writes a small Dreamwrite project (a zip or
a folder) with the chosen documents, Revision Mode on, and a "Read Me First" page
explaining CriticMarkup for reviewers using any text editor. File › Merge Returned
Review merges it back: a three-way merge of the shared text, the current text and
the reviewer's copy, so the reviewer's tracked changes and comments arrive
attributed to them, their untracked edits become tracked changes, and edits the
author made since sharing are kept (
review.share,review.merge). - Git: pulls that diverge can be merged; conflicts are resolved in Version History
with a paragraph-level three-way merge view (
git.conflicts,git.resolveConflict,git.finishMerge,git.abortMerge). - Sync services: conflict copies from Dropbox, iCloud Drive, OneDrive, Syncthing
and Google Drive are flagged in the binder, never compiled, and resolved in Tools ›
Resolve Sync Conflicts (keep either, keep both, merge as suggestions, or merge by
paragraph) (
conflicts.list,conflicts.compare,conflicts.resolve). - Read-only sharing:
dreamwrite serve --host 0.0.0.0 --read-only --project <folder>shares a read-only view on the local network behind a generated access token.
Command shapes (for the UI and scripts)
All commands go through Workspace::dispatch(cmd, args); project is the project key.
Offsets are UTF-8 byte offsets into the document body (after the front matter).
check.list → [{name, description, rules: [rule…]}]
check.run {project, checks?: [name…], ids?: [id…], minSeverity?: "info"|"warning"|"error", limit?}
→ {findings: [{check, rule, severity, id, title, start, end, line, excerpt, message, suggestion?}],
summary: {total, byCheck, bySeverity, documents, words, ms}}
suggest.apply {project, id, suggestions: [{find, replace, comment?, occurrence?}], author?, dryRun?, minimal?}
→ {applied: [{index, start, end, markup}], body, items: [ReviewItem…]}
errors (nothing written): text not found · ambiguous (lists occurrences) · overlapping · markup tokens in text
review.list {project, ids?} → {items: [ReviewItem…]}
ReviewItem = {id, title, index, kind: insertion|deletion|substitution|comment|highlight,
start, end, line, old?, new?, anchor?, comment?, author?, replies: [{author, text}], excerpt}
review.accept / review.reject {project, id, changes: [index…] | "all"} → {changed, body, items}
review.resolveComment {project, id, comments: [index…] | "all"} → {changed, body, items}
review.addComment {project, id, find | offset, comment, author?, occurrence?} → {start, end, body, items}
review.reply {project, id, index, text, author?} → {body, items}
index values are per document and change after each edit — use the items returned
by every command. A comment directly after a change belongs to it (its comment and
author); further adjacent comments are replies. An author-only comment ({>>@Ann<<}) only names the
change's author; see "Authors, change comments and replies" in docs/FORMAT.md.
import.reviewDocx {project, path, root?}
→ {editor, source: bookmarks|alignment, documents: [{id, title, matched, insertions,
deletions, substitutions, comments, highlights, untracked, total,
changedSinceExport, basedOnSnapshot, conflicts: [text…]}], unmatched: [text…], warnings}
import.applyReviewDocx {project, path, apply?: [id…], root?, snapshot?: true}
→ {editor, documents: [...], snapshots, tree}
import.reviewDocx previews an editor's returned DOCX against the original documents
(nothing is written); import.applyReviewDocx writes the suggestions, snapshotting
each changed document first.
Tuning the checks
-
Per paragraph:
{>>dw-ignore<<}or{>>dw-ignore: style, names<<}(alsocheck/rule, e.g.style/passive). -
Per document: front matter
check-ignore: [dialogue/said-bookism]ortrue. -
Per project, in
dreamwrite.yaml:check: ignore: [style/filler, style/passive] # checks or check/rules to skip allow: [Vel, grey] # words/phrases never flagged maxSentenceWords: 40 echoWindow: 40 -
Character sheets:
aliases: [...]stop name variants being flagged;born:enables age checks against scenestory-dates.
Safety properties
- Suggestions never nest inside existing markup;
findmust match exactly once (or name anoccurrence); a batch is applied completely or not at all. write_document,dreamwrite writeandreplace --yestake snapshots first (.dreamwrite/snapshots/, restorable from the app).idcan't be changed through the tools; unknown front-matter keys are preserved.- Everything is local: no network access, no telemetry.
- Suggest-only by default; private documents are invisible to the tools, including everything derived from them; every call is logged; bulk and assistant acceptances are snapshotted.
- Exports never replace a document, a setting or (for assistants) any existing file
outside
.dreamwrite/exports/.
The feature checklist under bring-your-own-assistant
docs/research/FEATURES.md §5.25 was written with an in-app AI in mind. Dreamwrite
deliberately has none; this is how those items map:
| Item | Under BYO assistant |
|---|---|
| AI-01 off by default | Nothing runs unless the author connects an assistant. |
| AI-02 global switch, per-project policy | Allow assistants on this computer (app-wide, enforced by the MCP server), assistants.enabled (project), and Show assistant review tools (hides the review UI). |
| AI-03 exclude documents | assistants: false on documents and folders. |
| AI-04 provider keys, local models | Not applicable: the assistant client holds its own keys and chooses its model (including local ones via clients that support them). |
| AI-06 context preview, tokens, cost | Not applicable: the client builds the context and bills it; the activity log shows what was read. |
| AI-08 snapshot before bulk accept | Done in Review and the Inspector. |
| AI-12 tool API restricted to suggestions | Suggest-only by default; direct edits and metadata need explicit permission. |
| AI-24 batch runs, progress, cancel | Handled by the client (e.g. "proofread every chapter"); the log records progress. |
| AI-25 activity log | .dreamwrite/assistant-log.jsonl, viewed in the Agents dialog. |
| AI-26 provenance | @Name (AI) on every suggestion; accepted text in .dreamwrite/provenance.jsonl. |
| AI-27 model per skill | Chosen in the client; skills are model-agnostic. |
| AI-28 chat with a scene | The client's chat, with the MCP tools and resources. |
| AI-30 sensitivity and translation | Sensitivity reads comment on concerns and propose concrete wording through suggest_edits; translation drafts are new draft: true documents under Notes/Translations/ (the original is never changed), revised afterwards through suggest_edits. |
| AI-29 custom skill builder | Copy a bundled skill (dreamwrite skills install --dest <project>/.agents/skills) and edit its SKILL.md. |