subedit
Your house style, enforced in the places prose hides inside a codebase.
A subeditor is the person at a publication who makes every piece of copy match its house style. subedit does that job for the prose in your code.
Linters check your code. Almost nothing checks the sentences you write around it. subedit reads the comments and docstrings in your source, lays them out one sentence per line, and only tells you about the sentences a tool cannot fix for you.
Example
An editor wraps a comment at whatever column it reaches, so sentences break mid clause.
# Cap the buffer at the runner limit, because an unbounded
# read faults the job. Retry once, then give up.
subedit fix --write repairs the layout and says nothing.
# Cap the buffer at the runner limit, because an unbounded read faults the job.
# Retry once, then give up.
A sentence that runs past the width with no comma has nowhere legal to break, and only its author knows where the meaning divides. That one comes back to you, or to the agent that wrote it.
1 comment finding needs rewriting in src/cache.py.
Each states the fix. Apply it in place, do not add a suppression comment.
line 2 [unbreakable-sentence]
This sentence runs to 116 characters against a budget of 114 characters and contains no comma, so there is no legal place to break it. Add a comma at a clause boundary, or split it into two sentences.
Installation
Install the command line tool from PyPI.
uv tool install subedit
pipx install subedit and pip install subedit work as well. Add the vale extra, as in uv tool install 'subedit[vale]', to have Vale fetched for you.
Commands
Every command takes files or directories.
| Command | Result |
|---|---|
subedit check src/ |
every finding |
subedit check src/ --output=actionable |
only the sentences that need rewriting |
subedit fix src/ |
the repairs, as a diff |
subedit fix src/ --write |
the repairs, applied |
subedit stats src/ |
comment shapes across the codebase, for setting thresholds from data |
subedit rules |
every rule and who resolves it |
check and fix exit 1 while anything needs an author, so they drop into pre-commit or CI as they are.
Fix Kinds
Every finding says who can resolve it, and the whole design turns on that answer.
| Kind | Resolved by | Reaches you |
|---|---|---|
TARGETED |
the tool, silently | no |
REFLOW |
the tool, silently | no |
REWRITE |
only the author | yes |
Rewriting a sentence needs its meaning, which a deterministic process cannot supply. Everything else is repaired without a word, because each message costs the reader attention.
Agent Hook
subedit-hook runs after every file an agent edits. It repairs the mechanical findings in place, and exits 2 only when a sentence needs rewriting, which hands the message back to the model. In Claude Code a warning reaches the model too, as context beside the tool result, without blocking the edit.
Claude Code
The plugin needs only uv. It runs subedit from PyPI with the vale extra, and warms that environment in the background when a session starts, so no edit waits on the first download.
It also ships the subedit:judging-findings skill, which gives the model the criteria for every finding a tool cannot fix, such as when a spec identifier stays and a ticket number goes. Criteria in your CLAUDE.md, AGENTS.md, or a skill of your own come first.
/plugin marketplace add mroops0111/subedit
/plugin install subedit@mroops
To register it by hand instead, add this to .claude/settings.json.
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
"hooks": [{ "type": "command", "command": "subedit-hook" }]
}
]
}
}
Codex
Add this to ~/.codex/hooks.json.
{
"hooks": {
"PostToolUse": [{ "command": "subedit-hook" }]
}
}
Several Agents
Registering the hook with both agents is the normal case. Each agent names its edit tools differently, so every payload identifies its sender, and a payload from anything else exits 0 untouched. subedit-hook --help prints the payload shapes it accepts.
Configuration
Settings come from subedit.toml, or from [tool.subedit] in pyproject.toml, whichever sits closest above the file being checked.
[subedit]
line-width = 120
exclude = ["tests/fixtures/**"]
[rules]
mid-clause-break = "error"
block-too-long = { severity = "warning", line = 3, doc-public = 20 }
Rule names describe the problem they report. docs/rules.md lists every rule, generated from the rules themselves.
A rule at error fails check and stops an agent, while one at warning is shown as advice and blocks nothing. The same table sets the delegated Vale rules by name.
[rules]
"subedit.MidSentenceColon" = "error"
"subedit.DateRef" = "off"
Delegated Tools
check, fix, and the agent hook also run two tools, and fold their findings into the same report.
- Vale: punctuation, banned phrasing, and anything a markup aware prose linter already handles. Vale has no autofix, so its findings come back as rewrites. It runs where it is installed, or where the
valeextra fetched it. A repository without its own.vale.inigets the style that ships with subedit, whose rules are namedsubedit.*. - AutoCorrect: spacing and punctuation width between CJK and Latin text. Its corrections are applied silently, like any other mechanical fix. It arrives as a Python dependency, and reads
.autocorrectrcfrom the working directory.
--no-delegate skips both for check and fix.
Surfaces
Code comments are the first surface, and Markdown comes next.
| Surface | Status | Mostly enforces |
|---|---|---|
| Code comments and docstrings | working | layout, since comments sit inside a column limit |
| Markdown | planned | structure, since soft wrapped text barely needs layout |
| Markdown slides | planned | Markdown, with front matter left as it is |
Related Tools
subedit covers the one thing the usual Python tools leave alone.
| Tool | Checks |
|---|---|
| ruff | code structure |
| basedpyright | types |
| subedit | the natural language inside source |
License
MIT
Metadata
Release files for subedit 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| subedit-0.1.4.tar.gz | 102.7 kB | With provenance | Details for subedit-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| subedit-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for subedit-0.1.4-py3-none-any.whl |
Total release size: 159.9 kB
Release files / subedit-0.1.4.tar.gz
| Download URL | subedit-0.1.4.tar.gz |
|---|---|
| Size | 102.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c0c65c716fd80bdd5c429f353262ddd2ae506e06f68836690f4199b92144aee
|
|
BLAKE2b-256 checksum How to use checksums |
56b28ba73a3a0c47d4c1f9ffdf358c5dfc1c55abe1bf11984c626c2889a5fc1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / subedit-0.1.4-py3-none-any.whl
| Download URL | subedit-0.1.4-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d63a9eb5947df81071e0d3251b90049d00212938a4a3b223fb7a6d384c79547
|
|
BLAKE2b-256 checksum How to use checksums |
be0988ae7d032fc1ede852b1ebf78e9ca1b71c26fc075f9144f4b54a0e5c1045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for subedit 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for subedit-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.