Problem
wp-coding-agents supports multiple runtimes (OpenCode, Claude Code, Studio Code) and multiple chat bridges (Kimaki, cc-connect, opencode-telegram, or none). None of these combos have a documented or automated way to set up multi-account Anthropic OAuth with rotation.
The need is universal — any configuration using Anthropic models benefits from account rotation to distribute rate limits and avoid single-account limits. But the setup path differs per combo:
| Runtime |
Chat bridge |
Auth mechanism today |
Multi-account support |
| OpenCode |
Kimaki (Discord) |
opencode-claude-auth plugin + kimaki credential sync wrapper |
Kimaki v0.6.0 has built-in AnthropicAuthPlugin — but opencode-claude-auth is also loaded, creating a conflict |
| OpenCode |
cc-connect |
opencode-claude-auth plugin |
No rotation |
| OpenCode |
none (terminal) |
opencode-claude-auth plugin |
No rotation |
| Claude Code |
cc-connect |
Native claude auth (~/.claude/.credentials.json) |
No rotation |
| Claude Code |
none |
Native claude auth |
No rotation |
| Studio Code |
cc-connect |
Studio Code native auth |
Unknown |
Current state
Plugin conflict (kimaki v0.6.0+)
Kimaki v0.6.0 ships a built-in AnthropicAuthPlugin that handles OAuth login, token refresh, request/response rewriting (tool names, system prompt, beta headers), and multi-account rotation. But opencode.sh unconditionally installs opencode-claude-auth@latest (lines 208-213):
# opencode-claude-auth: Safe to always include — no-op when Claude credentials aren't present.
OPENCODE_PLUGINS="${OPENCODE_PLUGINS}\n \"opencode-claude-auth@latest\","
When both plugins are loaded, they compete for the same anthropic auth provider in OpenCode. The fix: skip opencode-claude-auth@latest when CHAT_BRIDGE=kimaki, since kimaki's built-in plugin supersedes it. Keep it for cc-connect / no-bridge setups.
Other issues
- Kimaki + OpenCode (VPS):
opencode.sh installs a custom wrapper (_install_opencode_wrapper) that syncs kimaki's anthropic-oauth-accounts.json into ~/.claude/.credentials.json. May be simplifiable now that kimaki core handles rotation.
- Kimaki + OpenCode (local): No account management flow. Running
kimaki anthropic-accounts subcommands or kimaki connect starts the full bot and crashes into the launchd-managed instance (port eviction loop).
- No
anthropic-accounts add CLI: Accounts are added through OpenCode's OAuth flow (triggered when an Anthropic model call happens). The kimaki CLI only has list, current, remove. No standalone way to bootstrap the first account or add additional accounts for rotation.
- All combos: No documentation on multi-account setup or rotation.
What should happen
-
Fix plugin conflict in opencode.sh: Make opencode-claude-auth@latest conditional — skip when CHAT_BRIDGE=kimaki (kimaki has built-in auth). This is the most immediate fix.
-
Cross-bridge auth story: Define how multi-account Anthropic OAuth works for each supported combo. Kimaki has built-in rotation for its sessions; cc-connect and direct terminal don't have an equivalent. Either document per-bridge paths or build something bridge-agnostic.
-
Setup flow: setup.sh should offer an account setup step appropriate to the chosen bridge/runtime:
- Kimaki: accounts are added through the OpenCode OAuth flow (first model call triggers it) — document this, and ensure the plugin conflict above is resolved so it works
- cc-connect / none: document how to add accounts, or provide a helper script
-
Fix crash loop (local mode): On macOS with the launchd agent (com.wp.kimaki), running any kimaki subcommand that starts the bot evicts the launchd instance on port 29988, then launchd respawns and evicts back. The subcommand needs to work alongside a running instance, or the launchd agent needs to be stoppable/startable via setup.
-
Plugin wipe on upgrade: When kimaki auto-upgrades via npm, the global node_modules/kimaki/ dir is replaced, wiping the DM plugins (dm-agent-sync.ts, dm-context-filter.ts) that opencode.sh copies there during setup. post-upgrade.sh only removes unwanted skills, doesn't re-copy plugins.
-
Documentation: README should cover multi-account auth setup for each combo.
Non-goals
- Don't rebuild what kimaki already does — use kimaki's built-in
AnthropicAuthPlugin where kimaki is the bridge
- Don't couple to Anthropic-specific internals more than necessary (the credential format may change)
Environment
- wp-coding-agents setup with launchd on macOS
- Kimaki v0.6.0 (auto-upgraded from v0.5.0)
- OpenCode runtime
Problem
wp-coding-agents supports multiple runtimes (OpenCode, Claude Code, Studio Code) and multiple chat bridges (Kimaki, cc-connect, opencode-telegram, or none). None of these combos have a documented or automated way to set up multi-account Anthropic OAuth with rotation.
The need is universal — any configuration using Anthropic models benefits from account rotation to distribute rate limits and avoid single-account limits. But the setup path differs per combo:
opencode-claude-authplugin + kimaki credential sync wrapperAnthropicAuthPlugin— butopencode-claude-authis also loaded, creating a conflictopencode-claude-authpluginopencode-claude-authplugin~/.claude/.credentials.json)Current state
Plugin conflict (kimaki v0.6.0+)
Kimaki v0.6.0 ships a built-in
AnthropicAuthPluginthat handles OAuth login, token refresh, request/response rewriting (tool names, system prompt, beta headers), and multi-account rotation. Butopencode.shunconditionally installsopencode-claude-auth@latest(lines 208-213):When both plugins are loaded, they compete for the same
anthropicauth provider in OpenCode. The fix: skipopencode-claude-auth@latestwhenCHAT_BRIDGE=kimaki, since kimaki's built-in plugin supersedes it. Keep it for cc-connect / no-bridge setups.Other issues
opencode.shinstalls a custom wrapper (_install_opencode_wrapper) that syncs kimaki'santhropic-oauth-accounts.jsoninto~/.claude/.credentials.json. May be simplifiable now that kimaki core handles rotation.kimaki anthropic-accountssubcommands orkimaki connectstarts the full bot and crashes into the launchd-managed instance (port eviction loop).anthropic-accounts addCLI: Accounts are added through OpenCode's OAuth flow (triggered when an Anthropic model call happens). The kimaki CLI only haslist,current,remove. No standalone way to bootstrap the first account or add additional accounts for rotation.What should happen
Fix plugin conflict in
opencode.sh: Makeopencode-claude-auth@latestconditional — skip whenCHAT_BRIDGE=kimaki(kimaki has built-in auth). This is the most immediate fix.Cross-bridge auth story: Define how multi-account Anthropic OAuth works for each supported combo. Kimaki has built-in rotation for its sessions; cc-connect and direct terminal don't have an equivalent. Either document per-bridge paths or build something bridge-agnostic.
Setup flow:
setup.shshould offer an account setup step appropriate to the chosen bridge/runtime:Fix crash loop (local mode): On macOS with the launchd agent (
com.wp.kimaki), running any kimaki subcommand that starts the bot evicts the launchd instance on port 29988, then launchd respawns and evicts back. The subcommand needs to work alongside a running instance, or the launchd agent needs to be stoppable/startable via setup.Plugin wipe on upgrade: When kimaki auto-upgrades via npm, the global
node_modules/kimaki/dir is replaced, wiping the DM plugins (dm-agent-sync.ts,dm-context-filter.ts) that opencode.sh copies there during setup.post-upgrade.shonly removes unwanted skills, doesn't re-copy plugins.Documentation: README should cover multi-account auth setup for each combo.
Non-goals
AnthropicAuthPluginwhere kimaki is the bridgeEnvironment