seyedehsanhadi /
sloptrim
Local scorer that flags AI-writing patterns in prose files an agent saves
- 404 stars
- 193 stars since 3 Oct
- Python
- Updated today
- Beginner friendly
- Agent skills & plugins
AI agents often write prose with recognizable habits. Sloptrim checks for those habits each time an agent saves a text file and gives the file a score from 0 to 100. If the score is high enough, it asks the agent to rewrite the flagged parts.
It works with plain rules, not a model. A Python script reads the text, applies detectors for 62 of its 71 documented patterns, and reports matches and metrics as JSON. Of those 62, 50 can change the score. The other 12 are shown as writing advice only. The remaining 9 patterns have no detector and are handled by the agent during the rewrite. It reads 20 formats, including .docx, .pptx and .epub, and it looks only at prose, never code.
The README is frank about the limits. It is not an authorship classifier and cannot prove a model wrote something. On a public benchmark its ranking ability (ROC-AUC) ran from 0.762 to 0.946 depending on the model, and at the default threshold it catches only some samples. It also cannot see files written through a Bash command.
What it does
Scores prose from 0 to 100
Text lands in one of five bands, from clean to pervasive tells. The guard nudges the agent above 40, or above 20 in strict mode.
Reads many file formats
It handles 20 formats, including .docx, .pptx, .xlsx, OpenDocument, .epub, .ipynb and LaTeX. It scores the first 262,144 characters of extracted prose.
Runs as a Claude Code plugin
Hooks run on save. Slash commands switch modes (full, strict, lite, off), check one file, or diagnose the install.
Works with other agents
/sloptrim initwrites the rules to AGENTS.md and a Cursor rule, so other agents can follow the same contract.Publishes its benchmark
Results on five matched human-versus-machine arms come with confidence intervals and a script to reproduce them.
What you could build
- Check a draft report or Word document for common AI-writing tells before sharing it.
- Add a save-time guard so a coding agent rewrites its own stilted documentation.
- Run the detector on a folder of Markdown files to find the worst offenders.
- Study how a rule-based stylometry tool is built and benchmarked in plain Python.
- Set up the same writing rules for Cursor or Codex through AGENTS.md.
Get started
Paste the install line into your coding agent, restart, then run /sloptrim doctor to confirm four [OK] lines. To score a file directly, run the detector script on it. The hooks need Node and the detector needs Python 3.9 or newer.
/plugin marketplace add seyedehsanhadi/sloptrim/plugin install sloptrim@sloptrimpython scripts/detect.py draft.docxCommands are copied from the project's README. Read it on GitHub for the full setup.