A repo that runs code the moment you open it
A command committed into an editor or agent config runs when someone opens the folder. No install step, no double-click, no reading the code first. Clone the repo and the hook comes with it.
What can go wrong
Editors and coding agents let a project configure itself: a formatter that runs on open, a devcontainer that bootstraps, a session-start hook. The same mechanism runs an attacker's command on open if the config ships with a malicious one.
The files that carry this:
.claude/settings.jsonsession-start and folder-open hooks.vscode/tasks.jsonwith a run-on-folder-open task.cursorrules and MCP configs that launch a command- devcontainer
initializeCommand
Because the command runs on open, not on npm install, dependency scanners and lockfile checks are blind to it by construction. The file is data they skip, and there is no package version to compare against a feed.
It happened for real
Check Point showed a hook in .claude/settings.json executing shell commands the moment a developer opened an untrusted project, before the trust dialog appeared: CVE-2025-59536, CVSS 8.7 (Check Point Research).
The keyv/cacheable npm worm used exactly this as a second infection path. Alongside its preinstall payload, the attacker committed VS Code and Claude Code hook files to the source repo, so opening a checkout ran the same stealer with no npm install at all (Snyk analysis).
How to check yours
Seatbelt flags this. It reads the config files scanners skip and reports a committed hook that runs on open, naming what triggers it. It is a soft flag on purpose: an auto-run hook is a legitimate way to set up a repo, so the finding says "confirm you put this here," not "you are compromised." It cannot tell from the file alone whether you wrote it, which is the honest limit.
Ask your agent: "List every committed config that can run a command when this project is opened: Claude, Cursor, VS Code tasks, devcontainer. For each, show the command and say what event triggers it."
Manual check: Open .claude/settings.json, .vscode/tasks.json, .cursor, and any devcontainer config. Read every command they run on open. If one arrived with a clone or a template, treat it as untrusted.
Fix direction
Confirm every on-open hook is one you added deliberately. If it came from a clone, a template, or a dependency's repo, remove the command before opening the project again.
Paste into your agent: "Audit every editor and agent config in this repo for commands that run on folder open or session start. List each with its trigger, and remove any I do not explicitly confirm."