360 Secure SkillHub
360 安全技能中心

Dispatch (Claude Code)

通过 /dispatch 命令接收项目、任务名与提示词,映射工作目录后以非阻塞方式在后台启动 Claude Code 无头任务,返回运行 ID 与日志路径;可加载本地 env 配置,超时由环境变量控制,网络回调默认关闭。

edxi
edxi
热度 58.47
最近更新 2026-05-18 12:10:30
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / 工作流 / 代码生成

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add miniade-dispatch
Metadata
name
dispatch
description
Launch non-blocking Claude Code headless tasks from slash command dispatch. Use when user requests async coding jobs and does not require slash-only Claude plugins.

Run {baseDir}/scripts/run_dispatch.sh with user args.

Contract

  • Format: /dispatch <project> <task-name> <prompt...>
  • Workdir mapping: ${REPOS_ROOT:-/home/miniade/repos}/<project>
  • Agent Teams policy: on-demand (enabled only if prompt contains Agent Team signals)
  • Safety: headless runs enforce timeout via DISPATCH_TIMEOUT_SEC (default 7200s)

Local config

  • optional env file: ${OPENCLAW_DISPATCH_ENV:-<workspace>/skills/dispatch.env.local}
  • supports OpenClaw skills.entries.dispatch.env injection
  • script is self-contained (bundled dispatch.sh + claude_code_run.py)

Security disclosure

  • Reads only allowlisted env keys from dispatch.env.local using key=value parsing (no source).
  • Starts a background local process (nohup) and writes logs/results under configured paths.
  • Network callback is disabled by default; enable only with ENABLE_CALLBACK=1 and explicit group settings.
  • Does not download remote code at runtime.

Behavior

  1. Validate args and return usage if incomplete.
  2. Start task in background (non-blocking).
  3. Return one-line launch summary with run-id and log path.
  4. Do not run extra validation unless requested.