redpen
A personal agent CLI plugin that marks up every prompt you type like
a teacher with a red pen — scoring your phrasing, highlighting what's
broken, and showing how a native speaker would say the same thing — all
in your chosen target language. Designed for developers who want passive
writing practice while doing their day job at the terminal.
Currently supports two agent CLIs as separate but feature-parallel plugins,
plus an experimental launcher for Codex App:
The two CLI plugins share the same architecture (UserPromptSubmit hook +
systemMessage emit), scoring rubric, target languages, and shared
render_diff.py. The Codex App launcher reuses the Codex runner but renders
feedback in the app DOM instead of a CLI hook channel. Your original prompt
always reaches the model unchanged — the feedback is shown to you only, never
added to the model's context. redpen is a coach, not a rewriter: the goal
is for you to read the correction, notice what was off, and write a little
better next time.
Supported languages (both plugins):
- English
- 中文 (Chinese)
- Español (Spanish)
- 日本語 (Japanese)
Each time you submit a prompt, the plugin scores your phrasing, shows a
corrected version with the changes diffed inline (red strikethrough for what
was removed, green for what was added), and (optionally) a "native style" line
showing how a native speaker would phrase the same thing:
In Claude Code:
You: help me fix the bug, the app crash when click button
redpen: [62] help me fix the bug — the app crashes when I click the button.
──── Native style ────
any idea why the app crashes whenever I click that button?
The assistant then proceeds to answer your original prompt normally.
In Codex CLI the same 3 rows appear, but the divider and native-style
line start at the left margin (no indentation), because the plugin pads
each section with spaces to the terminal column boundary so natural wrap
produces the row breaks — Codex's systemMessage channel is a
single-string toast that strips all newlines (see
Platform differences):
You: help me fix the bug, the app crash when click button
redpen: [62] help me fix the bug — the app crashes when I click the button.
──── Native style ────
any idea why the app crashes whenever I click that button?
The assistant then proceeds to answer your original prompt normally.
The feedback is delivered via the host CLI's systemMessage channel
(supported by both Claude Code and Codex), so it's visible to you but
never added to the model's context — the assistant only ever sees
your original wording, and your conversation stays clean.
Platform differences
The two plugins are feature-parallel, but each host CLI has its own
constraints:
| Claude Code (redpen) | Codex CLI (redpen-codex) |
|---|
| Config | ~/.claude/redpen.config | ~/.codex/redpen.config |
| Default model | haiku (alias), user-configurable via /redpen:setup | gpt-5.4-mini, locked in v0.3.0 (only model that works on ChatGPT-account Codex auth — edit plugins/redpen-codex/hooks/grammar_check.sh to override) |
| Setup invoke | /redpen:setup | $redpen-setup (Codex skill — TUI only) |
| Hook target | claude -p | codex exec |
| Output layout | multi-line (score / divider / native style) | visually 3 rows (score / divider / native style), same divider label as Claude Code — Codex's systemMessage channel is a single-string toast that strips all newlines, so the plugin pads each section to the terminal column boundary and relies on natural terminal wrap for the row breaks |
The two configs live at independent paths (~/.claude/redpen.config vs
~/.codex/redpen.config), so both plugins can be installed side-by-side
without colliding.
Install (Claude Code)
# 1. Register this repo as a marketplace
/plugin marketplace add 12og3r/redpen
# (https://github.com/12og3r/redpen also works)
# 2. Install the plugin
/plugin install redpen@redpen
# 3. Restart Claude Code so the UserPromptSubmit hook registers
Install (Codex CLI)
# 1. Register this repo as a Codex marketplace
codex plugin marketplace add 12og3r/redpen
# 2. Install the Codex plugin (note the @redpen marketplace suffix)
codex plugin add redpen-codex@redpen
Defaults: out of the box (no config file), redpen-codex coaches in
English with the native-style hint on. Send any prompt and you
should see a [NN] <rewrite> → <native-style> line. No setup
required.
Codex App experimental launcher