summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Gormley <[email protected]>2026-01-06 19:43:55 +0000
committerGitHub <[email protected]>2026-01-06 13:43:55 -0600
commit630476afc0f5df2219aff1d03ecb1ca34ce0aa7c (patch)
tree0f99541292a32409c3b683dcc92920873a04e398
parent5181e4e90acf285207629597990635184715262e (diff)
downloadopencode-630476afc0f5df2219aff1d03ecb1ca34ce0aa7c.tar.gz
opencode-630476afc0f5df2219aff1d03ecb1ca34ce0aa7c.zip
load `OPENCODE_CONFIG_DIR` AGENTS.md into the system prompt (#7115)
-rw-r--r--packages/opencode/src/session/system.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts
index f9ac12a2b..dc180bee8 100644
--- a/packages/opencode/src/session/system.ts
+++ b/packages/opencode/src/session/system.ts
@@ -15,6 +15,7 @@ import PROMPT_ANTHROPIC_SPOOF from "./prompt/anthropic_spoof.txt"
import PROMPT_CODEX from "./prompt/codex.txt"
import type { Provider } from "@/provider/provider"
+import { Flag } from "@/flag/flag"
export namespace SystemPrompt {
export function header(providerID: string) {
@@ -66,6 +67,10 @@ export namespace SystemPrompt {
path.join(os.homedir(), ".claude", "CLAUDE.md"),
]
+ if (Flag.OPENCODE_CONFIG_DIR) {
+ GLOBAL_RULE_FILES.push(path.join(Flag.OPENCODE_CONFIG_DIR, "AGENTS.md"))
+ }
+
export async function custom() {
const config = await Config.get()
const paths = new Set<string>()