ccdwyer/red-squiggle

一个 Claude Code 模组,会对 Claude 刚编辑的文件进行类型检查和 lint,并把所有错误放进同一个工具结果中,让模型在造成问题的那一步就看到损坏的类型。
ccdwyer/red-squiggle

Red Squiggle hook 会在每次成功的 Edit 或 Write 之后运行,对刚编辑的文件进行类型检查和 lint,并把错误放入同一个工具结果中,让模型在造成问题的当下看到错误,而不是等几回合后测试失败才发现。
支持的检查器包括:
只报告“新”错误:每个检查器都会维护基线并逐一统计错误。第一次遇到项目或文件时先建立基线,只显示本次编辑新引入的错误,以及本次编辑新弄坏的其他文件错误。输出会以带引号的上下文附加在工具结果之后,上限为 20 行,并标记为数据而非指令。状态行会显示文件是否干净或有多少错误;检查器缺失、崩溃或超时(默认 30 秒)时会 fail-open,保留原始结果。同一项目一次只运行一个 tsc,项目查找会在 repo 根目录停止,不会安装任何东西,也不会改用 npx。
可以通过 /config 切换 tsc、eslint、ruff 和 timeoutSeconds。安装方法是加入 ccdwyer/claude-mods marketplace 后安装 red-squiggle。所有检查都在本地执行,不发送网络数据,也不收集遥测。许可证为 MIT。
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add ccdwyer/red-squiggle claude plugin install red-squiggle

A Claude Code mod that type-checks and lints the file Claude just edited and puts any errors into that same tool result. The model sees broken types on the step that caused them, not three turns later when a test run fails.
Red Squiggle runs after each successful Edit or Write. It skips edits that errored and edits staged for review.
| File | Checker | Notes |
|---|---|---|
| .ts .tsx .js .jsx .mts .cts .mjs .cjs | the project's own TypeScript (node_modules/typescript/bin/tsc) | Runs --noEmit --incremental on the config whose program contains the file. It reads include, exclude, files, allowJs and checkJs through extends (relative, package and array forms) with real glob matching, and recursively follows references. A file that no glob takes, but that may be in a program through an import, is checked against the nearest config, and --listFiles decides. A build-info file goes under node_modules/.cache/red-squiggle/. |
| same | the project's own node_modules/.bin/eslint | Only when an eslint config exists. Runs from that config's folder with --format json --quiet, so it reports errors only. |
| .py | ruff check --no-fix | Uses .venv/bin/ruff, then venv/bin/ruff, then ruff on PATH. JSON output. |
✓ file clean, ✗ N errors in file, or how many errors are new in other files. "Clean" means the file was proven to be in the program tsc checked (--listFiles). A file outside every program, or a run cut off before it proves the file was checked, reports nothing rather than "clean". Paths are compared through their real spelling (/tmp vs /private/tmp)..git). It never installs anything or falls back to npx./config lists tsc, eslint and ruff toggles and timeoutSeconds.
/plugin marketplace add ccdwyer/claude-mods
/plugin install red-squiggle@ccdwyer-mods
/reload-plugins
claude plugin validate .
claude plugin test .
Events this mod hooks, as claude plugin validate reads the module:
tool.callEngine calls it makes: $.fs.exists, $.fs.read (via eslintPlan, readJson), $.fs.stat (via canonical), $.process.run (via run), $.state.get, $.state.set, $.ui.status (via annotate).
A tool.call hook sits in the middle of every tool call: it can see the call, refuse it, or add context to its result. This mod uses that only for the behaviour described above.
It runs entirely on your machine. It sends nothing over the network. It runs your project's own tsc, eslint and ruff.
The mod collects no analytics or telemetry, and its author receives no data from it.
Full policy: PRIVACY.md.
MIT