CLI + universal agent skill to scrub AI provenance marks from text and files — for privacy and hygiene on content you own.
| Layer | Target | How |
|---|---|---|
| A | Invisible Unicode, exotic spaces, bidi, tag chars | Deterministic (clean) |
| B | Statistical (token-sampling) text marks | Optional rewrite backends |
| Files | C2PA / EXIF / XMP / doc props | PNG, JPEG, SVG, PDF, DOCX, HTML, MD |
Honesty: Layer A and metadata cleans are verifiable. Layer B is best-effort. No tool can certify that a vendor detector will fail.
Want a website instead of a CLI? Use Claude Watermark Remover — same project, hosted. Free in-browser check/clean (Layer A). Paid rewrite for the statistical text mark (Layer B). No install. Use this repo if you want local files, C2PA/metadata, CI, or an agent skill.
Try Layer A locally in-browser: open playground/index.html
git clone git@github.com:anshaneja5/markscrub.git
cd markscrub
npm install
npm run build
node dist/cli.js helpDev without build:
npm run markscrub -- help./scripts/install-skill.sh cursor # ~/.cursor/skills/remove-ai-marks
./scripts/install-skill.sh claude # ~/.claude/skills/remove-ai-marks
./scripts/install-skill.sh codex # ~/.codex/skills/remove-ai-marksOr copy/symlink skills/remove-ai-marks/ into your agent’s skills directory, then ask to scrub AI provenance marks / /remove-ai-marks.
# Inspect (file, stdin, clipboard, directory)
markscrub inspect draft.md
markscrub inspect draft.md --json --fail-on-findings
markscrub inspect . --recursive --sarif out.sarif
printf 'Hi\u200b' | markscrub inspect -
markscrub inspect --clipboard
# Clean
markscrub clean draft.md -o draft.cleaned.md --diff
markscrub clean ./content -o ./cleaned --recursive --json
printf 'Hi\u200b' | markscrub clean - -o cleaned.txt
markscrub clean --clipboard --diff # read + write clipboard
markscrub clean draft.md -o x.md --dry-run --diff
# Rewrite (Layer B)
markscrub rewrite draft.md --backend print-prompt
markscrub rewrite draft.md -o out.md --backend ollama --model llama3.2
markscrub rewrite draft.md -o out.md --backend lmstudio
markscrub rewrite draft.md -o out.md --backend openai --strength strong| Backend | Default endpoint | Notes |
|---|---|---|
print-prompt |
— | Default; no API key |
ollama |
http://127.0.0.1:11434/v1 |
Local |
lmstudio |
http://127.0.0.1:1234/v1 |
Local |
openai |
https://api.openai.com/v1 |
Needs API key |
export MARKSCRUB_REWRITE_BACKEND=ollama
export MARKSCRUB_REWRITE_MODEL=llama3.2
# openai:
# export MARKSCRUB_REWRITE_API_KEY=sk-...Prefer a rewrite model different from the suspected origin model.
- uses: anshaneja5/markscrub@main
with:
path: .
fail-on-findings: true
sarif-file: markscrub.sarifOr locally:
markscrub inspect ./src --fail-on-findings --sarif markscrub.sarif{
"tool": "markscrub",
"version": "0.2.0",
"action": "clean",
"findings": [{ "kind": "unicode", "verifiable": true, "message": "…" }],
"actions": ["unicode: removed 3 character(s)"],
"diff": { "summary": ["…"], "before": "…", "after": "…" },
"residualRisk": { "level": "low", "notes": ["…"] }
}| Channel | Support |
|---|---|
| Unicode / edit-based text | Yes (Layer A) |
| Statistical sampling text | Best-effort rewrite (Layer B) |
| C2PA / file metadata | Yes for listed formats |
| PDF without exiftool | Best-effort XMP/Info scrub |
| PDF with exiftool | Preferred full metadata strip |
| Pixel image marks | Out of scope |
Rewriting changes voice and may reduce quality. If quality matters more than hygiene, use Layer A + file cleans only.
MIT