Release notes

What changed

Every published version, newest first. Upgrade notes are at the end of a release when there is something you need to do.

2026-11-17
Latest

Fixes the three problems the 1,000-repo scan listed as still open. The first one could make the agent hook block a good package.

Risk scoring

  • A missing download count no longer blocks a package. npm's downloads API rate-limits under load. When it didn't answer, an old package with one version and one maintainer, like server-only, was rated high risk and the hook blocked it. Now, if the package would not be high risk with real downloads behind it, it is rated medium and flagged "weekly downloads unavailable". A package created in the last 30 days, a typosquat with real downloads data, or an install script on a single version is still high. A timeout or server error from the downloads API now gets one retry.

Missing names

  • Names npm would refuse are no longer reported as claimable. npm rejects a new name that matches an existing one with ., - and _ removed, so nobody can register opencode while open-code exists. ghostimport now looks up the likely spellings and says which package blocks the name. Re-checking the scan's command names, this took 21 names off the claimable list. A missing name still blocks an install, since the install would fail.
  • Type-only imports of @types-only names are no longer reported missing. import type { Node } from 'estree' is answered by @types/estree; there is no estree package. A missing name is skipped when the project declares its @types package, or when it is only imported for types (import type, export type, a .d.ts file) and the @types package exists. A name declared in package.json is still reported, because npm install looks it up.
  • Messages about a missing name nobody can claim now give the actual reason: an owned scope, capital letters, or the punctuation rule. Before, the CLI said "scope is owned" for all of them.

Upgrading

  • No breaking changes. MissingRef and PackageVerdict gain optional unclaimableReason and similarTo fields, and the UnclaimableReason type is exported. Plugin users: update the plugin in /plugin and start a new session.
2026-11-15

Four more false-positive fixes, in the import scanner this time. I opened all 141 names the 1,000-repo scan flagged outside test folders, and none was a made-up import. These four bugs explain most of them. They affected the CLI, the MCP scan_project tool and the hook that checks files an agent edits.

Import scanner

  • Comments and strings are no longer read as imports. // import x from 'old-pkg', a JSDoc usage example, or code inside a template string (an esbuild stdin fixture, a code sample on a docs page) were all reported as imports of packages that don't exist.
  • A method that happens to be called require or import (access.require("session.read"), bundle.require("x")) is no longer read as a module load.
  • Dependencies that don't come from the npm registry are no longer reported missing. Code that imports the key of an npm: alias ("zod-3": "npm:zod@3"), or a dependency installed from GitHub, git, a tarball URL or file:, resolves locally. The real package behind an npm: alias is still checked.
  • Imports with a comment inside the braces (import {
      A, // used by X
    } from 'pkg'
    ) are now read. Before, they were silently skipped.
2026-11-14

False-positive fixes, found by running ghostimport over 1,000 public repositories built with AI coding agents and reading every command their docs, agent instructions and npm scripts ask an agent to run.

Agent hook and command reader

  • A # comment is no longer read as packages. npm install # Install dependencies made the hook look up Install and dependencies, and block a perfectly ordinary command. This was the largest source of noise in the corpus.
  • The values of install options are no longer read as packages: pnpm add -D x --filter @acme/web, npm i -w @org/app zod, --workspace, --prefix, --tag.
  • Specs that resolve inside the repo or on disk (@acme/sdk@workspace:*, link:, file:, portal:) are no longer checked against npm.

Risk scoring

  • An established package is no longer high risk for a short publish history. server-only has one version, one maintainer and over 30 million weekly downloads. Real adoption now outweighs a single version or maintainer, though not a package created in the last 30 days or an install script.
  • Scoped names are no longer typosquat-matched by the part after the slash (@ai-sdk/codemod was flagged as near nodemon). @types/* names still are, since they mirror the package they type.
  • A missing name with capital letters is no longer reported as claimable: npm rejects new package names with capitals.

Upgrading

  • No API changes. Plugin users: update the plugin in /plugin and start a new session.
2026-11-14

On Windows, Claude Code runs commands through its PowerShell tool, and the install hook only watched Bash. Most commands an agent ran there were never checked.

Fixes

  • The hook now checks the PowerShell tool too. The plugin's PreToolUse matcher is Bash|PowerShell, and the hook vets tool_name: "PowerShell" commands the same way it vets Bash ones.
  • PowerShell commands are read with PowerShell's quoting rules: backslashes are literal and the backtick escapes. Before, & C:\tools\npx.cmd -y some-pkg lost its backslashes and the package went unseen. The same rules now apply inside pwsh -Command '…'.

Upgrading

  • Plugin users: update the plugin (/plugin, then update ghostimport) and start a new session.
  • If you wired the hook into .claude/settings.json by hand, change its PreToolUse matcher from "Bash" to "Bash|PowerShell".
  • API: extractCommandTargets takes a new optional dialect: 'posix' | 'powershell'. The default is unchanged.
2026-11-14

Install

  • A Claude Code plugin. /plugin install ghostimport --marketplace FGuerreir0/ghostimport installs the blocking hooks and the MCP server together. The plugin runs the CLI bundled in the npm package, so there's no global install, no hand-edited settings.json, and no npx startup on every edit.
  • Listed in the official MCP Registry as io.github.FGuerreir0/ghostimport, so MCP clients and directories that read the registry can find it.

Agent hook

  • Commands that download and run a package are checked. npx, npm exec, npm create / npm init <x>, pnpm dlx, pnpx, yarn dlx, yarn create, bunx and bun create run a package's code immediately, with no postinstall needed. The hook now denies them when the package doesn't exist or looks malicious, as it already did for installs. npm create vite is checked as create-vite.
  • An unpinned npx of a bin the project already has installed (npx tsc) runs the local copy, so it isn't checked.
  • The command reader understands quotes, bash -c '…' and pwsh -Command scripts, sudo and env prefixes, and redirections: npm i axios > log.txt no longer reads log.txt as a package.

CI

  • The GitHub Action runs the ghostimport version matching its own tag instead of @latest, lists supply-chain findings in the step summary, and skips cleanly when the registry is unreachable.
  • The action's missing, risks, packages and result outputs now work. They were declared without values before, so they were always empty.

API

  • New: extractCommandTargets(command, { cwd? }) returns every package a command would install or run, each with action: 'install' | 'exec'. extractInstallTargets is unchanged.

Upgrading

  • No breaking API changes.
  • If you wired the hook into .claude/settings.json by hand, you can keep it or switch to the plugin. Don't run both, or every command is checked twice.
2026-11-11

The install hook was blocking popular, legitimate packages. Two risk signals counted as critical on their own, and both fire on packages with millions of weekly installs.

Fixes

  • An install script alone no longer makes a package high risk. esbuild, puppeteer, core-js and cypress all ship one, so npm install esbuild was denied. A script is now critical only on a package with no track record — created in the last 30 days, under 50 weekly downloads, or a single version — which is the shape a malicious package actually has.
  • A name near a popular package is only a typosquat when it has no adoption of its own. preact, redis, mysql, jsdoc and tslint are all one or two characters from a popular name; at 10,000 weekly downloads or more, a package is no longer flagged for it. axois and expresss are still blocked.
  • redux and bcryptjs were matched against remix and bcrypt before the exact-match check could see them. Popular names are now exact-matched first.

Upgrading

  • No API changes. With deep: true, verifyPackages() now reports typosquatOf: null for an established package whose name merely resembles a popular one.
2026-09-13

Checks

  • Dependencies in package.json are checked, even when nothing imports them. npm install fetches every declared dependency, so a name there that npm has never heard of is as squattable as one in an import. workspace:, file:, link:, git and URL specs are skipped, and npm: aliases are checked under the real package name.
  • Scoped names are only called squattable when the scope is free. Only a scope's owner can publish under it, so @babel/made-up is a broken import but not a target. ghostimport now asks the registry whether the scope has an owner — one request per scope, cached for 24 hours.

Agent hook

  • Edits to package.json are checked. When an agent writes a dependency that doesn't exist, the PostToolUse hook blocks it and tells the agent to fix the entry. Only the entries the edit wrote are checked, so bumping one version doesn't re-verify the whole file.

Output

  • Entries in missing carry claimable: boolean | null — false inside an owned scope, null when the scope couldn't be checked. Verdicts from verifyPackages() carry the same field. New exported type: MissingRef.
  • For a name in an owned scope, the CLI prints scope is owned — only its owner can publish this name instead of the squatting warning. The MCP scan_project tool marks those names the same way.

Upgrading

  • No breaking API changes.
  • CI may report new problems. A dependency that only exists on a private registry, and is declared in package.json without being imported, is now checked against public npm. Add it to ignore in .ghostimportrc.json.
  • The first scan of a project with many dependencies makes more registry requests than before. Later runs are served from the cache.
2026-08-30

False-positive fixes, found by running the scanner against 174 public repositories. Popular repositories reporting a problem fell from 19.1% to 12.8%, AI-assisted ones from 11.8% to 5.5%. The field report has the details.

Fixes

  • Nested package.json and tsconfig.json files are read, so workspace packages in a monorepo are no longer reported as missing.
  • Scoped path aliases match their subpaths: the alias @commands/* now answers the import @commands/types.
  • The JSONC parser no longer strips https:// inside strings, which had broken every Deno import map it read.
  • Docusaurus @theme/* and @site/*, and Deno @std/* and @deno/*, are recognised as framework scopes rather than npm names.
  • Build output such as .next, .vercel and .svelte-kit is no longer scanned.
  • Specifiers ending in a non-JavaScript extension, like shared.dart, are no longer read as package names.
2026-08-29

Maintenance release. No changes to the package code.

  • CI moved to actions/checkout and actions/setup-node v5.
  • Development setup moved from the README into CONTRIBUTING.md.
2026-08-29
Breaking

New

  • MCP server. ghostimport mcp lets an AI agent verify packages before it imports or installs them, through three tools: check_packages, check_install_command and scan_project. Still no runtime dependencies.
  • Agent hook. ghostimport hook blocks install commands that would fetch a package that doesn't exist, looks like a typosquat or ships an install script, and flags imports of missing packages right after an edit. It fails open: a network error never blocks the agent.
  • Install commands for npm, pnpm, yarn and bun are parsed, so the hook knows what they would fetch.

Changed

  • The unregistered-name and typosquat checks run by default. --scary is still accepted, so existing scripts keep working. The new --fast skips the deeper registry checks.
  • First release published from CI with an npm provenance attestation.

Breaking: library API

Public exports went from 11 to 7. Added: verifyPackages and extractInstallTargets. Removed from the public API: extractSfcScripts, loadCache, saveCache, loadConfig, walkFiles, readPackageJsonDeps and the CacheEntry type. Renamed:

v0.4.0v0.5.0
checkScary()checkPackageRisk()
ScaryEntryRiskEntry
ScaryCheckResultPackageRiskResult
ScanResult.hallucinatedScanResult.missing
ScanResult.notInPackageJsonScanResult.undeclared
ScanResult.scaryScanResult.risks
ScanOptions.scaryScanOptions.deep (defaults to true)
status 'hallucinated'status 'missing'
RiskEntry.type: 'available'RiskEntry.type: 'unregistered'

The CLI's JSON output follows the same field renames.

2026-07-11
  • Vue, Svelte and Astro. Imports in .vue, .svelte and .astro files are scanned. Only <script> blocks and Astro frontmatter are read, so a package name in markup is never flagged.
  • New logo.
2026-07-01
  • Typosquat detection. Names one or two characters away from a popular package are flagged.
  • checkScary() and detectTyposquat() are available from the library.
2026-06-29
  • --badge prints a README badge with the result of the scan.
2026-06-29

First public release: a CLI that finds imports of npm packages that don't exist, with --json, --watch, --quiet, a 24-hour registry cache, and --scary for the squatting checks.