<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>AGENTS.md on On My Way</title>
    <link>https://tuanzi-wow.cn/tags/agents.md/</link>
    <description>Recent content in AGENTS.md on On My Way</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Wed, 09 Sep 2026 19:00:52 +0800</lastBuildDate>
    <atom:link href="https://tuanzi-wow.cn/tags/agents.md/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>AGENTS.md 自定义指令</title>
      <link>https://tuanzi-wow.cn/codex/codex-agents-instructions/</link>
      <pubDate>Mon, 07 Sep 2026 00:00:00 +0800</pubDate>
      <guid>https://tuanzi-wow.cn/codex/codex-agents-instructions/</guid>
      <description>Codex 如何发现并读取 AGENTS.md：指令链、配置回退文件名与生效方式。</description>
      <content:encoded><![CDATA[<h2 id="custom-instructions-with-agentsmd">Custom instructions with AGENTS.md</h2>
<p>agents.md is read before doing any work</p>
<h2 id="how-codex-discovers-guidance">How codex discovers guidance:</h2>
<p>The instruction chain:</p>
<h3 id="1global-scope">1.Global scope:</h3>
<p>in your Codex directory(default~/.codex):
u can also use AGENTS.override.md,but only the first non-empty AGENTS.md is read</p>
<h3 id="2project-scope">2.Project scope:</h3>
<p>At the project root
in each directory along the path,it checks for AGENTS.override.md ,then AGENTS.md,then any fallback names in <code>project_doc_fallback_filenames</code>.
Codex includes at most one file per directory</p>
<h3 id="3merge-order">3.Merge order:</h3>
<p>The later ,the higher : because they appear later in the prompt</p>
<h3 id="create-global-guidance">Create global guidance:</h3>
<p>1.make sure the directory exist:
2.create with reusable preference
3.run codex anywhere to confirm it loads the file</p>
<p>if you want a temporary global ,use AGENTS.override.md</p>
<h3 id="layer-project-instructions">Layer project instructions:</h3>
<p>1.In your repository root, add an <code>AGENTS.md</code> that covers basic setup
2.Add overrides in nested directories when specific teams need different rules. For example, inside <code>services/payments/</code> create <code>AGENTS.override.md</code>
3.Start Codex from the payments directory:</p>
<h3 id="add-code-reviews-rules">Add code reviews rules:</h3>
<p>For <a href="https://learn.chatgpt.com/docs/third-party/github#customize-what-codex-reviews">Codex code review in GitHub</a>, add a <code>## Code Review Rules</code> section to the <code>AGENTS.md</code> closest to the code the rules govern. Put repository-wide checks at the root and service-specific checks in a nested file.</p>
<h3 id="customize-fallback-filenames">Customize fallback filenames:</h3>
<p>if u use a customize filename,add it to the fallback list then Codex can really read it as a instructions file:
1.edit your  Codex configuration</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl"># ~/.codex/config.toml
</span></span><span class="line"><span class="cl">project_doc_fallback_filenames = [&#34;TEAM_GUIDE.md&#34;, &#34;.agents.md&#34;]
</span></span><span class="line"><span class="cl">project_doc_max_bytes = 65536
</span></span></code></pre></td></tr></table>
</div>
</div><p>2.Restart Codex or run a new command to update  configuration loads:</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
