This repository consists of two parts:
- a Rust crate which rewrites text based on user-defined rules
- a Chrome extension which intercepts LLM responses on claude.ai and sends it to the Rust code (compiled to WebAssembly)
Claude's output can be unpleasant to read. This seems to be a widespread sentiment: see Simon Willison's LLM cliché highlighter or this page about the "Load-bearing vocabulary of Claude".
The aim of this project is to let users author rules which will automatically rewrite Claude's output (specifically when using claude.ai in Google Chrome).
Three types of rules are supported:
- Literals: a literal string to be replaced by another, such as "rich tapestry of" by just "range of"
- Lemmas: capture the inflected forms of verbs and nouns using a single rule. For example, "utilise", "utilises", "utilised" are all forms of the same verb. You can author a rule to rewrite "utilise" to "use" and it will also rewrite "utilised" to "used".
- Templates: some of Claude's speech patterns follow the same structure, e.g. "It's not just {A}, it's {B}". You can author a rule to replace this with "It's {B}", regardless of the value of A or B.
The extension comes with a few defaults to get you started, see extension/defaults.js.
To build the extension, run build.sh. Ensure you have Rust installed as well as wasm-pack (cargo install wasm-pack)
To install the extension:
- In Google Chrome, go to
chrome://extensions/ - Select "Load unpacked"
- Select the
extensionfolder
Now, going to claude.ai, you should see the extension 
If you click on Deslop, you should see the UI appearing with default rules. 
To test it, here is me asking it to write a sentence that will need to be rewritten, with and without the extension:
| No rewriting | Rewriting |
|---|---|
![]() |
![]() |
build.sh: A script to run the tests and build the extension as WebAssemblyengine/src: The Rust crate for the rewriting. This does not rely on the extension.set_rules_inner()inlib.rsjust expects JSON-serialised rules and can then compile them, after whichdeslop()can take an input string and rewrite it in accordance with the rules.book.rsdeals with serialisation of the relevant typescompile.rs'compiles' authored rules to a format used for rewritinginflect.rscovers (not exhaustively) inflections of lemmas, so expanding a base form to cover e.g. third-person, past tense, etc.rewrite.rscontains the core logic of applying compiled rules to textrules.rscontains some types and logic for parsing rules (especially template rules) and expanding lemmas into literal ruleslib.rsis the entry point for the crate
extensioncontains the JavaScript and files necessary to make the extension work on claude.ai in Chromedefaults.jscontains some default rulesdeslop_engine.jsanddeslop_wasm.jscontain WebAssembly and call the Rust functionsintercept.jshandles intercepting responses from Claude, chunking it sentence by sentence, and passing it to the rewriting enginemanifest.jsonis a standard file required for Chrome extensions to define its functionality, permissions, metadatapopup.htmlandpopup.jscontain the UI for the extensionstorage.jshandles storing and loading rules from browser storage
- There are lots of irregular nouns and verbs which are not covered by the current inflection rules. This is a work in progress.
- There are more rule types that could be supported
- The WebAssembly is currently inlined in the extension, which is a workaround and should be done properly.
- There are some arbitrary limitations, e.g. the
MAX_HOLDparameter inintercept.js, or the fact that only up to three "holes" are allowed in template rules. This is done in the interest of getting something working - The extension only works on
claude.aiand is reliant on its current behaviour; interception is also not guaranteed to be perfect

