<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yan Gao</title>
    <description>The latest articles on DEV Community by Yan Gao (@yan_gao_3ad90a90b26925538).</description>
    <link>https://dev.to/yan_gao_3ad90a90b26925538</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4066892%2F0e201c12-e1ce-4a7d-a0a8-5b09b8d98a83.png</url>
      <title>DEV Community: Yan Gao</title>
      <link>https://dev.to/yan_gao_3ad90a90b26925538</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yan_gao_3ad90a90b26925538"/>
    <language>en</language>
    <item>
      <title>Fix Codex default_permissions Without Disabling the Sandbox</title>
      <dc:creator>Yan Gao</dc:creator>
      <pubDate>Fri, 07 Aug 2026 09:35:08 +0000</pubDate>
      <link>https://dev.to/yan_gao_3ad90a90b26925538/fix-codex-defaultpermissions-without-disabling-the-sandbox-1bcp</link>
      <guid>https://dev.to/yan_gao_3ad90a90b26925538/fix-codex-defaultpermissions-without-disabling-the-sandbox-1bcp</guid>
      <description>&lt;p&gt;The Codex error saying that permission profiles exist without &lt;code&gt;default_permissions&lt;/code&gt; is not a request to disable safety. It means the effective configuration contains profile definitions but does not select a default profile.&lt;/p&gt;

&lt;p&gt;The fastest fix is to decide which configuration model the run should use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Path 1: keep the legacy sandbox model
&lt;/h2&gt;

&lt;p&gt;Use this path when the run already relies on &lt;code&gt;sandbox_mode&lt;/code&gt;, &lt;code&gt;approval_policy&lt;/code&gt;, or &lt;code&gt;[sandbox_workspace_write]&lt;/code&gt; settings.&lt;/p&gt;

&lt;p&gt;Keep those settings together and remove unused &lt;code&gt;[permissions.*]&lt;/code&gt; blocks. An explicit &lt;code&gt;--sandbox&lt;/code&gt; flag also selects this model for the run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Path 2: use permission profiles
&lt;/h2&gt;

&lt;p&gt;Use this path when you want a built-in or named profile. Remove loaded legacy &lt;code&gt;sandbox_mode&lt;/code&gt; settings, set &lt;code&gt;default_permissions&lt;/code&gt;, and provide the matching profile block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="py"&gt;default_permissions&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"project-edit"&lt;/span&gt;

&lt;span class="nn"&gt;[permissions.project-edit]&lt;/span&gt;
&lt;span class="py"&gt;extends&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;":workspace"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start from a bounded profile. Add filesystem or network exceptions only after the task proves it needs them.&lt;/p&gt;

&lt;h2&gt;
  
  
  No-prompt mode is not full access
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;approval_policy = "never"&lt;/code&gt; suppresses approval prompts. It does not widen the selected sandbox or permission profile. A workspace-bounded run remains workspace-bounded.&lt;/p&gt;

&lt;p&gt;This distinction matters for unattended work. Removing prompts can make a bounded workflow repeatable, but it is not a substitute for defining the boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the effective run
&lt;/h2&gt;

&lt;p&gt;Do not trust one TOML file in isolation. Record the Codex version, inspect every loaded config layer, resolve the named profile from the intended project root, and test write and network behavior with harmless operations.&lt;/p&gt;

&lt;p&gt;A bounded profile-resolution probe on Windows is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;codex&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;sandbox&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-P&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;project-edit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;C:\absolute\project\path&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;powershell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-NoProfile&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Get-Location"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This proves the profile name resolves. It does not prove write or network behavior, so test those separately.&lt;/p&gt;

&lt;p&gt;The complete decision table, Windows sandbox guidance, failure signatures, and six-step boundary checklist are in the canonical TGWise guide:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgwise.com/guides/codex-windows-permissions/" rel="noopener noreferrer"&gt;https://tgwise.com/guides/codex-windows-permissions/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I maintain TGWise Agent Lab.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>tutorial</category>
      <category>openai</category>
    </item>
    <item>
      <title>Why Claude Code Ignores CLAUDE.md: Loading, Adherence, and Enforcement</title>
      <dc:creator>Yan Gao</dc:creator>
      <pubDate>Fri, 07 Aug 2026 06:34:14 +0000</pubDate>
      <link>https://dev.to/yan_gao_3ad90a90b26925538/why-claude-code-ignores-claudemd-loading-adherence-and-enforcement-3b95</link>
      <guid>https://dev.to/yan_gao_3ad90a90b26925538/why-claude-code-ignores-claudemd-loading-adherence-and-enforcement-3b95</guid>
      <description>&lt;p&gt;When Claude Code appears to ignore &lt;code&gt;CLAUDE.md&lt;/code&gt;, rewriting the file is often the wrong first move.&lt;/p&gt;

&lt;p&gt;The symptom can come from three different layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The instruction never entered the active session.&lt;/li&gt;
&lt;li&gt;The instruction loaded, but the model did not follow it in the task.&lt;/li&gt;
&lt;li&gt;The instruction describes an outcome that should have been enforced outside the model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These layers need different fixes.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prove the file loaded
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;/context&lt;/code&gt; and inspect the Memory files section. If the intended &lt;code&gt;CLAUDE.md&lt;/code&gt; is absent, investigate the working directory, filename, exclusions, nested scope, and active settings sources.&lt;/p&gt;

&lt;p&gt;Do not strengthen the wording of a file that is not in context.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Check scope and conflicts
&lt;/h2&gt;

&lt;p&gt;A loaded instruction can still be irrelevant to the current path or conflict with user, project, nested, or path-scoped instructions.&lt;/p&gt;

&lt;p&gt;Replace vague rules with observable behavior. A useful rule names:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when it applies;&lt;/li&gt;
&lt;li&gt;the action to take;&lt;/li&gt;
&lt;li&gt;the artifact or command that proves completion; and&lt;/li&gt;
&lt;li&gt;the condition that blocks completion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, "follow our API standards" is difficult to verify. "When editing &lt;code&gt;src/api/**&lt;/code&gt;, run &lt;code&gt;npm run test:api&lt;/code&gt; and report the failing test if it does not pass" is testable.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Test behavior instead of recall
&lt;/h2&gt;

&lt;p&gt;Do not ask the model whether it read the file. Correctly repeating a rule proves recall, not compliance.&lt;/p&gt;

&lt;p&gt;Run one bounded task where the rule creates a visible difference. Inspect the diff, command output, or generated artifact outside the chat. If the result matters, repeat the task in a fresh session.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Move critical boundaries out of prose
&lt;/h2&gt;

&lt;p&gt;If a failure must never occur, &lt;code&gt;CLAUDE.md&lt;/code&gt; should explain the boundary but should not be its only control.&lt;/p&gt;

&lt;p&gt;Use the mechanism that can reject the bad outcome:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;permissions or a sandbox for access boundaries;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PreToolUse&lt;/code&gt; hooks for command checks;&lt;/li&gt;
&lt;li&gt;formatters and linters for deterministic style;&lt;/li&gt;
&lt;li&gt;tests for behavior;&lt;/li&gt;
&lt;li&gt;CI for release gates; and&lt;/li&gt;
&lt;li&gt;human approval for irreversible external actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The practical rule is simple: use instructions for orientation and use tooling for enforcement.&lt;/p&gt;

&lt;p&gt;The complete six-step diagnostic, current Anthropic sources, compaction checks, and a local decision tool are available in the original TGWise guide:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgwise.com/guides/claude-code-ignoring-claude-md/" rel="noopener noreferrer"&gt;https://tgwise.com/guides/claude-code-ignoring-claude-md/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I maintain TGWise Agent Lab.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
