Dreamwrite Studio

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:

PieceWhat it gives the assistant
dreamwrite CLIOutline, read, search, check, suggest, review, snapshot, compile from a shell
dreamwrite mcpThe same as a Model Context Protocol server (tools, resources, prompts)
Deterministic checkscheck.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:

InstallationThe command
macOS, deb, rpm/Applications/Dreamwrite.app/Contents/MacOS/dreamwrite-app cli, dreamwrite-app cli
Windowsdreamwrite.exe, next to the app
AppImage/path/to/Dreamwrite.AppImage cli
Snap Storedreamwrite-studio.dreamwrite (or dreamwrite, once the store's alias is installed: sudo snap alias dreamwrite-studio.dreamwrite dreamwrite)
Flathubflatpak 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

ToolPurpose
project_outlineBinder tree with ids, titles, labels, status, words, synopses
read_documentFront matter + body of one document
read_manuscriptThe manuscript in compile order, paged by words (offset, limit)
searchFull-text/regex search with filters (label:, status:, keyword:, in:manuscript, meta.pov:)
run_checksDeterministic checks; findings with line, byte offsets and suggested fixes
get_metadata / set_metadataDocument front matter (or project settings); id is protected; set_metadata only when metadata changes are allowed
suggest_editsThe default way to edit: CriticMarkup suggestions, all-or-nothing
add_commentComment anchored to a passage
list_review_itemsPending suggestions and comments
write_documentReplace a body (snapshot first) — only when direct edits are allowed, and on request
create_documentNew document or folder (reports go in Notes/; the Manuscript and Templates need direct edits)
project_dictionaryThe project dictionary and sheet names — words never to flag
take_snapshotSnapshot a document
project_statsWord counts, targets, readability
character_sheetCharacter/place sheets and where each name appears
compileCompile 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

  1. The assistant proposes: suggest_edits / dreamwrite suggest insert {~~old~>new~~}, {++added++} or {--removed--}, each followed by {>>@Assistant: reason<<}; add_comment inserts {==passage==}{>>@Assistant: note<<}.
  2. The editor shows them as tracked changes; the review pane lists every item with its author, reason and replies (review.list).
  3. 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

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

Safety properties

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:

ItemUnder BYO assistant
AI-01 off by defaultNothing runs unless the author connects an assistant.
AI-02 global switch, per-project policyAllow 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 documentsassistants: false on documents and folders.
AI-04 provider keys, local modelsNot 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, costNot applicable: the client builds the context and bills it; the activity log shows what was read.
AI-08 snapshot before bulk acceptDone in Review and the Inspector.
AI-12 tool API restricted to suggestionsSuggest-only by default; direct edits and metadata need explicit permission.
AI-24 batch runs, progress, cancelHandled 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 skillChosen in the client; skills are model-agnostic.
AI-28 chat with a sceneThe client's chat, with the MCP tools and resources.
AI-30 sensitivity and translationSensitivity 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 builderCopy a bundled skill (dreamwrite skills install --dest <project>/.agents/skills) and edit its SKILL.md.