Skip to content

Instantly share code, notes, and snippets.

@gabrielbuzziv
Created January 15, 2026 14:02
Show Gist options
  • Select an option

  • Save gabrielbuzziv/cb84881961c28776fcd8b7b9c048d572 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielbuzziv/cb84881961c28776fcd8b7b9c048d572 to your computer and use it in GitHub Desktop.
Plugin for opencode to bypass anthropic auth
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