Skip to content

Instantly share code, notes, and snippets.

@brunocroh
Last active January 9, 2026 17:04
Show Gist options
  • Select an option

  • Save brunocroh/c5e986a25d58de6f43952bc0847339f8 to your computer and use it in GitHub Desktop.

Select an option

Save brunocroh/c5e986a25d58de6f43952bc0847339f8 to your computer and use it in GitHub Desktop.
Workaround Opencode with Claude Code Pro/Max plan

Anthropic blocks third-party tools from using your Claude subscription, but you can work around it quite simply

This is for OpenCode only, which is the tool I'm using now.

Clone OpenCode

git clone git@github.com:anomalyco/opencode.git && cd opencode

Install dependencies

bun install # if you don't have bun, install with curl -fsSL https://bun.com/install | bash

Apply the patch that works around it

curl https://gist.githubusercontent.com/brunocroh/c5e986a25d58de6f43952bc0847339f8/raw/3db4f7c00959214ada331f283341ca1e0873ce7d/patch.txt | git apply

Build OpenCode

./packages/opencode/script/build.ts --single

Run it

./packages/opencode/dist/opencode-<platform>/bin/opencode
diff --git a/packages/opencode/src/tool/tool.ts b/packages/opencode/src/tool/tool.ts
index 78ab325af..84f2f045f 100644
--- a/packages/opencode/src/tool/tool.ts
+++ b/packages/opencode/src/tool/tool.ts
@@ -49,7 +49,7 @@ export namespace Tool {
init: Info<Parameters, Result>["init"] | Awaited<ReturnType<Info<Parameters, Result>["init"]>>,
): Info<Parameters, Result> {
return {
- id,
+ id: id.replace(/\w\S*/g, (text) => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase()),
init: async (initCtx) => {
const toolInfo = init instanceof Function ? await init(initCtx) : init
const execute = toolInfo.execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment