guillaumemeyer /
watermarks-remover
Agent skill and local Python service that strip AI provenance marks from text and files
- 24.7k stars
- 1.5k stars since 3 Oct
- Python
- Updated yesterday
- Some experience
- Agent skills & plugins
AI tools can leave provenance marks in what they produce. Some are invisible Unicode characters in text. Some are metadata inside images, PDFs or Office files, such as C2PA manifests, EXIF and XMP. Others are statistical patterns in word choice. This project aims to clean these from content you own, for privacy and hygiene.
It has two parts. The skill is markdown only and acts as a thin client. The service is a Python 3.10+ standard-library HTTP server (default http://127.0.0.1:8765), so the agent host needs no Python. Layer A uses deterministic scripts to remove invisible characters, odd spaces, bidi controls and tag characters. Layer B targets statistical text watermarks by having the agent rewrite the text, with an optional rewrite hook that can use a local Ollama model.
A skill is only an instruction the model may ignore, so the Claude Code plugin also adds a PostToolUse hook. The harness runs it on every file the agent writes, and it either reports marks or cleans them in place. The README says no hook can change chat messages, so text that exists only in chat still relies on the best-effort skill workflow.
What it does
Layer A text cleaning
Deterministic scripts remove invisible Unicode, exotic spaces, bidi characters and tag characters. Separate inspect and clean commands let you look before changing anything.
File metadata stripping
Handles C2PA, EXIF, XMP and document properties across many formats, including PNG, JPEG, PDF, DOCX, EPUB, MP4 and MP3. PDF stripping needs qpdf. exiftool and c2patool are used when present.
Layer B rewrite hook
For statistical text watermarks, the agent rewrites the text. rewrite_text.py prints a prompt by default, or can call a local Ollama model. Remote endpoints need an explicit opt-in.
Automatic hook for written files
A Claude Code PostToolUse hook scans files the agent writes. In check mode it reports findings. In clean mode it strips marks in place.
Many install routes
One installer script targets Claude Code, Cowork/claude.ai (zip upload) and Cursor. There is also a plugin marketplace route and a text-only skill with no service.
What you could build
- Strip invisible Unicode characters from a manuscript or documentation draft before publishing it.
- Remove C2PA and EXIF metadata from images you made before sharing them.
- Run a check-mode hook so you are alerted whenever an agent writes a file containing provenance marks.
- Gate commits with the pre-commit check so marked files do not reach git.
- Rewrite a text with a local Ollama model to disturb statistical watermark patterns.
Get started
Install the skill with the installer for your host, then start the local service with make serve. If the service is not at http://127.0.0.1:8765, set WATERMARKS_SERVICE_URL. You can also run the scripts under service/scripts directly on a file.
python3 install_skill.py --skill remove-ai-marks --target claude-codemake servepython3 "$SCRIPTS/clean_file.py" draft.md -o draft.cleaned.mdCommands are copied from the project's README. Read it on GitHub for the full setup.