PreToolUse skill-injection hook fires on any project with matching basename, not just Vercel projects
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start in hooks/pretooluse-skill-inject.mjs and compare its project checks with profileProject() in session-start-profiler.mjs. Apply the existing Vercel/Next.js detection before basename matching, then reproduce the Bun CLI case to confirm matching files no longer trigger injections while Vercel projects still do.
Written by the indexing model from the issue text.
Description
Summary
The Vercel plugin's PreToolUse hook (hooks/pretooluse-skill-inject.mjs) matches on file basename alone (README*, package.json, tsconfig.json, etc.) without checking whether the current project is actually a Vercel/Next.js project. The result: in a non-Vercel project (e.g. a Bun CLI, a generic Node tool, a Rust binary that happens to have a README.md), every Write/Edit on a matching filename triggers a MANDATORY: Your training data for these libraries is OUTDATED injection that tells the agent to invoke Skill(bootstrap) / Skill(next-upgrade) / Skill(nextjs) — irrelevant to the project at hand.
Steps to reproduce
- Create a non-Vercel project:
mkdir my-cli && cd my-cli && git init && bun init -y - In a Claude Code session,
WriteaREADME.md(orpackage.json, ortsconfig.json) - Observe the PreToolUse hook injecting Vercel/Next.js skill guidance even though the project has no
vercel.json, nonext.config.*, no@vercel/*dependency, nonextdependency
Expected
The hook should run the same project-type detection that session-start-profiler.mjs already does (looks for vercel.json, next.config.{js,ts,mjs,mts}, @vercel/* / next in package.json deps) and early-exit when none match.
Concretely
A guard like the one in session-start-profiler.mjs:profileProject() applied at the top of pretooluse-skill-inject.mjs before any basename matching would solve it. Same detection logic, just lifted into the per-file hook.
Impact
Every file write in a non-Vercel project triggers a MANDATORY instruction the agent must explicitly override. For a multi-file scaffold (e.g. spinning up a new repo) that's 5-15 false-positive prompts per session, adding tokens and noise. Acknowledging each one in narration is a poor user experience.
Context
Plugin version: 0.32.4 (current as of 2026-05-27)
Observed on: macOS, Claude Code with claude-plugins-official marketplace.
Filed by an end user via Claude Code after the false-positive fired on every file of a Bun CLI scaffold. Happy to PR if useful.
- Dominant language
- TypeScript
- Stars
- 287
- Forks
- 58
- Avg merge
- 1d 24m
- Merged PRs (30d)
- 18
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/vercel-plugin
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
vercel/vercel-plugin#199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
vercel/vercel-plugin#182 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vercel/vercel-plugin#172 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
vercel/vercel-plugin#167 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vercel/vercel-plugin#146 ·
All issues in vercel/vercel-plugin
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100