Claude Code Security Plugin
Claude Code installs packages on its own when it runs npx, npm install, pip install or claude mcp add. The SkillTotal plugin checks each npm, PyPI or MCP package before the command runs. The check uses the open-source SkillTotal engine and runs on your machine.
Last updated
What happens when the agent installs something
- Malicious indicators. The command is denied, and the agent is told the finding and its file:line.
- High or critical risk. Claude Code asks you to approve the install and shows the top finding.
- A name a letter or two from a popular package. Claude Code asks you to check the name first.
- Anything SkillTotal could not check. Claude Code asks you. This covers:
- a package from a custom registry or index, set by an option (
--registry,--index-url,--extra-index-url) or an environment variable (npm_config_registry,PIP_INDEX_URL) - a package name or an install command the shell builds when it runs (
npm i $PKG) - an install inside a
node -eorpython -cone-liner - a direct archive URL
- a git ref the scan cannot reproduce exactly
- a check that failed
- a check that did not finish in time (it goes on in the background, so the same command, run again once it is done, gets its verdict)
- the sixth and later packages in one command
- a package with an install script SkillTotal could not read, or with nothing it could read
- an error inside the hook: outside CI, SkillTotal never denies an install because of its own failure
- a package from a custom registry or index, set by an option (
- Clean. The package installs as usual, and the agent gets a one-line note with the version that was checked and its score.
- CLI missing or fails to start. Outside CI, the install runs unchecked and nothing is blocked; Claude Code shows a warning on each one. In CI, every command is denied until the CLI works.
- In CI (strict mode). Nobody is there to answer a question, so anything SkillTotal would ask about is denied. So is an install it could not check (from a lockfile or a local path, or a downloaded script), unless
SKILLTOTAL_ALLOW_UNCHECKEDlists that kind (lockfile,local,script). A partly analyzed package passes, and its console line names what was not read;SKILLTOTAL_STRICT_PARTIAL=1denies it too. Strict mode is on whenCIor another CI variable is set;SKILLTOTAL_STRICT=0turns it off. In CI the hook waits up to 10 minutes for a large package's full check.
Packages from GitHub (github:owner/repo#v1.2.0, git+https://github.com/...@ref) are scanned at the ref that will be installed.
Set it up
Inside Claude Code, run:
/plugin marketplace add pezhik/skilltotal/plugin install skilltotal@skilltotalThen run /reload-plugins or restart Claude Code. Until you do, the hook does not check commands in the session where you installed it.
The plugin calls the SkillTotal CLI, so install that too:
pipx install skilltotalThe CLI must be version 1.9.0 or later (the plugin's own version) and installed where Claude Code can find it. If skilltotal --version works in the terminal Claude Code uses, you're set.
To see it work without installing anything, ask the agent to run:
npm install --registry https://registry.example.invalid left-padClaude Code stops and asks you, with SkillTotal's reason. Nothing installs unless you approve it.
What it reads
The hook runs before each command the agent sends through the Bash or PowerShell tool. On Windows, Claude Code runs most commands through PowerShell, so both are covered.
It looks for packages that these commands would install:
- npm packages:
npm,pnpm,yarnorbunwithaddorinstall;npx,bunx,pnpx,npm exec,pnpm dlx,yarn dlx,bun x,npm create,volta installand Deno'snpm:packages - Python packages:
pip(also aspython -m pip, andpip download/pip wheel),uv,uvx,pipx,poetry add,pdm add,pipenv install,rye add,pixi add --pypiandeasy_install - MCP servers:
claude mcp add,claude mcp add-json,codex mcp addandgemini mcp add - Skills and extensions from GitHub:
npx skills add owner/repoandgemini extensions install(checking them needsgit) - Claude Code plugins and marketplaces:
claude plugin install name@marketplaceandclaude plugin marketplace add owner/repo. The hook scans what the entry fetches, and asks you about an entry it cannot resolve. - Editor extensions:
code --install-extension, checked on the Visual Studio Marketplace, and the same command ofcursor,windsurfandcodium, checked on Open VSX
An install that names no package (npm ci, npm install, pip install -r, uv sync) has nothing to scan by name. For these the hook looks the lockfile up on OSV's list of known malicious packages and denies a listed version, in and out of CI.
Other commands pass straight through. Running a program the project already has in node_modules/.bin (npx tsc) installs nothing, so the hook does not check it.
The hook reads a command the way the shell would, so it finds installs behind sudo, env, timeout, nohup, bash -c '...', eval '...', cmd /c, xargs and find -exec. It also finds them inside $(...), if blocks, loops and functions; in a script piped to a shell or fed to one through a here-document; and in chains like cd x && npm i y. In PowerShell it also follows $r = npm i ..., & { ... }, iex '...', Start-Process npm -ArgumentList ... and powershell -EncodedCommand.
Where it stops
The hook works from the command line. It does not read a script on disk (bash install.sh), a script the agent downloads and runs (curl ... | bash), or the aliases, functions and variables your shell profile defines. For code you don't trust, run the agent in a container.
It scans the package a command names, not the packages that one pulls in. An install from a lockfile or a requirements file gets the OSV lookup and no scan of its code. OSV lists known malware only, so a clean lookup means no known-malicious version, not that a package is safe.
Typing /plugin install yourself, the Extensions panel and automatic updates run no command, so the hook does not see them. The plugin's sentinel, skilltotal watch, scans what changed at session start and tells the agent at the next one. Between sessions, schedule skilltotal watch, or skilltotal guard --installed --state FILE to read every file; the installed components guide shows how to schedule it.
All checks for one command share a 60-second budget, which you can raise with SKILLTOTAL_HOOK_BUDGET (up to 100 seconds). If a package isn't checked in time, or its check fails, Claude Code asks you before the install runs. Once a package is downloaded, the hook uses its size to estimate how long the check will take. If that does not fit in the time left, Claude Code asks you right away instead of waiting it out. A check the hook stops waiting for goes on in the background, so the same command, run again once it is done, gets its verdict. In an unattended run (claude -p), Claude Code turns a question nobody can answer into a denial; once a package's background check is done, the same command goes through if the package is clean.
A verdict is reused for the same artifact: an exact npm release or PyPI file for a week, a git repository for an hour. Everything is scanned again when the engine version changes.
Also in the plugin
/skilltotal:scan <target>scans a component on demand.- The plugin registers the SkillTotal MCP server (
skilltotal mcp) with three tools:scan_component,diff_components(what changed between two versions) andlist_rules.
Team rollout, company mirrors and troubleshooting are covered in the plugin reference on GitHub.
Other agents
skilltotal hook install adds the same check to other coding agents and leaves their other hooks alone. An agent that cannot ask you gets a denial that says how to go ahead. Each agent has a tier that says how far its hook has been tested:
- Claude Code: verified against Claude Code 2.1.316 on 2026-10-31
- Gemini CLI: hook tested in Gemini CLI 0.45.2 on 2026-10-31 with a stand-in model; not yet run with a live model
- Cursor, Windsurf, Devin, Codex, VS Code Copilot: preview: built to the agent's documented hook format, not yet run in the agent
The agent hooks guide says what each hook can and cannot see, and has templates for a fleet.
FAQ
- Does it send my code anywhere?
- No. The check runs in the SkillTotal CLI on your machine. The CLI downloads the package from its public registry and analyzes it locally. The package's code is not uploaded anywhere, and you don't need an account. One lookup does leave your machine, and it is on by default: for an install that names no package, such as npm ci, the hook sends the names and exact versions of public-registry packages to OSV (api.osv.dev, run by Google) and nothing else. SKILLTOTAL_OSV=0 turns it off.
- Does it slow the agent down?
- Commands that don't install anything pass straight through. For install commands, all checks share a 60-second budget, and most packages take a few seconds. When a package is too large to check in the time left, Claude Code asks you as soon as its size is known. Its check goes on in the background, so the same command, run again once it is done, gets its verdict. A verdict is reused for the same release, so a repeat install of the same version doesn't wait on a new scan.
- What happens if the CLI isn't installed?
- Outside CI, installs run unchecked and nothing is blocked. Claude Code shows a warning on each one, so a broken setup doesn't look like a clean check. In CI, every command is denied until the CLI works, and the console line says how to fix it.
- Does it work on Windows?
- Yes. Claude Code on Windows runs most commands through PowerShell, and the hook checks both the Bash and PowerShell tools. The hook script itself runs under the sh that comes with Git for Windows, so Git for Windows needs to be installed.
- Does it run the package or call an LLM?
- No. The engine is deterministic (regex and AST analysis). It never executes the code it analyzes and never calls an LLM.