Read from AGENTS.md before CONTEXT.md

This commit is contained in:
Alex Gleason committed 2025-08-31 20:44:50 -05:00
1 parent fe5fd75487
commit da1d221e1d
1 file changed
+5 -4
+5 -4
View File
@@ -57,22 +57,23 @@ export async function makeSystemPrompt(opts: MakeSystemPromptOpts): Promise<stri
// README.md not found, continue // README.md not found, continue
} }
// Add context from CONTEXT.md if it exists // Add context from AGENTS.md if it exists
try { try {
const { text } = await getContext(fs, cwd); const { text } = await getAgentContext(fs, cwd);
system += "\n\n" + text; system += "\n\n" + text;
} catch { } catch {
// CONTEXT.md not found, continue // AGENTS.md not found, continue
} }
return system; return system;
} }
async function getContext( async function getAgentContext(
fs: JSRuntimeFS, fs: JSRuntimeFS,
cwd: string, cwd: string,
): Promise<{ filename: string; text: string }> { ): Promise<{ filename: string; text: string }> {
const contextFiles = [ const contextFiles = [
"AGENTS.md",
"CONTEXT.md", "CONTEXT.md",
"CLAUDE.md", "CLAUDE.md",
"codex.md", "codex.md",