← 返回 Skills 市场
ezpeasydave

Claude Code Dispatch

作者 EZPeasyDave · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
474
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install claude-code-dispatch
功能描述
Invoke Claude Code CLI as a subprocess for coding tasks that require file access, editing, and shell execution
使用说明 (SKILL.md)

Claude Code Dispatch

Delegate coding tasks to Claude Code CLI. Use this when a task requires capabilities beyond what the current agent can do: file editing, shell commands, multi-file debugging, code review with file access, or any work that needs direct filesystem interaction.

Prerequisites

Claude Code must be installed and authenticated on the host machine. The host's ~/.claude/settings.json must pre-authorize the tools this skill will use. Example minimal config:

{
  "permissions": {
    "allow": [
      "Read",
      "Edit",
      "Glob",
      "Grep",
      "Bash(git:*)",
      "Bash(npm:*)"
    ]
  }
}

Without pre-authorized permissions, Claude Code will fail in non-interactive mode because it cannot prompt for approval.

When to Use

Route tasks to Claude Code when they require:

  • File reading, editing, or creation on the host filesystem
  • Shell command execution (builds, tests, git operations)
  • Multi-file debugging or refactoring
  • Code review with actual file access
  • Any task where the agent needs to interact with the local filesystem

Do NOT use when:

  • The task is purely conversational (answering questions, planning)
  • You can handle it with your own capabilities or other skills
  • The task involves external APIs you already have access to

Usage

bash {baseDir}/scripts/invoke-claude.sh \
  --prompt "Fix the broken import in src/App.tsx" \
  --workdir "/path/to/project" \
  --model sonnet \
  --tools "Read,Edit,Glob,Grep,Bash"

Parameters

Parameter Required Default Description
--prompt Yes Task description for Claude Code
--workdir Yes Working directory (must exist)
--model No sonnet Model: sonnet, opus, or haiku
--tools No Read,Edit,Glob,Grep Comma-separated allowed tools
--budget No 2.00 Max budget in USD (for cost reporting)
--timeout No 300 Timeout in seconds
--system No Additional system prompt text

Model Selection Guide

  • sonnet (default): Fast. Good for single-file fixes, simple refactors, code review, running tests.
  • opus: Slower but more capable. Use for complex multi-file debugging, architectural changes, tasks requiring deep reasoning across many files.
  • haiku: Fastest and cheapest. Use for trivial tasks like renaming, formatting, or simple lookups.

Tool Presets

Common tool combinations for different task types:

  • Read-only (code review, analysis): Read,Glob,Grep
  • Standard editing (default): Read,Edit,Glob,Grep
  • Full access (builds, tests, git): Read,Edit,Glob,Grep,Bash

Output Format

The script returns a structured summary:

STATUS: success|failure
MODEL: sonnet|opus|haiku
COST: $0.04
DURATION: 12s
RESULT: \x3CClaude Code's response>

Exit codes: 0 = success, 1 = Claude Code error, 2 = preflight failure, 3 = timeout.

Examples

Fix a build error:

bash {baseDir}/scripts/invoke-claude.sh \
  --prompt "The build is failing with 'Cannot find module ./utils'. Diagnose and fix." \
  --workdir "/Users/dave/WebProjects/summer-camps" \
  --tools "Read,Edit,Glob,Grep,Bash"

Code review:

bash {baseDir}/scripts/invoke-claude.sh \
  --prompt "Review the changes in the last commit. Focus on correctness and security." \
  --workdir "/Users/dave/WebProjects/summer-camps" \
  --model opus \
  --tools "Read,Glob,Grep,Bash"

Run tests and fix failures:

bash {baseDir}/scripts/invoke-claude.sh \
  --prompt "Run the test suite, then fix any failing tests." \
  --workdir "/Users/dave/WebProjects/summer-camps" \
  --tools "Read,Edit,Glob,Grep,Bash" \
  --timeout 600

Limitations

  • No concurrent invocations to the same working directory. Queue tasks sequentially.
  • No multi-turn conversations. Each invocation is independent. For follow-up work, dispatch a new invocation with more context in the prompt.
  • Result truncation. Responses longer than 2000 characters are truncated at the nearest line boundary.

Notes

  • Cost is reported for observability. Subscription users are not charged per-token but the field shows what the task would cost on the API.
  • Claude Code inherits environment variables from the host, including any API keys loaded by load-openclaw-env or similar scripts.
  • The prompt is passed via stdin pipe, not shell interpolation, so special characters in prompts are safe.
安全使用建议
This skill appears to do exactly what it promises — run the local Claude Code CLI to perform file edits and shell work — but that means the subprocess will run with your user's permissions and will inherit environment variables (including API keys). Before installing or running it: (1) confirm the 'claude' binary you install is the official package you trust (inspect package source or vendor), (2) review ~/.claude/settings.json and grant only the minimal tools (avoid granting Bash or broad Read/Edit unless necessary), (3) avoid running the skill in directories containing secrets or private keys, and (4) consider running it in an isolated user account or container if you need to limit blast radius. If you're unsure about the npm package or your environment contains sensitive credentials, treat this skill as high-risk until you audit the local Claude installation and permissions.
功能分析
Type: OpenClaw Skill Name: claude-code-dispatch Version: 1.0.0 The skill acts as a wrapper for the Claude Code CLI, enabling an AI agent to perform high-risk operations including arbitrary shell execution and direct filesystem modification. While these capabilities are aligned with the stated purpose of delegating complex coding tasks, the 'agent-within-an-agent' pattern significantly expands the attack surface for prompt injection and unintended command execution. The script `scripts/invoke-claude.sh` passes user-provided prompts directly to the sub-agent, and the documentation in `SKILL.md` explicitly encourages granting broad permissions (Read, Edit, Bash) which could be exploited if the agent is misdirected.
能力评估
Purpose & Capability
The name/description match the implementation: the skill dispatches prompts to a local Claude Code CLI. Required binaries (claude, jq) and the declared npm/brew installs align with that purpose; there are no unrelated credentials or surprising binaries.
Instruction Scope
SKILL.md and the included script keep scope narrowly to invoking the claude CLI in the specified workdir. The script checks inputs, runs claude with JSON output, and truncates results. However the documentation explicitly directs users to pre-authorize tools (Read/Edit/Glob/Grep/Bash), and notes that Claude Code inherits host environment variables — so the delegated process may be able to read/edit files and run shell commands beyond what the OpenClaw agent itself would do.
Install Mechanism
Install metadata uses standard package managers: npm package '@anthropic-ai/claude-code' for the 'claude' binary and brew install for jq. No arbitrary downloads, IPs, or extract-from-URL steps are present in the manifest.
Credentials
The skill does not request any environment variables itself, which is appropriate. But the SKILL.md and script acknowledge that the spawned Claude process inherits the host environment (including any API keys). That creates a real risk of exposing secrets to the subprocess or to Claude Code if its permissions allow broad filesystem or shell access. Users should treat this as sensitive and confirm the claude tool and its ~/.claude/settings.json are configured with least privilege.
Persistence & Privilege
The skill is not always-enabled and does not request persistent privileges or modify other skills or system-wide agent settings. It runs only when invoked.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claude-code-dispatch
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claude-code-dispatch 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of claude-code-dispatch skill. - Enables delegating coding tasks to Claude Code CLI for operations requiring file access, editing, and shell command execution. - Supports triggering via phrases like "use claude code" or "run claude on". - Requires pre-installed and authenticated Claude Code CLI and jq. - Provides detailed usage instructions, toolset selection, and model options. - Includes structured output and clear guidelines on when and how to use the skill.
元数据
Slug claude-code-dispatch
版本 1.0.0
许可证 MIT-0
累计安装 3
当前安装数 3
历史版本数 1
常见问题

Claude Code Dispatch 是什么?

Invoke Claude Code CLI as a subprocess for coding tasks that require file access, editing, and shell execution. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 474 次。

如何安装 Claude Code Dispatch?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claude-code-dispatch」即可一键安装,无需额外配置。

Claude Code Dispatch 是免费的吗?

是的,Claude Code Dispatch 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Claude Code Dispatch 支持哪些平台?

Claude Code Dispatch 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claude Code Dispatch?

由 EZPeasyDave(@ezpeasydave)开发并维护,当前版本 v1.0.0。

💬 留言讨论