ccdwyer/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, so the model sees broken types on the step that caused them.
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。
Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.
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