9clg6

Copy Claude Code token from MacOS Keychain into OpenCode

17
0
69% credibility
Found Mar 20, 2026 at 17 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Shell
AI Summary

A simple script that copies login details from Claude Code to OpenCode, letting users access paid Claude AI models using their existing Pro or Max subscription.

How It Works

1
🔍 Discover the shortcut

You want to use your paid Claude Pro models inside the OpenCode app without extra setup or costs, and find this simple helper guide.

2
Prepare your apps

Make sure OpenCode and Claude Code are installed on your computer, and you've logged into your Claude Pro or Max account.

3
📥 Grab the connector script

Download the small script that links your Claude login to OpenCode.

4
▶️ Run the sync magic

Launch the script with one command, and it quietly copies your secure login info to make everything work together.

5
🔍 Check it's connected

Peek inside OpenCode to confirm Anthropic models like Claude Sonnet now show up as ready to use.

6
🔄 Refresh when needed

Every few hours, use Claude Code once then re-run the script to keep things fresh.

🎉 Chat with Claude!

Open OpenCode, select your favorite Claude model, and start creating with your subscription – all seamless and free of hassle.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 17 to 17 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is sync-claude-code-token-in-open-code?

This Shell script syncs your Claude Code OAuth token—pulled from macOS Keychain or Linux/Windows credentials—straight into OpenCode's auth store. It lets Claude Pro/Max users access models like Sonnet, Opus, and Haiku in the OpenCode desktop app or CLI without copying Claude API keys or buying extra credits. Run `./sync-token.sh` after Claude Code login, verify with `opencode providers list`, and models appear instantly.

Why is it gaining traction?

No more copy AI vs Claude key hunts or manual token pasting— it auto-detects OS, merges with existing providers, and supports cron jobs for 5-hour refreshes. Beats GitHub Copilot chat lock-in by unlocking full Claude chat in OpenCode, including copy Claude code output or screenshots. Low friction setup hooks devs tired of expired tokens killing workflows.

Who should use this?

Claude Pro/Max users with OpenCode and Claude Code CLI, especially those copying Claude responses, GitHub PR links, or repo details into code sessions. Perfect for full-stack devs blending Claude code with local tools, or teams ditching Copilot for subscription-based AI. Avoid if you're API-key only or on free Claude.

Verdict

Worth cloning for OpenCode-Claude fans—excellent README troubleshooting offsets 17 stars and 0.7% credibility score. Simple, battle-tested on macOS/Linux, but test Windows; it's production-ready for token sync, not a full auth overhaul. (187 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.