Claude Code Mods Run With Your Permissions: A Security Checklist Before You Install
By: Evgeny Padezhnov
Claude Code Mods Run With Your Permissions: A Security Checklist Before You Install
A mod is someone else's TypeScript running inside your agent, as you. This is what I read before I let one in.
Updated 5 October 2026 · Claude Code 2.1.289
On 1 October 2026 Claude Code v2.1.287 shipped mods: TypeScript function hooks that run inside the agent. Within 48 hours there were over 1,000 of them.
I run a fleet of autonomous Claude Code agents on one Linux box, including one that touches a production Postgres. So I did not install a mod first. I read how they work, and ended up with this checklist on Claude Code mods security. Most of it applies to plugins and skills too.
The trust model in plain words
A mod is code running inside the agent with your user's rights. It can reach the network, your files, your processes and the model. There is no sandbox.
Think of a browser extension: you run someone's code with your rights. Except a mod lives in your terminal, next to your keys.
What a mod is allowed to do:
- intercept a tool call: deny it, rewrite its arguments, retry, or act on its result;
- rewrite the prompt and the system prompt;
- draw panes, bands above the prompt, status-line entries and toasts;
- add slash commands.
In VS Code, claude -p and the SDK only the hooks run, without UI. A mod can be working in your pipeline while showing you nothing.
Why this needs a checklist now
Adoption was fast: 359 mods across 373 repos on the first day, over 1,000 within 48 hours, by the count of the awesome-claude-code-mods list. Mods come from git marketplaces or the Claude directory. I have not seen a review process described for either, so I treat every mod as unreviewed until I have read it.
I know of no security study of mods yet. There is one of their nearest relatives. "Agent Skills in the Wild" (Yi Liu et al., arXiv 2601.10338, January 2026) scanned 31,132 skills from SkillsREST and SkillsMP:
- 26.1% had at least one vulnerable pattern;
- 13.3% had data-exfiltration patterns, 11.8% privilege escalation;
- 5.2% showed signs of malice: env-var harvesting, credential access, hidden instructions, external script fetching, obfuscation;
- skills with scripts were 2.12x more likely to be vulnerable.
A mod is all script. That last number is the one I keep in mind.
The API is also early access. The first lines of the types file say it "may change between releases without notice".
What a malicious mod could do
No invented incidents; the documented capabilities are enough:
- Read your files and reach the network. Both are listed abilities, with your permissions. Together, that is exfiltration.
- Rewrite the system prompt. The
prompt.composeevent adds, replaces or drops system-prompt sections. Every turn can be steered. - Rewrite tool arguments. A
tool.callhook receives the call aseand passes it on withnext(e).next({ ...e, command })hands the plugins beneath and the engine a different command than the model asked for. - Answer instead of the engine. A hook that returns without calling
nextanswers by itself; nothing beneath it runs.
None of this is a bug. It is the feature set, used by the wrong author.
The checklist
Pin to a commit SHA, not a branch. Git marketplaces support pinning to a SHA. A branch is whatever the author pushes next; a SHA is the code you actually read.
Read
hooks/register.ts. A mod is three files:.claude-plugin/plugin.json,hooks/hooks.json(it lists the modules to load) andhooks/register.ts. The last one is the mod. Look for:- every
$.call. The engine interface is spelled$.noun.method, and the module has no Node and norequire, so there are nofsorchild_processimports to grep for; prompt.compose, which touches the system prompt;tool.callhooks that callnext({ ...e, which rewrite arguments;- hooks that return without
next, and what they return.
- every
Run
claude plugin validate <dir>and read its surface. It reads the manifest and module source the way the engine will, and lists what the module hooks and calls:hooks: tool.call{tool=Bash} calls: $.ui.toastThose lines are the mod's surface. If a "status-line widget" lists calls beyond the UI, ask why. The output also names anything the engine would refuse.
Prefer mods with tests.
claude plugin test <dir>runs*.test.tsfiles against the engine, and tests are the author's own statement of what the mod does. One caveat: on our boxclaude plugin testrefused to run ("hooks modules are turned off in this process: the rollout switch was saved off by an earlier session"). Mods are on by default since 2.1.287, but the CLI keeps a remote switch for them, and on our box it had been saved off. Validate plustscagainst the types file is what we could verify.Check maintainer and freshness. Who wrote it, what else they shipped, when the last commit was. With an API that may change without notice, a stale mod is also an unpredictable one.
Try it first with
--plugin-dirin a throwaway project.claude --plugin-dir <folder>loads a mod locally. Do it in an empty project, ideally as a user that holds no keys, and watch it before it meets real work.Keep secrets out of the project tree. This does not stop a mod set on reading your home directory; it runs as you. It does keep secrets out of the place the agent reads and edits all day, where a careless hook or a rewritten tool call has the least distance to go.
Be extra careful with mods that touch the system prompt. A
prompt.composehook changes the instructions the model works under, not one call. Unless that is the mod's stated purpose, skip it.Re-review on every update, then pin again. New SHA, new read, new validate. Compare the
hooks:andcalls:lines with the last version: a mod that gains a call has changed what it is.Remove what you don't use. An idle mod is still code with your rights.
For teams: one approved list. Keep a private marketplace, a git repo you control, with the mods you reviewed pinned to SHAs, and point everyone at it. A practice, not a product.
What we do on our fleet
Our rule for agents touching prod: snapshot first, name the rollback before the change, deploy only through a script with a health gate. Mods get the same treatment.
In June 2026 we built a settings-based PreToolUse security gate. In three months it made 752 approval requests and got 18 human decisions; 734 timed out, about 57 hours of frozen agents. The mechanism worked; the human-approval process did not. Deterministic deny rules carried the weight. The numbers are in the security gate case study.
That is why our own example mods are small and readable on purpose. They are free examples, validated with claude plugin validate on 2.1.289 and type-checked with tsc. Our safe-shell rule set was tested on 21 commands: 12 blocked, 9 passed.
Here is the core of spend-guard, which caps what a session may cost:
// Refuse a new prompt once the session is over the cap.
on('prompt.submit', async ($, e, next) => {
const now = await spent($)
if (now >= cap) return { drop: `spend-guard: this session has cost ${usd(now)}, cap is ${usd(cap)}. Raise capUsd in /config or start a fresh session.` }
return next(e)
})
Here spent($) is a one-line top-level helper that reads $.session.usage(). You can review this in a minute: it drops a prompt over the cap and otherwise passes it through unchanged. A mod that cannot be read like this is telling you something.
More: the complete Claude Code guide, how we tell whether a skill fired, and what 1,939 MCP tool calls showed us.
FAQ
Are Claude Code mods sandboxed?
No. The module runs in its own environment without Node or require, but that is not a sandbox: a mod reaches the network, files, processes and the model with your user's permissions.
Does anyone review mods? Mods come from git marketplaces or the Claude directory, and I have not seen a review process described for either. Assume nobody reviewed the mod you are about to install, and review it yourself.
Is a pinned SHA enough? No. A SHA guarantees you run the code you read, not that the code is safe. Pin, then read.
What does claude plugin validate show?
What the module hooks and calls, for example hooks: tool.call{tool=Bash} and calls: $.ui.toast, plus anything the engine would refuse.
Are Claude Code skills safer than mods? Not by default. The study cited above, of 31,132 skills, found 26.1% with at least one vulnerable pattern, and skills with scripts were 2.12x more likely to be vulnerable. A mod is code by definition, under the same trust model as a browser extension.
Information is accurate as of the publication date. Terms, prices, and regulations may change — verify with relevant professionals.