Skip to content

Coding agents (Claude Code / OpenCode)

Waired points the coding agents you already use at your own model. There are two pieces:

  • waired link sets up the per-user integration files — Claude Code skills (~/.claude/skills/) and the OpenCode provider plugin (~/.config/opencode/plugin/waired.js) — and issues the gateway token they use.
  • Managed settings point Claude Code at your local model by writing Claude Code’s system-wide managed-settings.json, so you don’t set any environment variable or shell alias.

Claude Code is routed through managed settings: Waired writes Claude Code’s system-wide managed-settings.json so that Claude Code talks to your local model. No credential is written there, so Claude Code keeps using your existing claude.ai subscription — including subscription auto-mode (opusplan / Max Opus→Sonnet usage fallback). There are no certificates, no /etc/hosts edits, and no shell changes. This works the same on Linux, macOS, and Windows.

waired init enables this for you by default; you can also manage it directly.

  1. Set up the integration files and gateway token:

    Terminal window
    waired link claude-code
  2. Make sure managed settings are enabled (waired init usually did this already):

    Terminal window
    sudo waired claude enable
  3. Just start Claude Code — no ANTHROPIC_BASE_URL and no alias needed:

    Terminal window
    claude

You don’t have to restart Claude Code to change where your requests are served. Enabling the integration installs a /waired-route slash command — run it inside Claude Code and the next request honours the change:

  • /waired-route anthropic — use the real Anthropic API (handy if the local model is misbehaving on a task).
  • /waired-route local — force your local model; never contact Anthropic. (Your active local model answers, whatever model the session has selected.)
  • /waired-route auto — back to the default (local when healthy, with the automatic fallback above).

The same switch is available from a terminal:

Terminal window
waired claude route anthropic # or: local | auto
waired claude route # show the current mode

So you never have to wonder whether Waired is active, enabling the integration also adds two things you see inside Claude Code:

  • A status line segment in the footer showing the current route — e.g. ⚡ waired: local (qwen3-8b-instruct) (served by your local model, with the model that answered the last request), → waired: Anthropic (using the real API), or ✕ waired: agent down. If you don’t already have a custom status line, Waired adds this for you; if you do, waired init and waired claude enable ask before touching it (or run waired claude statusline install --wrap yourself). It disappears cleanly if Waired is later removed.

    One caveat: Claude Code uses only the highest-precedence status line, and a project’s .claude/settings.local.json / .claude/settings.json outranks the user-level one Waired installs. Waired never edits project files — run waired claude status inside the project and it reports the shadowing along with a one-liner you can paste into your own status-line script to show the route there.

  • A one-line notice after any turn that fell back to the real Anthropic API, so a request that couldn’t be served locally is never silently redirected.

Both are removed by waired claude disable. To skip the status line at enable time, pass --no-statusline.

OpenCode is configured by the same waired link step, which installs the provider plugin at ~/.config/opencode/plugin/waired.js. The plugin points OpenCode at your Local Gateway and forwards the gateway token for you.

Terminal window
waired link opencode

Run waired link with no agent name to set up every installed agent at once.

Check that routing is active:

Terminal window
waired claude status

It reports whether managed settings are enabled and where the managed-settings.json file lives:

  • Linux: /etc/claude-code/managed-settings.json
  • macOS: /Library/Application Support/ClaudeCode/managed-settings.json
  • Windows: C:\Program Files\ClaudeCode\managed-settings.json

The tray’s Claude integration menu shows the same status.

To remove the integration (surgical — it only undoes what link added):

Terminal window
waired unlink # remove all agents
waired unlink claude-code # remove just one

To stop routing Claude Code through Waired (reverts the managed-settings change, restoring Claude Code’s default behavior):

Terminal window
sudo waired claude disable # Windows: run elevated, no sudo

If a coding agent isn’t using your model, run waired doctor — it checks the gateway token, paused state, engine readiness, mesh peer, and the integration in one pass, and can repair what’s fixable.