Noureddine RAMDI / unslop: empirically detecting and avoiding repetitive LLM output patterns

Created Mon, 04 May 2026 10:11:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

mshumer/unslop

unslop tackles a common pain point in working with large language models (LLMs): the tendency of models to collapse toward repetitive defaults or clichés when generating content for a specific domain. Instead of prescribing how to prompt the model, it analyzes what the model does by default, then generates reusable instructions to avoid those defaults.

What unslop does and how it works

At its core, unslop is a Python CLI tool that uses Claude Code to generate many samples from a given prompt set in a target domain. It then analyzes the resulting corpus to find the repetitive defaults — basically the boilerplate patterns, clichés, or structural tropes the model falls back on when left unconstrained.

The output is a skill.md file that can be reused to instruct future prompt generations to avoid these defaults, effectively producing negative constraints. This flips the usual approach in prompt engineering, which typically focuses on telling the model what to do rather than what to avoid.

unslop supports both text and visual domains. For text, it can analyze writing, code, or prose. For visual domains like websites or HTML, it optionally uses screenshot rendering with Playwright to aid in visual analysis of output patterns.

One particularly clever feature is the before/after comparison step. After deriving the anti-pattern profile, unslop generates outputs with and without applying the profile to empirically verify that the detected defaults actually influence output behavior. This step turns subjective critiques like “this feels generic” into measurable pattern reductions.

The results are structured as markdown files suitable for reuse in Claude Code or other systems that consume skill packages, such as CLAUDE.md or Cursor rules.

The technical strengths and tradeoffs

unslop’s main strength lies in its empirical, data-driven approach to prompt engineering. By generating large corpora and analyzing them systematically, it surfaces repeated patterns that may go unnoticed in manual tuning.

The codebase is Python-based and integrates tightly with Claude Code, which means it depends on having Claude Code installed and configured. This dependency is reasonable given its goal but does limit portability to environments without Claude Code.

The use of screenshot rendering for visual domains is a thoughtful addition, as visual patterns can be harder to detect through text analysis alone. This adds complexity but broadens the tool’s applicability.

The before/after comparison step is a neat engineering validation that adds credibility to the results. It’s not just a heuristic or guess; it tests whether applying the anti-pattern profile actually changes the model’s output distribution.

Tradeoffs include the reliance on the quality and representativeness of the prompt set used to generate samples — if the prompt set is narrow or biased, the detected defaults might not generalize.

Also, unslop focuses on detecting repetitive defaults but does not directly optimize for quality or creativity. It complements positive prompt engineering rather than replacing it.

From a code quality perspective, the repository is straightforward and pragmatic. The CLI interface and modular output structure make it accessible for integration into larger prompt engineering workflows.

Quick start

You need Claude Code installed.

git clone https://github.com/mshumer/unslop.git
cd unslop

python3 -m venv .venv
source .venv/bin/activate

## Requirements

- Claude Code
- Python 3.10+
- For visual domains: `pip install playwright && playwright install chromium`

This setup ensures you have the runtime environment ready. From there, you can run the CLI commands to generate prompt samples, analyze patterns, and produce the skill.md output.

verdict

unslop is a valuable tool for AI practitioners and prompt engineers looking to empirically identify and reduce repetitive defaults in LLM-generated content. Its approach of generating negative constraints based on observed patterns fills a gap in prompt tooling.

The reliance on Claude Code means it’s targeted at those already invested in that ecosystem or willing to adopt it. Additionally, the effectiveness depends on the quality and scope of the prompt samples you generate.

If you struggle with generic or boilerplate outputs and want a data-driven way to craft anti-pattern profiles that measurably change model behavior, unslop is worth exploring. It’s not a silver bullet for creativity or quality but a solid addition to the prompt engineering toolbox.


→ GitHub Repo: mshumer/unslop ⭐ 482 · Python