创建

登录 ReadmeX

或

了解我们如何处理你的信息: 隐私政策

ReadmeX

陪你读懂 AI 动态

今天,想先了解什么?

选一份动态总结,或直接聊聊你的问题。

社区和关注动态总结只属于你自己。

资讯

Claude Code用户讨论如何落实强制规则

AI 总结

一则Reddit讨论援引Anthropic的说明称,CLAUDE.md和自动记忆会向Claude Code提供上下文,但并非强制配置。讨论还以OpenAI Codex团队被转述的做法为参照,询问用户哪些规则应移入钩子或测试,并以精简的AGENTS.md配合检查工具来保障关键约束。

深度见解

这场讨论区分了Claude Code可读取的指导与能够阻止或验证操作的强制保障机制。

Anthropic's memory docs for Claude Code say CLAUDE.md and auto memory are both loaded at the start of every conversation, but Claude treats them as context, not enforced configuration. For anything that has to happen no matter what, the docs point to hooks (a PreToolUse hook can block an action).

That's easy to nod along to and still leave mandatory rules as polite sentences in a markdown file.

OpenAI's Codex team wrote something related in their Feb 2026 harness engineering post. Their "one big AGENTS.md" approach failed (context crowded out, rules went stale), so they cut it to a roughly 100-line map that points to deeper docs, and enforced the invariants that mattered with linters and tests instead of prose.

I'm curious how people here actually split it:

- What lives in CLAUDE.md (conventions, where things are, how to run stuff)?

- What did you move into a hook or a test because Claude kept missing it?

- What did you delete because it stopped being true?

Sources: Claude Code docs ("How Claude remembers your project"), OpenAI "Harness engineering: leveraging Codex in an agent-first world" (Feb 11, 2026).

submitted by /u/ombre-ai [link] [comments]

#Anthropic#Claude Code#OpenAI Codex#CLAUDE.md#AGENTS.md

原文约 1 分钟读完阅读原文
群聊

还没有评论,来说说你的看法。