@iwahbi/opencode-claude-stack
v1.2.19
Published
Primary OpenCode Claude stack with a thin plugin, local daemon, and one-line installer.
Maintainers
Readme
opencode-claude-stack
opencode-claude-stack connects OpenCode to Claude Code through a local daemon.
It is designed for people who want Claude models inside OpenCode without hand-editing request headers, auth wiring, or OpenCode plugin internals.
What This Does
After setup, OpenCode Anthropic requests go through this path:
OpenCode
-> opencode-claude-stack plugin
-> local Claude Stack daemon
-> certified Claude compatibility profile
-> direct Anthropic backendThe stack:
- reads your Claude Code login from your machine
- installs the OpenCode plugin entry for you
- writes the OpenCode Anthropic bridge record for you
- starts the local daemon for you
- verifies the setup with a real OpenCode smoke test
Before You Start
You need these tools installed first:
nodepnpmopencodeclaude
You must also already be logged into Claude Code.
If you have never used Claude Code on this machine, do this first:
claudeImportant:
claudeopens the Claude Code interface- sign in there if Claude Code asks you to log in
- once login is complete, quit Claude Code and return to your terminal
- do not do a separate real Anthropic login inside OpenCode for this stack
- the installer handles the OpenCode side for you
Choose An Install Path
There are two install paths.
Option 1: Install From GitHub
Use this if you are installing from this repository directly.
This is the best path when:
- you want the latest code from GitHub
- the npm package is not live yet
- you are helping test the latest release
Commands:
git clone https://github.com/t964-agent/opencode-claude-stack.git
cd opencode-claude-stack
pnpm install
pnpm bootstrapThat works on:
- macOS Terminal
- Linux shells and WSL2
- Windows PowerShell or Windows Terminal
Option 2: Install From npm
Use this after the package is available on npm.
npx @iwahbi/opencode-claude-stack installIf npm install is not live yet, use the GitHub install path above.
Beginner Quick Start
If you want the shortest working setup, do exactly this.
First, make sure Claude Code is already signed in on this machine.
If it is not signed in yet:
- run
claude - finish login in the Claude Code interface
- quit Claude Code and return to your terminal
Then run:
git clone https://github.com/t964-agent/opencode-claude-stack.git
cd opencode-claude-stack
pnpm install
pnpm bootstrapThen test it:
opencode run -m anthropic/claude-haiku-4-5 "Reply with HELLO_STACK and nothing else."If the stack is working, OpenCode should reply with HELLO_STACK.
What The Installer Changes
The installer is intentionally small and predictable.
It does all of the following:
- checks that
opencodeis installed - checks that
claudeis installed - checks that Claude credentials exist on your machine
- backs up your OpenCode config and auth files
- adds the
opencode-claude-stackplugin to OpenCode config - writes the managed Anthropic bridge auth entry into OpenCode
- starts the Claude Stack daemon
- runs a real OpenCode smoke test
Plugin conflict handling:
- known older Claude auth plugins are removed automatically during install
- unrelated plugins are kept
- unknown Claude or Anthropic auth-like plugins are not removed silently
- if one of those unknown plugins is found, the installer stops and tells the user what to remove
It does not:
- replace your Claude Code login
- ask you to manually edit OpenCode request headers
- require you to keep a custom daemon command running by hand in normal use
Platform Support
opencode-claude-stack is intended to support every platform where OpenCode and Claude Code both work.
macOS
Supported.
Behavior:
- prefers Claude credentials from macOS Keychain
- falls back to
~/.claude/.credentials.jsonif needed - prefers the same OpenCode paths that already exist on the machine
- defaults to
~/.config/opencodeand~/.local/share/opencodefor fresh installs - still respects an existing
~/Library/Application Support/opencodeinstall if that is already what OpenCode uses
Linux
Supported.
Behavior:
- reads Claude credentials from
~/.claude/.credentials.json - uses standard XDG-style OpenCode paths
- typical config path:
~/.config/opencode - typical data path:
~/.local/share/opencode - WSL2 uses the same Linux paths inside the distro
Windows
Supported.
Behavior:
- reads Claude credentials from
%USERPROFILE%\.claude\.credentials.json - uses OpenCode config/data locations under
%USERPROFILE%\.config\opencodeand%USERPROFILE%\.local\share\opencode - works through PowerShell or Windows Terminal
- detects common Git for Windows installs, persists
CLAUDE_CODE_GIT_BASH_PATH, and updates the standard PowerShell profile when needed
Daily Use
After installation, use OpenCode normally with an Anthropic model.
Example:
opencode run -m anthropic/claude-haiku-4-5 "Reply with STACK_OK and nothing else."Commands
If you installed from npm:
npx @iwahbi/opencode-claude-stack reset
npx @iwahbi/opencode-claude-stack doctor
npx @iwahbi/opencode-claude-stack status
npx @iwahbi/opencode-claude-stack daemon statusThe npm installer also refreshes OpenCode's cached copy of this plugin so rerunning npx @iwahbi/opencode-claude-stack install picks up the published version you just installed.
If you installed from a GitHub checkout:
node dist/cli.js doctor
node dist/cli.js status
node dist/cli.js daemon statusAvailable commands:
installresetdoctorstatusdaemon startdaemon stopdaemon status
Useful install flag:
--plugin selfThis tells the installer to register the current checkout as the OpenCode plugin.
What OpenCode Config Looks Like
Most users do not need to edit opencode.json manually.
After install, OpenCode will have a plugin entry like this:
{
"plugin": ["/absolute/path/to/opencode-claude-stack"]
}The installer writes that automatically.
Troubleshooting
Claude Code credentials were not found
Run:
claudeThen:
- complete login in the Claude Code interface if prompted
- quit Claude Code
- rerun the Claude Stack installer
and complete Claude Code login first.
OpenCode smoke test failed
Run:
node dist/cli.js doctoror, if you installed from npm:
npx @iwahbi/opencode-claude-stack doctorIf you want to remove only Claude Stack managed state before retrying the install:
npx @iwahbi/opencode-claude-stack resetdaemon: null in doctor
That means the daemon is not currently running.
It does not automatically mean the install failed.
Check status:
node dist/cli.js statusStart the daemon manually if needed:
node dist/cli.js daemon startnpm install returns 404
The npm package may not be published yet.
Use the GitHub install path instead:
git clone https://github.com/t964-agent/opencode-claude-stack.git
cd opencode-claude-stack
pnpm install
pnpm bootstrapMaintainer Commands
These are maintainer workflows, not normal user install steps:
pnpm compat:release
pnpm compat:monitor
pnpm compat:statusPackage publishing from GitHub Actions is described in docs/trusted-publishing.md.
License
MIT
