Skip to main content

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: default 8787.
  • --host: default 127.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

draftwatch-0.1.0.tar.gz (255.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

draftwatch-0.1.0-py3-none-any.whl (256.0 kB view details)

Uploaded Python 3

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

Hashes for draftwatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb80e111fc3b2485d9c7498717a78ffcc863e9cf2651a8d932178b02b93a4142
MD5 6a5b2b4db5d84e645aa9ba9f55a18af4
BLAKE2b-256 3fb55150e5ef41f569fb43a57881a6b90391912a69bb686529c0cf0978a72eca

See more details on using hashes here.

Provenance

The following attestation bundles were made for draftwatch-0.1.0.tar.gz:

Publisher: publish.yml on mtkonczal/Draftwatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for draftwatch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53c5f390fc605570d03a6478affa756be61b6e61bf180f5fe09a29fc4fe3d589
MD5 2b4a7097dee713c61eb8b39679b279fd
BLAKE2b-256 917f5db8dfcc08f00f8158e1ea04d5e82b828eb82a4eb1cdd7a3f8e112a590d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for draftwatch-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mtkonczal/Draftwatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page