sloptrim README

The project's README from github.com/seyedehsanhadi/sloptrim. As one markdown file: README.md.

sloptrim

A local detector for AI-writing patterns. It scores the first 262,144 characters of extracted prose in files saved through supported file-edit tools, and asks for the flagged spans to be fixed. Plain text is accepted up to 512 KB, supported archives up to 4 MB. 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.

Formats 20, including .docx, .pptx, .xlsx, OpenDocument, .epub, .ipynb, LaTeX; the first 262,144 characters of extracted prose is scored
Runs in Claude Code, on save. Other agents via /sloptrim init, which writes the contract to AGENTS.md, and .cursor/rules/
Needs Node for the hooks, Python 3.9 or newer for the detector, nothing else
Suite 142 Python tests and 72 hook checks, with CI configured for Linux, Windows and macOS, against Python 3.9 and 3.13 (macOS on 3.13)
Does not see A file written by a Bash command, which reaches disk without passing Write or Edit
Command Effect
/sloptrim full Contract + guard (default)
/sloptrim strict Flags at 20 instead of 40, and asks for a character scrub
/sloptrim lite / off Contract only / nothing
/sloptrim check <file> Score a file, name the tells, no rewrite
/sloptrim init Write the contract to ./AGENTS.md and a Cursor rule to ./.cursor/rules/
/sloptrim doctor Diagnose 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

Sloptrim's public matched benchmark uses five separate 30-human/30-machine arms from the Human Detectors release, pinned at commit afcf03d. Each arm is matched by prompt and scored separately. AUC is a ranking measure, not accuracy at Sloptrim's guard threshold.

machine arm ROC-AUC bootstrap 95% CI default TPR / FPR
GPT-4o 0.946 0.876–0.992 46.7% / 0%
Claude 3.5 Sonnet 0.842 0.729–0.936 3.3% / 0%
o1-pro 0.877 0.771–0.957 23.3% / 6.7%
paraphrased GPT-4o 0.838 0.735–0.929 6.7% / 3.3%
humanized o1-pro 0.762 0.648–0.871 0% / 3.3%
Public matched benchmark ROC-AUC: GPT-4o 0.946, Claude 3.5 Sonnet 0.842, o1-pro 0.877, paraphrased GPT-4o 0.838, humanized o1-pro 0.762.

Across these arms, Sloptrim achieved ROC-AUC 0.762–0.946. Confidence intervals use 10,000 paired prompt-cluster bootstrap resamples. The public result record pins the source hash; the harness refuses any other file. The benchmark texts are not redistributed here.

git clone https://github.com/jenna-russell/human_detectors.git
git -C human_detectors checkout afcf03d14d2da4a038d8d0fafa5ec779dd858181
python scripts/benchmark_frontier.py PATH_TO_HUMAN_DETECTORS_JSON

What it cannot do

It cannot prove whether a model wrote something. The public arms show that the score often ranks these machine samples above matched human samples. The threshold results show why that is not the same as a dependable yes/no classifier: sensitivity changes sharply with model, prompt, formatting and threshold.

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.

sloptrim (seyedehsanhadi/sloptrim)

Searching Database…

这是什么?Sloptrim 是一个本地的 AI 写作模式检测器:它对照有文档记录的风格特征,给你的编程智能体保存的文本文件打分,只使用 Python 标准库,没有网络调用,也没有机器学习模型。
它是托管服务,还是我在本地运行的东西?它纯粹是一个命令行工具加 Claude Code 智能体插件:没有网站,没有托管版本,你写的任何内容都不会离开你的机器。
除了编程智能体,我还需要安装什么?钩子需要 Node,检测器本身需要 Python 3.9 或更新版本;除此之外无需其他东西。
它能覆盖智能体写的一切吗?不能:它看不到通过 Bash 命令写入的文件,因为那些文件不经过 Write 或 Edit 就直接落盘;而且它只对每个文件提取文本的前 262,144 个字符打分。
AI 写作检测的准确度如何?在五个基准组(GPT-4o、Claude 3.5 Sonnet、o1-pro,以及释义和人性化变体)上,Sloptrim 的 ROC-AUC 介于 0.762 到 0.946 之间,但作者强调 AUC 是一种排序指标,并不保证在防护阈值处的是/否判断准确率。
除 Markdown 外它还能给哪些文件格式打分?它支持约 20 种格式,包括 .docx、.pptx、.xlsx、OpenDocument 文件、.epub、.ipynb 笔记本和 LaTeX,最多对提取文本的前 262,144 个字符打分。
它能证明某篇文字是 AI 生成的吗?不能,作者明确表示它无法证明某段文字是否由模型所写,绝不能当作作者身份分类器使用;分数反映的是写作风格,而从来不是针对某个人。
full 和 strict 模式有什么区别?/sloptrim full(默认)应用写作契约,外加一个把分数推到 40 分以上的防护;而 /sloptrim strict 把该阈值降到 20,还会额外要求对文字做一次清理。
Size
0.8 MB
Stars
396
Updated
CommitOct 05
Age
2mo
Commits · 90 Days