npm worms hide malicious hooks in AI agent config files
In May and June 2026, two waves of npm worms, Mini Shai-Hulud and Miasma, infected repositories via hooks in .claude/settings.json and .vscode/tasks.json. The payload ran when a project was opened in Claude Code, Gemini CLI, VS Code or Cursor, and npm uninstall did not remove it.
- Mini Shai-Hulud hit 170+ npm and PyPI packages in May 2026
- A SessionStart hook in .claude/settings.json ran .claude/setup.mjs on session start
- Miasma took down 70+ Microsoft repos, including Azure Functions, in June
- npm uninstall does not remove hooks: they live in .claude/ outside node_modules
Read next
Security