Review an AI agent's edits to your writing files as a real git word-diff — keep or revert changes hunk by hunk, then commit.
Project description
Draftwatch
Draftwatch is a lightweight IDE for writers. You can use it to create and format new Markdown documents from scratch, or use it to review an AI agent's edits to your writing exactly the way a developer reviews a pull request.
When reviewing AI edits, instead of guessing what an LLM changed in your document, Draftwatch shows you the exact, git-backed word-diff. You can step through, keep or revert each change individually, and commit when you're done.
Crucially, the diff comes from your local git—not from the AI vendor and not from a JavaScript approximation. You get absolute, independent verification of what the agent or script actually did.
Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown, xterm.js) are vendored and served locally, so Draftwatch works completely offline and binds to localhost only.
Install
Draftwatch is available on PyPI. You can install or run it using your preferred Python package manager:
# pipx
pipx install draftwatch
# uv
uv tool install draftwatch
# standard pip
pip install draftwatch
Usage
Run it from inside a git repository you write in:
draftwatch
Or to start with a specific file:
draftwatch draft.md
You can also run it outside any git repository. Draftwatch starts in write-only mode — the editor, preview, and saving all work, but the review loop (diffs, revert, commit) is off because there's no git to compare against. The right panel offers a one-click initialize git here to turn the folder into a repo and switch on the full review loop.
Starting a second instance while one is already running just works: if the default port is busy, Draftwatch picks a free one and prints the URL.
Draftwatch opens a two-panel review window: your source on the left (a real editor with markdown highlighting, search, and a live preview), the diff against your baseline on the right. Review the changes, revert the ones you don't want, apply, then commit. Committing advances the baseline, so the next agent pass starts clean.
Start without a file (draftwatch) to pick one in the window.
Options
draftwatch [target] [--port 8787] [--no-open] [--no-terminal] [--app | --no-app]
target: file to watch. Optional; omit it to pick one in the UI.--port: default8787. If omitted and the default is busy, Draftwatch picks a free port automatically; pass--portto pin an exact one (it then fails loudly if that port is taken).--no-open: don't auto-open a window (useful headless or over SSH).--no-terminal: disable the embedded terminal panel entirely (its routes are removed from the server, not just hidden in the UI).--app/--no-app: force or disable the native window. It is on by default when pywebview is installed and falls back to the browser otherwise.
The terminal panel
Click terminal in the toolbar to open a third panel running a real shell in your repo (macOS/Linux). Launch claude, codex, or any command there: when the agent edits the file you're watching, the diff panel lights up live — prompt on the right, review in the middle, write on the left. hide collapses the panel and leaves the shell running (an agent mid-task keeps working); end session kills the shell and everything it started. No snapshots are taken when you run commands — edits accumulate against whatever baseline you've selected, and you review them on your schedule. On Windows the panel is unavailable and Draftwatch simply runs without it.
Features
- Real git word-diffs, so what you see is exactly what git sees.
- Keep or revert changes one hunk at a time, or all at once, then commit from the UI.
- Switchable baseline: last push, HEAD, or an earlier commit.
- Jump between changes or collapse to a changes-only view for long documents.
- Editable markdown preview alongside the raw source.
- You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
- Embedded terminal panel (macOS/Linux): run your agent next to the diff without leaving the window.
- Resizable panels: drag the dividers to change the split (double-click to reset).
Security
Draftwatch binds 127.0.0.1 only — there is deliberately no option to bind another interface, so the tool is never exposed on your network. Every request carries a per-session token, the Host and Origin headers are validated to defeat DNS-rebinding, and the markdown preview is sanitized with DOMPurify before rendering. The tool never talks to any LLM.
The terminal panel is a real shell, so it gets extra care: its input routes accept the session token only as a request header (keystrokes never appear in URLs, browser history, or logs), the server pipes bytes to the PTY without ever parsing them, ending a session kills the shell's whole process group, and no shell outlives Draftwatch. --no-terminal removes the feature from the server entirely.
Tests
python3 testing/test_reconstruct.py # reconstruction invariants
python3 testing/test_acceptance.py # end-to-end server tests
Development
The front-end libraries are vendored into draftwatch/assets/ and committed, so end users never need Node. To rebuild them: npm install && npm run build:vendor.
Author
Built by Mike Konczal. Vibe-coded with Fable 5.
License
MIT. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file draftwatch-0.2.0.tar.gz.
File metadata
- Download URL: draftwatch-0.2.0.tar.gz
- Upload date:
- Size: 340.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6047bf6ae8e6ac4627821de48204f4397d75ec2c6f29d236ae94d9832165473e
|
|
| MD5 |
2af8cff1a03397856a7992bb6dc5f232
|
|
| BLAKE2b-256 |
4691f09e1d676a5dc2c1ed14272c0a2934e3104c336ef47914ca507eb9b9885b
|
Provenance
The following attestation bundles were made for draftwatch-0.2.0.tar.gz:
Publisher:
publish.yml on mtkonczal/Draftwatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
draftwatch-0.2.0.tar.gz -
Subject digest:
6047bf6ae8e6ac4627821de48204f4397d75ec2c6f29d236ae94d9832165473e - Sigstore transparency entry: 2092464568
- Sigstore integration time:
-
Permalink:
mtkonczal/Draftwatch@015eb25f5e6afaa4c8f9cbbbf2f9a4c1771f4b9d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mtkonczal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@015eb25f5e6afaa4c8f9cbbbf2f9a4c1771f4b9d -
Trigger Event:
push
-
Statement type:
File details
Details for the file draftwatch-0.2.0-py3-none-any.whl.
File metadata
- Download URL: draftwatch-0.2.0-py3-none-any.whl
- Upload date:
- Size: 341.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cc4f1c7d89482303c04bd8c2ca5b45056c8a4c2b474cb37d6c6180aed541746
|
|
| MD5 |
bd437076f7247d52ec025e76d41ea1a8
|
|
| BLAKE2b-256 |
364432ec8ce0eb64bbb9eaae92924346c8a1087914d168ad7eeb7e6abb405465
|
Provenance
The following attestation bundles were made for draftwatch-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on mtkonczal/Draftwatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
draftwatch-0.2.0-py3-none-any.whl -
Subject digest:
7cc4f1c7d89482303c04bd8c2ca5b45056c8a4c2b474cb37d6c6180aed541746 - Sigstore transparency entry: 2092464692
- Sigstore integration time:
-
Permalink:
mtkonczal/Draftwatch@015eb25f5e6afaa4c8f9cbbbf2f9a4c1771f4b9d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mtkonczal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@015eb25f5e6afaa4c8f9cbbbf2f9a4c1771f4b9d -
Trigger Event:
push
-
Statement type: