Developer builds tool to auto-block hallucinated npm/PyPI packages in Claude Code
A developer has integrated SlopScan, an open-source API, into Claude Code to automatically verify npm and PyPI package names before installation. The tool addresses 'slopsquatting', where attackers pre-register hallucinated package names — which LLMs generate roughly 20% of the time — with malicious payloads on real registries. Around 43% of hallucinated package names are consistent across model runs, making them predictable targets for bad actors. The integration uses two complementary mechanisms: a skill file that Claude can consult on demand, and a deterministic PreToolUse hook that blocks installs without relying on the model's memory. SlopScan scores packages as SAFE, CAUTION, SUSPICIOUS, or DANGEROUS based on registry age, download counts, and GitHub signals.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in