360 Secure SkillHub
360 安全技能中心

Claude Code Switchboard

这是OpenClaw的Telegram消息路由管理工具,核心功能包括查看路由配置、切换主Claude模型(opus/sonnet/haiku等)、查看消息日志、切换轻量API模式、恢复默认CLI路由。适用于需切换不同Claude后端或调整响应速度的场景,通过/telegram-routing子命令操作,输出配置状态、操作结果,配置存于指定JSON文件。

josephtandle
josephtandle
热度 60.84
最近更新 2026-05-18 12:16:54
分类:自动化依赖:读写文件 / 代码执行应用场景:DevOps / 自动化脚本 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add claude-code-switchboard
Metadata
name
claude-code-switchboard
slug
remote-control
version
1.2.0
description
Manage how OpenClaw routes Telegram messages to different Claude model backends. Switch between CLI and API providers with simple config changes.
command
/telegram-routing

/telegram-routing — Telegram Message Routing Manager

Manage how Telegram messages are routed between different Claude model backends in OpenClaw.

Usage

/telegram-routing status       # Show current routing config
/telegram-routing model <ref>  # Switch primary model (e.g. opus, sonnet, haiku)
/telegram-routing logs         # Show recent message processing logs
/telegram-routing fallback     # Switch to lightweight API mode
/telegram-routing restore      # Restore default CLI-based routing

Config Location

All settings live in ~/.openclaw/openclaw.json under agents.defaults.

Key fields:

  • model.primary — The primary model/provider reference
  • model.fallbacks — Ordered fallback chain when primary is unavailable

Commands

status

Read the OpenClaw config and display current routing settings including:

  • Active primary model
  • Configured fallback models
  • Whether CLI backend is active

model

Switch the primary model. Valid shorthand references:

Shorthand Resolves to
opus claude-cli/opus
sonnet claude-cli/sonnet
haiku anthropic/claude-haiku-4-5

Steps:

  1. Read ~/.openclaw/openclaw.json
  2. Update agents.defaults.model.primary to the resolved model reference
  3. Write the updated config
  4. Restart the gateway service
  5. Verify via gateway logs

logs

Show recent Telegram message processing activity from the gateway log.

fallback

Quick switch to API-only mode for faster, lightweight responses.

restore

Restore the default CLI-based routing configuration.

Architecture

Messages flow through the OpenClaw Gateway, which reads the configured model provider and dispatches to the appropriate backend. CLI-based providers use the local Claude Code installation, while API providers make direct API calls.

Troubleshooting

Issue Fix
Config errors on restart Run openclaw doctor to validate config
Slow responses Try switching to sonnet for faster responses
Gateway issues Check ~/.openclaw/logs/gateway.log for details
Falling back to secondary model Primary backend may be unavailable — check logs