Repository navigation
Description
Bug
The command-rewrite hook (rtk rewrite) hardcodes any <pm> run lint / <pm> lint invocation to the top-level rtk lint subcommand ("ESLint with grouped rule violations"), regardless of what the project's lint script actually does. This breaks any project where lint doesn't invoke ESLint directly — e.g. a Turborepo monorepo where lint is turbo run lint, which in turn runs a completely different command per workspace.
Compare with build/test, which are (correctly) rewritten to rtk pnpm run <script> — preserving whatever the real script is:
$ rtk rewrite "pnpm run lint"
rtk lint # <- wrong: assumes ESLint directly
$ rtk rewrite "pnpm run build"
rtk pnpm run build # <- correct: delegates to the real script
$ rtk rewrite "pnpm run test"
rtk pnpm run test # <- correct: delegates to the real script
$ rtk rewrite "npm run lint"
rtk lint # <- same bug, npm
$ rtk rewrite "pnpm lint"
rtk lint # <- same bug, pnpm shorthand
Reproduction
Minimal repro: any pnpm/Turborepo workspace where the root lint script is turbo run lint, and turbo.json has a lint task, but no eslint binary is installed as a direct dependency (workspaces run their own lint tooling or placeholders).
$ cat package.json
{
"scripts": { "lint": "turbo run lint", ... }
}
$ pnpm run lint
# Claude Code / shell hook rewrites this to `rtk lint`
undefined
[ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL] Command "eslint" not found
$ rtk pnpm run lint
# Correct: delegates to the actual script, works fine
$ turbo run lint
...
Tasks: 15 successful, 15 total
rtk lint tries to invoke eslint directly (likely via pnpm exec eslint or similar) instead of first checking what the project's lint script is configured to do. Since this repo doesn't have eslint installed as a direct dependency (lint delegates to Turborepo, which runs per-workspace placeholder scripts), it fails with a confusing, unrelated error — even though the actual lint command works perfectly when invoked without the rewrite.
Impact
Any agent/hook relying on rtk rewrite to transparently proxy pnpm run lint (or npm run lint) gets a false failure in monorepos / non-ESLint-direct setups, blocking automated workflows that gate on lint success (e.g. CI-like quality gates run by an AI agent before commit).
Suggested fix
Don't hardcode run lint → rtk lint. Instead, treat lint the same way build/test are already handled: rewrite to rtk pnpm run lint (delegate to the real script), and only route through the dedicated ESLint filter (rtk lint) when the resolved script is actually invoking eslint (e.g. by inspecting package.json#scripts.lint before deciding the rewrite target).
Environment
rtk --version: 0.43.0- Reproduced via Claude Code's rtk hook (
RTK.mdinstructsgit status→rtk git statusetc., transparently rewritten) in a pnpm + Turborepo monorepo.
Activity
pszymkowiak commentedon Jul 28, 2026
🔍 Automated Triage
bughighSummary
Command-rewrite hook hardcodes 'pnpm/npm run lint' to 'rtk lint' (assumes ESLint) instead of delegating like build/test do, breaking non-ESLint lint scripts (e.g. Turborepo); should inspect package.json's lint script before choosing the rewrite target.
📁 Relevant files
src/rewrite.rssrc/hook/rewrite.rssrc/lint.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
danilofuchs commentedon Aug 10, 2026
This breaks in our oxlint setup
Agents end up using 'rtk proxy pnpm lint'
KuSh commentedon Sep 5, 2026
Closing as a duplicate of #1489, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.