rabbit-rewrites
Model-backed rewriting
Detection in this plugin needs no model. scan.py is pure Python and runs on a Pi today. Rewriting is the part that needs one, and this is the path that uses a small local model for it rather than a frontier model.
Paths. ${CLAUDE_PLUGIN_ROOT}/skills/ means the directory holding this skill and its siblings (rabbit-writes, voice-setup, rabbit-readme-improver, rabbit-reads, rabbit-rewrites, rabbit-claude-md). Claude Code expands the variable. On a host that doesn't, such as Codex, resolve it that way by hand.
The design rests on three core principles: targeted chunking, persistent settings reuse, and gated execution.
1. Targeted chunking and context
Rather than sending entire documents (which exceed small model context windows and cause hallucinated edits), the engine chunks flagged prose into focused, contextual units:
- Sentence units with local context: A tell sitting in a sentence is chunked alongside its preceding sentence context. The model receives the target sentence, the specific problem to remove, and surrounding context to resolve pronoun referents, antecedents, and narrative tone without being asked to rewrite the context itself.
- Passage and block units: Structural and density tells (
uniformity,tier2-cluster,tier3-density) are chunked at the full paragraph level, sized against the endpoint's input budget. - Unit merging: Multiple findings landing within the same sentence are merged into a single rewrite unit, preventing colliding edits from invalidating the comparison baseline.
A 10,000-word draft with 40 findings becomes 40 focused 150- to 350-token requests, keeping token budgets tight while giving the model enough context to preserve flow.