Back to Discover

sloptrim

plugin

seyedehsanhadi

A local detector for AI-writing patterns. Scores every prose file your agent saves. Python standard library only, no network, no model.

View on GitHub
154 starsApache-2.0Synced Aug 17, 2026

Install to Claude Code

/plugin marketplace add seyedehsanhadi/sloptrim

README

sloptrim

A local detector for AI-writing patterns. It scores every prose file your agent saves and asks for the flagged spans to be fixed. Python standard library only, no network, no model. Prose only, never code.

test Version License Dependencies Tests Python

Install · What it does · Measured · Limits · Patterns · Ethics

[!IMPORTANT] This is a command-line tool and an agent plugin. There is no website and no hosted version. Nothing you write is uploaded, there is no account, and no text ever leaves your machine. Any site offering a service under this name is unrelated to this project.

A recorded session. The contract arrives at session start, again on the prompt, and again inside a subagent. A saved file scores 45 and its patterns are named. After the fix the next read is clean at 15. The same text saved as a .docx scores the same, read out of the zip. Every hook latency is measured.
A recorded session, not a mock-up. record/session_capture.py fires the real hooks with the payloads Claude Code sends and writes record/session.json; record/anim.py draws it. The hook lines, the scores and the milliseconds come from that capture; the grey labels beside them are narration. The prose being scored is record/draft.md, a short piece written for the recording.

Install

Paste into Claude Code, Codex, Cursor, or any coding agent:

Install the sloptrim plugin from https://github.com/seyedehsanhadi/sloptrim

Restart, then run /sloptrim doctor. It answers with four [OK] lines.

Explicit commands, and installing without the marketplace
/plugin marketplace add seyedehsanhadi/sloptrim
/plugin install sloptrim@sloptrim
git clone https://github.com/seyedehsanhadi/sloptrim.git ~/.claude/skills/sloptrim
mkdir -p ~/.claude/commands
cp ~/.claude/skills/sloptrim/install/sloptrim-command.md ~/.claude/commands/sloptrim.md

Do not skip the mkdir. On a fresh machine ~/.claude/commands does not exist yet and the copy fails with "No such file or directory". In PowerShell the last two lines are New-Item -ItemType Directory -Force $HOME/.claude/commands and Copy-Item. The copy puts /sloptrim in the / menu, because Claude Code does not scan a skill folder's own commands/. A marketplace install needs no such step. Either way the router also answers to /sloptrim:sloptrim.

What it does

The score is 0-100 against 71 documented patterns. 62 of them have a detector; the other 9 need a reading and are worked during the rewrite. Of the 62, 50 can move the score and 12 are reported as writing advice and count for nothing: most of them because measurement showed they mark formal register rather than machine authorship, the rest because they are typographic habits.

Formats20, including .docx, .pptx, .xlsx, OpenDocument, .epub, .ipynb, LaTeX
Runs inClaude Code, on save. Other agents via /sloptrim init, which writes the contract to AGENTS.md, and .cursor/rules/
NeedsNode for the hooks, Python 3.9 or newer for the detector, nothing else
Suite99 Python tests and 67 hook checks, green in CI on Linux, Windows and macOS, against Python 3.9 and 3.13 (macOS on 3.13)
Does not seeA file written by a Bash command, which reaches disk without passing Write or Edit
CommandEffect
/sloptrim fullContract + guard (default)
/sloptrim strictFlags at 20 instead of 40, and asks for a character scrub
/sloptrim lite / offContract only / nothing
/sloptrim check <file>Score a file, name the tells, no rewrite
/sloptrim initWrite the contract to ./AGENTS.md and a Cursor rule to ./.cursor/rules/
/sloptrim doctorDiagnose the install
python scripts/detect.py draft.docx    # JSON: patterns, metrics, 0-100 score

A score lands in one of five bands: clean, light tells, mixed, heavy tells, pervasive tells. The guard nudges above 40, or above 20 in strict mode.

Measured

The figures below were measured against corpora held privately. Neither those corpora nor the harness that read them is in this repository, and nothing here recomputes any of it. They are cited as results, with the corpus named, and cannot be re-derived from what you have cloned.

False positives on human prose, at the default threshold, worst corpus first:

corpusnrate
American textbooks, 30 titles9,3330.85%
MAGE human web text5040.40%
PubMed abstracts, pre-20205290.00%
arXiv abstracts, pre-20219390.00%

Detection, ROC-AUC per corpus. The worst one is the headline:

Detection by corpus, ROC-AUC: American textbooks 0.963, RAID 0.791, MAGE 0.669, a frontier model 0.551. 0.5 is a coin flip.

What it cannot do

It cannot tell you whether a current frontier model wrote something. The machine arms above come from GPT-2, GPT-J, OPT, FLAN-T5, MPT, Mistral, Mixtral, GPT-3.5 and GPT-4, nothing newer. A run against a current frontier model measured ROC-AUC 0.551, close to a coin flip.

The writing contract has no measured effect. Twenty documents drafted twice from one brief with the switch toggled, both arms verified from the transcripts: mean change +2.25, bootstrap 95% CI -5.65 to +9.90, sign test p = 0.27. Its banned-word list works; nothing else in it does. That is 20 pairs against the 40 the protocol asks for, so the question is unresolved rather than settled.

It is not an authorship classifier and must not be used as one. A score says something about writing, never about a person. Read ETHICS.md.

License

Apache-2.0 (full text, NOTICE). Cite with CITATION.cff.

Rendered live from seyedehsanhadi/sloptrim's GitHub README — not stored, always reflects the source repo.

1 Plugin

NameDescriptionCategorySource
sloptrimScores every prose file your agent saves against a catalogue of 71 documented patterns, 62 of them with a detector behind them and 50 able to move the score, and names the ones that fired, so the flagged spans get fixed before the file ships. The 0 to 100 score lands in one of five bands: clean, light tells, mixed, heavy tells, pervasive tells. Every band describes the prose and none of them names an author. Reads 20 formats including .docx and .epub. Deterministic, Python standard library only, no network, no model. Prose only; code, config and commits stay untouched../

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.