HN 提问:编码客户端是否应默认导入另一个客户端的规则?
2 分•作者: ryanmerket•大约 2 个月前
一个AI编码客户端会自动读取 `~/.codex/AGENTS.md` 和 `~/.claude/CLAUDE.md`。这些是位于用户选择的项目之外的、竞争性编码客户端配置目录内的个人指令文件。
默认情况下,其全部内容会被添加到第一个模型请求中,并发送到客户端的服务器。
启动时,客户端会显示一个简短的通知,说明它正在包含其他客户端的个人规则。它不会事先征求许可。一个命令行选项可以禁用此行为。
配置指南中写道:“您的全局用户规则始终会加载。”它要求用户在加载项目指令文件之前信任工作区。全局文件会自动加载。
我通过在 `~/.codex/AGENTS.md` 中放置一个无害的“金丝雀”指令进行了测试。在默认运行中,该客户端遵循了该指令。当禁用了外部个人上下文时,它没有遵循。
这些文件可能包含内部编码标准、基础设施引用、项目细节,或者某人粘贴后遗忘的凭据。
启动时的通知是否足以披露信息?在文档中描述此行为是否构成同意?您是否会期望一个编码客户端读取另一个供应商配置目录中的文件,并将其与第一个请求一起发送?
查看原文
An AI coding client automatically reads ~/.codex/AGENTS.md and ~/.claude/CLAUDE.md. These are personal instruction files inside competing coding clients' configuration directories, outside the project selected by the user.<p>Their complete contents are added to the first model request and sent to the client's servers by default.<p>At startup, the client displays a brief notice saying it is including the other clients' personal rules. It does not ask permission first. A command-line option disables the behavior.<p>The configuration guide says: "Your machine-wide user rules always load." It requires users to trust a workspace before loading project instruction files. The machine-wide files load automatically.<p>I tested this by placing a harmless canary instruction in ~/.codex/AGENTS.md. The client followed it during a default run. It did not follow it when foreign personal context was disabled.<p>These files can contain internal coding standards, infrastructure references, project details, or credentials someone pasted and forgot about.<p>Is the startup notice enough disclosure? Does describing the behavior in the documentation amount to consent? Would you expect one coding client to read files from another vendor's configuration directory and send them with the first request?