Created
January 15, 2026 14:02
-
-
Save gabrielbuzziv/cb84881961c28776fcd8b7b9c048d572 to your computer and use it in GitHub Desktop.
Plugin for opencode to bypass anthropic auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { Plugin } from "@opencode-ai/plugin" | |
| const opencodePattern = /OpenCode|opencode/g | |
| export const ClaudeCodePlugin: Plugin = async () => { | |
| return { | |
| "experimental.chat.system.transform": async (_ctx, data) => { | |
| const system = data?.system | |
| if (!system || !Array.isArray(system)) { | |
| return | |
| } | |
| for (let index = 0; index < system.length; index += 1) { | |
| if (typeof system[index] === "string") { | |
| system[index] = system[index].replace(opencodePattern, "ClaudeCode") | |
| } | |
| } | |
| }, | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment