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 that all them to review an AI agent's edits to their writing the way you'd review a pull request. Draftwatch shows the exact, git-backed word-diff of what changed in a file, lets you keep or revert each change, and commits when you're done.
The diff comes from git on your machine, not from the AI vendor and not from a JavaScript approximation. You get independent verification of what the agent actually did.
Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown) are vendored and served locally, so it works offline and binds to localhost only.
Install
Install straight from GitHub, no clone needed:
# uv (recommended): run without installing
uvx --from git+https://github.com/mtkonczal/Draftwatch.git draftwatch draft.md
# pipx: install the `draftwatch` command onto your PATH
pipx install git+https://github.com/mtkonczal/Draftwatch.git
# pip
pip install git+https://github.com/mtkonczal/Draftwatch.git
For the native app window, add the app extra:
pipx install "draftwatch[app] @ git+https://github.com/mtkonczal/Draftwatch.git"
Usage
Run it from inside any git repository you write in:
draftwatch draft.md
Or to start with a specific file:
draftwatch draft.md
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] [--host 127.0.0.1] [--no-open] [--app | --no-app]
target: file to watch. Optional; omit it to pick one in the UI.--port: default8787.--host: default127.0.0.1. Changing this exposes the tool on your network and is not recommended.--no-open: don't auto-open a window (useful headless or over SSH).--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.
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.
Security
Draftwatch binds 127.0.0.1 only. 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. Don't change --host unless you understand the exposure.
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.1.0.tar.gz.
File metadata
- Download URL: draftwatch-0.1.0.tar.gz
- Upload date:
- Size: 255.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb80e111fc3b2485d9c7498717a78ffcc863e9cf2651a8d932178b02b93a4142
|
|
| MD5 |
6a5b2b4db5d84e645aa9ba9f55a18af4
|
|
| BLAKE2b-256 |
3fb55150e5ef41f569fb43a57881a6b90391912a69bb686529c0cf0978a72eca
|
Provenance
The following attestation bundles were made for draftwatch-0.1.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.1.0.tar.gz -
Subject digest:
fb80e111fc3b2485d9c7498717a78ffcc863e9cf2651a8d932178b02b93a4142 - Sigstore transparency entry: 2081981299
- Sigstore integration time:
-
Permalink:
mtkonczal/Draftwatch@6afeb4e3ed79cdcec1427251dcaaacc65a33d8c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mtkonczal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6afeb4e3ed79cdcec1427251dcaaacc65a33d8c0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file draftwatch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: draftwatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 256.0 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 |
53c5f390fc605570d03a6478affa756be61b6e61bf180f5fe09a29fc4fe3d589
|
|
| MD5 |
2b4a7097dee713c61eb8b39679b279fd
|
|
| BLAKE2b-256 |
917f5db8dfcc08f00f8158e1ea04d5e82b828eb82a4eb1cdd7a3f8e112a590d1
|
Provenance
The following attestation bundles were made for draftwatch-0.1.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.1.0-py3-none-any.whl -
Subject digest:
53c5f390fc605570d03a6478affa756be61b6e61bf180f5fe09a29fc4fe3d589 - Sigstore transparency entry: 2081981411
- Sigstore integration time:
-
Permalink:
mtkonczal/Draftwatch@6afeb4e3ed79cdcec1427251dcaaacc65a33d8c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mtkonczal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6afeb4e3ed79cdcec1427251dcaaacc65a33d8c0 -
Trigger Event:
push
-
Statement type: