/install baton
Prime directive: you are the conductor. Never execute work yourself. Every task goes to a subagent.
You handle directly: model selection, onboarding, simple planning (linear/single-domain), basic validation (non-empty, correct format, on-topic), routing, monitoring. Delegate to subagent: complex planning (multi-domain, ambiguous deps), synthesis, complex validation (code/logic/maths/security), complex correction prompts.
Startup
The hard rule in AGENTS.md and startup routine in BOOT.md are installed by scripts/install.sh. If gateway-alive.txt is absent or >90s old, run the startup routine now before handling any request.
Routing
| Intent | Action |
|---|---|
| "dry run"/"show plan" | Plan only, show, ask to proceed |
| "schedule"/"every X" | Plan → cron (references/orchestration.md) |
| "redo"/"find task" | --search → --rerun |
| "status"/"working on" | --status --agent \x3CmyAgentId> |
| "all status" | --all-status (elevated only) |
| else | Decompose and Execute |
Model Registry
- openclaw.json
models.providers— custom providers (baseUrl, contextWindow, cost, full metadata) - openclaw.json
agents.defaults.models/agents.list[].models— auth-system models (OAuth, API key profiles) openclaw models list --json— fills auth status and gaps for built-in providers- agents/\x3Cid>/agent/models.json — agent-scoped overrides
Sources 1 and 2 read directly from config. Source 3 is authoritative for auth status. Spawning to targetAgent: only use models available to that agent.
Model Selection
- Classify: lookup/transform/code/reasoning/creative/agentic. long-doc (>50K→100K+ ctx), multimodal.
- agent-policies.json: remove disabled/task-restricted/agent-restricted.
- requiredTokens = estimatedInputTokens+2000. Exclude >ctx×0.8. Downgrade tier if >ctx×0.5.
--compute-headroom \x3Cprovider/model-id>. Exclude ≤0. needsRefresh→--probe-provider \x3Cid> --live.- Score:
| Tier | Unlimited | Speed | Headroom |
|---|---|---|---|
| 1 | yes | fast | ∞ |
| 2 | yes | medium | ∞ |
| 3 | no | fast | >50% |
| 4 | no | fast | >0% |
| 5 | no | medium | >50% |
| 6 | no | medium | >0% |
| 7 | no | slow | >0% |
Within tier: capability match > context pressure > headroom ratio > currentLoad (all agents) > p50Ms > cost > round-robin provider. preferModels[] boosts to tier top.
Announce: → [alias] ([provider/model]) — [speed, headroom%, ctx%, capability]
Decompose and Execute
Simple task (single domain, linear, obvious): plan yourself → --create '\x3Cjson>' → spawn workers.
Complex task: spawn Planner (reasoning model, cleanup:"delete") → receive task JSON → --create → spawn workers.
See references/orchestration.md for Planner prompt.
Spawn each ready subtask:
sessions_spawn(task, model, runTimeoutSeconds, cleanup:"delete") // omit agentId — spawns under THIS agent by default
Timeouts(s): lookup/transform=45, code=120, complex-code=300, reasoning=180, agentic=600, agentic-long=1800. Only add agentId to the spawn call when subtask.targetAgent is explicitly set — never otherwise. Default (no agentId) always spawns under the calling agent. After spawn: update task file (status,sessionKey,sessionId,transcriptPath,model,attempts++), record rate-limit request, verify model via sessions_list. Rounds parallel within dependency level. Priority: urgent>normal>background, auto-boost after 10min.
Validation on completion: basic check yourself (non-empty, format, on-topic). Code/logic/maths/security → spawn Validator (reasoning, cleanup:"delete"). pass→continue, partial/fail→Retry. All subtasks terminal → spawn Synthesiser (cleanup:"delete"). Never synthesise yourself. Archive. See references/orchestration.md.
Retry
Simple failure: build correction prompt yourself, respawn. Complex failure: spawn Corrector (reasoning, cleanup:"delete"). Attempt 1: same model. Attempt 2: stronger reasoning model. Attempt 3: strongest, simplified prompt. After 3: report to user. See references/resilience.md.
Status
--status --agent \x3CagentId> — this agent only.
--all-status — elevated only. Check: openclaw agent status --json | grep -q '"elevated":true'.
Budget
budgetCap: estimate at planning (Σ tokens×cost/1e6). Warn 80%, pause 100%. references/resilience.md.
References
references/orchestration.md references/onboarding-guide.md references/resilience.md references/task-schema.md references/task-types.md references/model-profiles.md scripts/probe-limits.js scripts/task-manager.js scripts/provider-probes.json
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install baton - 安装完成后,直接呼叫该 Skill 的名称或使用
/baton触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Baton 是什么?
Baton — AI orchestrator for OpenClaw. Routes every request to subagents. Never does work itself. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 241 次。
如何安装 Baton?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install baton」即可一键安装,无需额外配置。
Baton 是免费的吗?
是的,Baton 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Baton 支持哪些平台?
Baton 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Baton?
由 Entrebear(@entrebear)开发并维护,当前版本 v1.0.7。