From 02afe3eaf792420942d42d59c5a4ec2facf2a1cd Mon Sep 17 00:00:00 2001 From: "Christian \"kiko\" Reis" Date: Wed, 13 May 2026 20:51:33 -0300 Subject: [PATCH 1/4] fix: merge AGENTS.md into system prompt instead of replacing Previously the bridge would replace opencode's entire system prompt (including AGENTS.md content) with the Claude Code identity blocks. Now we merge them: [billingHeader, ...opencodeSystem, ...claudeCodeIdentity] --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 088e3d6..32c77ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -738,7 +738,7 @@ const OpenCodeClaudeBridge = async ({ client }: { client: PluginClient }) => { billingHeader = parsed.system[0]?.text || billingHeader; } - // If we have a locally captured Claude Code system prompt, prefer it. +// Merge Claude Code system prompt with opencode's existing system (including AGENTS.md). if (cachedClaudeSystem) { const rewritten = rewriteSystemBlocksForModel( cachedClaudeSystem, @@ -746,6 +746,7 @@ const OpenCodeClaudeBridge = async ({ client }: { client: PluginClient }) => { ); parsed.system = [ { type: "text", text: billingHeader }, + ...parsed.system, ...rewritten, ]; } else if (parsed.system && Array.isArray(parsed.system)) { From 716657261da42a535b826128c634b56fbf98f6c3 Mon Sep 17 00:00:00 2001 From: "Christian \"kiko\" Reis" Date: Wed, 13 May 2026 21:04:34 -0300 Subject: [PATCH 2/4] Update index.ts Fix indentation --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 32c77ac..dab5351 100644 --- a/src/index.ts +++ b/src/index.ts @@ -738,7 +738,7 @@ const OpenCodeClaudeBridge = async ({ client }: { client: PluginClient }) => { billingHeader = parsed.system[0]?.text || billingHeader; } -// Merge Claude Code system prompt with opencode's existing system (including AGENTS.md). + // Merge Claude Code system prompt with opencode's existing system (including AGENTS.md). if (cachedClaudeSystem) { const rewritten = rewriteSystemBlocksForModel( cachedClaudeSystem, From f0e28c8752d4ce4090a7acfe9df30f2727d45030 Mon Sep 17 00:00:00 2001 From: "Christian \"kiko\" Reis" Date: Wed, 13 May 2026 20:51:33 -0300 Subject: [PATCH 3/4] fix: merge AGENTS.md into system prompt instead of replacing Previously the bridge would replace opencode's entire system prompt (including AGENTS.md content) with the Claude Code identity blocks. Now we merge them: [billingHeader, ...opencodeSystem, ...claudeCodeIdentity] --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index dab5351..d74052e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -213,7 +213,7 @@ export function shouldInjectClaudeTools(input: { model?: string; requestUrl?: string; tools?: unknown; -}): boolean { +})g boolean { if (!shouldUseClaudeToolSchemas({ model: input.model, requestUrl: input.requestUrl })) { return false; } From df48ad0e091f899141f50ed6307eca8fc95d6e9c Mon Sep 17 00:00:00 2001 From: "Christian \"kiko\" Reis" Date: Wed, 13 May 2026 21:40:48 -0300 Subject: [PATCH 4/4] Update index.ts sigh --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index d74052e..dab5351 100644 --- a/src/index.ts +++ b/src/index.ts @@ -213,7 +213,7 @@ export function shouldInjectClaudeTools(input: { model?: string; requestUrl?: string; tools?: unknown; -})g boolean { +}): boolean { if (!shouldUseClaudeToolSchemas({ model: input.model, requestUrl: input.requestUrl })) { return false; }