sloptrim
A local detector for AI-writing patterns. Scores every prose file your agent saves. Python standard library only, no network, no model.
What is it?
What it is
A local AI writing pattern detector that scores prose in files (supports .docx, .pptx, .xlsx, etc.) and flags potential AI-generated content using 71 documented patterns. Runs offline with Python standard library, no network or model required.
Why it exists
To enable users to identify AI-generated text locally, ensuring privacy and no data upload. Designed for developers and writers to maintain writing authenticity without external dependencies.
Who should use it
Developers using Claude Code or Cursor who want to detect AI-writing patterns in their documents, writers auditing their own output, and anyone needing local, zero-dependency writing quality analysis
Who should avoid it
Users seeking authorship classification (this tool is not designed for that purpose), those requiring absolute certainty about AI origin, and projects where false positives/negatives could impact decisions
How it works
A quick walkthrough in plain English
How sloptrim works
Step 1 of 3
You interact with it
Open sloptrim, send a request, or connect it to your stack.
Features
Advantages
- Zero network dependency - all processing happens locally with no data leaving the machine
- Apache-2.0 license allows free use and modification without restrictions
- High detection accuracy with ROC-AUC scores up to 0.946 against benchmark datasets
- Supports 20+ file formats making it versatile for different document types
- No external dependencies beyond Python standard library, ensuring reliability
- Comprehensive test suite with 191 tests providing confidence in functionality
- Works across major operating systems (Linux, Windows, macOS) and Python versions 3.9-3.13
- Integrates seamlessly with popular AI coding agents like Claude Code, Codex, and Cursor
- Provides actionable feedback by naming specific patterns rather than just scores
- Lightweight implementation with minimal system requirements and fast execution
Disadvantages
- Cannot definitively prove whether a model wrote specific text, only detects patterns
- Not an authorship classifier and should not be used for identifying writers or authors
- Limited to first 256 KB of prose in supported files, larger documents may not be fully analyzed
- Does not detect AI patterns in files written by Bash commands that bypass file-edit tools
- Score thresholds vary significantly with model, prompt, formatting, and context
- Requires both Node.js for hooks and Python 3.9+ for detection, adding installation complexity
- Performance may vary across different AI models with sensitivity changing sharply
- Only analyzes prose content, not code or technical documentation
- No web interface or hosted version available, requiring local installation and setup
Installation
cloud
/plugin marketplace add seyedehsanhadi/sloptrim /plugin install sloptrim@sloptrim
native
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 python scripts/detect.py draft.docx
FAQ
How do I install sloptrim in Claude Code or other agents?
Paste the command `Install the sloptrim plugin from https://github.com/seyedehsanhadi/sloptrim` into the chat. After the install, restart the agent and run `/sloptrim doctor` to verify the installation. For a manual install, clone the repo to `~/.claude/skills/sloptrim`, create `~/.claude/commands`, and copy `install/sloptrim-command.md` into it.
What file formats and size limits does sloptrim support?
It supports 20 formats including .docx, .pptx, .xlsx, OpenDocument, .epub, .ipynb, LaTeX, etc. It scores the first 256 KB of extracted prose; plain text files up to 512 KB are accepted, and archives up to 4 MB.
How can I run sloptrim from the command line?
Use `python scripts/detect.py <file>` to get a JSON report of patterns, metrics, and a 0‑100 score. For example: `python scripts/detect.py draft.docx`.
What do the score bands mean?
Scores are grouped into five bands: `clean`, `light tells`, `mixed`, `heavy tells`, and `pervasive tells`. The guard nudges when the score is above 40 (default) or above 20 in strict mode, indicating the presence of AI‑writing patterns.
What is the difference between `/sloptrim full`, `/sloptrim strict`, and `/sloptrim lite`?
`/sloptrim full` applies the contract and guard (default). `strict` flags at 20 instead of 40 and requests a character scrub. `lite` or `off` applies only the contract or nothing, respectively.
How does sloptrim detect AI‑writing patterns?
It uses 71 documented patterns, 62 of which have detectors. The first 256 KB of prose is scanned for these patterns, and a score from 0 to 100 is computed based on how many patterns are present. The tool is purely local, with no network or model calls.
Featured in Videos
YouTube tutorials and walkthroughs for sloptrim
Alternatives
Similar projects ranked by category, topics, and text overlap.