You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hook rewrites npm run <script> -w <workspace>, breaking npm's --workspace flag #2098
The Claude Code hook collapses npm run <script> -w <ws> into rtk <script> -w <ws>, dropping npm run and passing npm's --workspace (-w) flag to the tool. For tsc/vitest, -w is --watch, so the command starts a watcher that never exits.
Repro:
$ rtk hook check 'npm run tsc -w backend'
rtk tsc -w backend # -w is now tsc --watch → hangs forever
Expected: -w <name> after npm run <script> is npm's workspace selector and must be preserved (run npm run <script> --workspace <ns> or leave the command untouched), not handed to the tool.
Affected (all collapse and mis-handle -w): tsc, vitest, jest, lint, next, prisma.
Workaround that does NOT work: transparent_prefixes = ["npm run"] produces the broken npm run rtk tsc -w backend (strips the prefix, rewrites the remainder, re-prepends). Only exclude_commands = ["npm"] avoids it, at the cost of skipping all npm.
Hook incorrectly strips npm run and passes npm's -w <workspace> flag directly to the underlying tool (e.g. tsc, vitest), where -w means --watch, causing the command to hang indefinitely; fix requires the hook to detect and preserve npm workspace flags.
📁 Relevant files
src/hook/rewrite.rs
src/hook/npm.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Reproduced on develop (97e68d53, Windows 11) with lint. npm run lint -w web (also -ws, --workspace web, --workspace=web, --workspaces) rewrites to rtk lint <same flags>. rtk lint then runs eslint -f json -w web . instead of the workspace's lint script, so in a two-workspace npm fixture the script never runs and the output is ESLint output (JSON parse failed: EOF while parsing a value at line 1 column 0).
#5276 fixes this: with its head, none of these forms is rewritten, and plain npm run lint still rewrites to rtk lint. The validation details are in #5276.
Activity
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
bughighSummary
Hook incorrectly strips
npm runand passes npm's-w <workspace>flag directly to the underlying tool (e.g. tsc, vitest), where-wmeans--watch, causing the command to hang indefinitely; fix requires the hook to detect and preserve npm workspace flags.📁 Relevant files
src/hook/rewrite.rssrc/hook/npm.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
itsManeka commentedon Nov 26, 2026
Reproduced on
develop(97e68d53, Windows 11) withlint.npm run lint -w web(also-ws,--workspace web,--workspace=web,--workspaces) rewrites tortk lint <same flags>.rtk lintthen runseslint -f json -w web .instead of the workspace'slintscript, so in a two-workspace npm fixture the script never runs and the output isESLint output (JSON parse failed: EOF while parsing a value at line 1 column 0).#5276 fixes this: with its head, none of these forms is rewritten, and plain
npm run lintstill rewrites tortk lint. The validation details are in #5276.