A CLAUDE CODE MOD CAN READ YOUR API KEYS AND APPROVE COMMANDS BEFORE YOU SEE THEM. HERE'S HOW TO CHECK ONE IN 30 SECONDS. not a theory. it's written on Anthropic's own mods page. once a mod loads, it can: → read and write files anywhere your user account can → read your environment variables and settings files, API keys included → see every prompt you send and every tool call Claude makes → rewrite a prompt or a tool call → approve a tool call before you're asked → spend your usage by calling a model mods aren't sandboxed either. sandboxing isolates the Bash commands Claude runs. a process a mod starts runs outside it. the one thing a mod can't touch is the permission prompt. it can't change what that prompt shows you. so here's the 30-second check before installing anything from a stranger: 01. get the files without running them git clone the repo. don't install yet. 02. run the validator claude plugin validate ./the-mod it reads the code without running it and tells you exactly what the mod does. 03. read the "hooks:" line the events it listens to. a theme should be drawing things. if a theme also hooks every tool call, ask why. 04. read the "calls:" line everything it asks Claude Code to do. a skin calling http.fetch is a red flag. a cost tracker writing files outside its own folder is a red flag. anything calling a model is spending your usage. 05. look for "env reads:" if the mod reads environment variables, the validator prints that line. a timer has no reason to read your keys. 06. know your brakes before you need them → one mod: /plugin, Installed tab, disable it → every mod you installed, one session: claude --safe-mode → every mod you installed, every session: "disableAllHooks": true in ~/.claude/settings.json (this also stops your settings hooks and custom status line) one more trap if you write your own guard mod: a hook that throws gets skipped, and the command it was meant to stop runs anyway. give every guard a .catch and test that it actually blocks. good news for the mods Claude writes for you: they only load after you approve hot reload, only in a workspace you've trusted, and never in claude -p where nobody can say yes. mods are the best thing to happen to Claude Code in a long time. just treat them like browser extensions that run as you, because that's what they are. the full safety section, the install order and every command are in the article below.
一个 CLAUDE CODE 模组可以在你看到之前就读取你的 API 密钥并批准命令
一个 CLAUDE CODE 模组可以在你看到之前就读取你的 API 密钥并批准命令。以下是如何在 30 秒内检查一个模组。
关于这个 mod
一个 CLAUDE CODE 模组可以在你看到之前就读取你的 API 密钥并批准命令。以下是如何在 30 秒内检查一个模组。
这不是理论。它写在 Anthropic 自己的模组页面上。
一个模组一旦加载,它可以:
→ 在你的用户账户能访问的任何地方读写文件 → 读取你的环境变量和设置文件,包括 API 密钥 → 看到你发送的每一条提示以及 Claude 进行的每一次工具调用 → 重写一条提示或一次工具调用 → 在你被询问之前批准一次工具调用 → 通过调用模型消耗你的用量
模组也没有沙箱隔离。沙箱隔离的是 Claude 运行的 Bash 命令。模组启动的进程在沙箱之外运行。
模组唯一不能碰的是权限提示。它不能改变那个提示向你显示的内容。
所以,在安装任何来自陌生人的东西之前,这里是 30 秒检查:
- 获取文件但不运行它们
git clone 仓库。先不要安装。
- 运行验证器
claude plugin validate ./the-mod
它读取代码而不运行它,并准确告诉你这个模组做什么。
- 读取 "hooks:" 行
它监听的事件。一个主题应该是用来绘制东西的。如果一个主题还挂钩每一次工具调用,问问为什么。
- 读取 "calls:" 行
它要求 Claude Code 做的所有事情。一个皮肤调用 http.fetch 是一个危险信号。一个成本跟踪器在自己的文件夹之外写文件是一个危险信号。任何调用模型的东西都在消耗你的用量。
- 寻找 "env reads:"
如果模组读取环境变量,验证器会打印那一行。一个计时器没有理由读取你的密钥。
- 在需要之前了解你的刹车
→ 一个模组:/plugin,已安装标签页,禁用它 → 你安装的每一个模组,一个会话:claude --safe-mode → 你安装的每一个模组,每个会话:在 ~/.claude/settings.json 中设置 "disableAllHooks": true(这也会停止你的设置钩子和自定义状态行)
如果你编写自己的防护模组,还有一个陷阱:一个抛出的钩子会被跳过,而它本应阻止的命令无论如何都会运行。给每一个防护加上 .catch,并测试它确实能阻止。
对于 Claude 为你编写的模组来说,好消息是:它们只在你批准热重载后加载,只在你信任的工作区中加载,并且永远不会在 claude -p 中加载,因为在那里没有人能说不。
模组是 Claude Code 在很长一段时间里发生的最好的事情。只是要把它们当作以你的身份运行的浏览器扩展来对待,因为它们就是这样。
完整的安全部分、安装顺序和每一条命令都在下面的文章中。
安装
安装方法请查看原始来源。
原文 / README
A CLAUDE CODE MOD CAN READ YOUR API KEYS AND APPROVE COMMANDS BEFORE YOU SEE THEM. HERE'S HOW TO CHECK ONE IN 30 SECONDS.
not a theory. it's written on Anthropic's own mods page.
once a mod loads, it can:
→ read and write files anywhere your user account can → read your environment variables and settings files, API keys included → see every prompt you send and every tool call Claude makes → rewrite a prompt or a tool call → approve a tool call before you're asked → spend your usage by calling a model
mods aren't sandboxed either. sandboxing isolates the Bash commands Claude runs. a process a mod starts runs outside it.
the one thing a mod can't touch is the permission prompt. it can't change what that prompt shows you.
so here's the 30-second check before installing anything from a stranger:
- get the files without running them
git clone the repo. don't install yet.
- run the validator
claude plugin validate ./the-mod
it reads the code without running it and tells you exactly what the mod does.
- read the "hooks:" line
the events it listens to. a theme should be drawing things. if a theme also hooks every tool call, ask why.
- read the "calls:" line
everything it asks Claude Code to do. a skin calling http.fetch is a red flag. a cost tracker writing files outside its own folder is a red flag. anything calling a model is spending your usage.
- look for "env reads:"
if the mod reads environment variables, the validator prints that line. a timer has no reason to read your keys.
- know your brakes before you need them
→ one mod: /plugin, Installed tab, disable it → every mod you installed, one session: claude --safe-mode → every mod you installed, every session: "disableAllHooks": true in ~/.claude/settings.json (this also stops your settings hooks and custom status line)
one more trap if you write your own guard mod: a hook that throws gets skipped, and the command it was meant to stop runs anyway. give every guard a .catch and test that it actually blocks.
good news for the mods Claude writes for you: they only load after you approve hot reload, only in a workspace you've trusted, and never in claude -p where nobody can say yes.
mods are the best thing to happen to Claude Code in a long time. just treat them like browser extensions that run as you, because that's what they are.
the full safety section, the install order and every command are in the article below.
