Pkgtruth banner
hxckya hxckya

Pkgtruth

AI community

Description

Ground truth about npm packages for AI coding agents. Catches hallucinated and slopsquatted dependencies before they reach your lockfile.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

pkgtruth

[![npm](https://img.shields.io/npm/v/pkgtruth)](https://www.npmjs.com/package/pkgtruth) [![CI](https://github.com/hxckya/pkgtruth/actions/workflows/ci.yml/badge.svg)](https://github.com/hxckya/pkgtruth/actions/workflows/ci.yml) [![node](https://img.shields.io/node/v/pkgtruth)](https://nodejs.org) [![license](https://img.shields.io/npm/l/pkgtruth)](LICENSE)

**Ground truth about npm packages, for AI coding agents and CI.**

![pkgtruth catching a hallucinated package and a slopsquat](https://raw.githubusercontent.com/hxckya/pkgtruth/main/assets/demo.gif)

Your agent just wrote `npm install unused-imports`. That package is not the linter plugin it meant. It is a name an attacker registered because models kept inventing it — and npm has since replaced it with a security placeholder.

`pkgtruth` catches that before it reaches your lockfile.

Why this exists

Large language models invent package names. Measured across models, **19.7% of generated package names were hallucinated**, and when researchers re-ran the prompts, **43% of those names came back every single time.**

That reproducibility is the whole attack. An attacker does not need to compromise a maintainer, poison a build server, or find a vulnerability. They watch what models invent, register the name, and wait. The technique is called **slopsquatting**, and it is already happening in the wild.

The standing security advice is that agents with package-management capabilities should not install anything without a review gate. `pkgtruth` is that gate, in a form an agent can call on its own.

Install

As an MCP server (for coding agents)

{
  "mcpServers": {
    "pkgtruth": {
      "command": "npx",
      "args": ["-y", "pkgtruth"]
    }
  }
}

Two tools become available:

Tool Use it when
check_package About to add, import, or recommend one dependency
check_dependencies About to write a package.json or run an install command

As a CLI (f