You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix AGENTS.md patch replacing CLAUDE.md content instead of falling back
The injection was at the wrong location — before `return { content }`,
which runs after CLAUDE.md is successfully read, unconditionally replacing
its content with AGENTS.md. Moved injection to the early `return null`
(after existsSync/statSync check) so alternatives are only tried when
CLAUDE.md doesn't exist.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
'patch: agentsMd: failed to find return statement for injection'
91
+
'patch: agentsMd: failed to find early return null for injection'
86
92
);
87
93
returnnull;
88
94
}
89
95
90
-
constinjection=`if(!didReroute&&(${firstParam}.endsWith("/CLAUDE.md")||${firstParam}.endsWith("\\\\CLAUDE.md"))){for(let alt of ${altNamesJson}){let altPath=${firstParam}.slice(0,-9)+alt;if(${fsExpr}.existsSync(altPath)&&${fsExpr}.statSync(altPath).isFile())return ${functionName}(altPath,${restParams},true);}}`;
96
+
constfallback=`if(!didReroute&&(${firstParam}.endsWith("/CLAUDE.md")||${firstParam}.endsWith("\\\\CLAUDE.md"))){for(let alt of ${altNamesJson}){let altPath=${firstParam}.slice(0,-9)+alt;if(${fsExpr}.existsSync(altPath)&&${fsExpr}.statSync(altPath).isFile())return ${functionName}(altPath,${restParams},true);}}`;
0 commit comments