claude-code-dispatch

Invoke Claude Code CLI as a subprocess for coding tasks that require file access, editing, and shell execution

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "claude-code-dispatch" with this command: npx skills add ezpeasydave/claude-code-dispatch

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

ParameterRequiredDefaultDescription
--promptYesTask description for Claude Code
--workdirYesWorking directory (must exist)
--modelNosonnetModel: sonnet, opus, or haiku
--toolsNoRead,Edit,Glob,GrepComma-separated allowed tools
--budgetNo2.00Max budget in USD (for cost reporting)
--timeoutNo300Timeout in seconds
--systemNoAdditional 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: <Claude 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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Web Research Assistant

AI-powered web research assistant that leverages BrowserAct API to supplement restricted web access by searching the internet for additional information. Designed for OpenClaw and Claude Code.

Registry SourceRecently Updated
2.5K3phheng
Coding

Pandoc Convert

Convert documents between 40+ formats using pandoc CLI. Handles Markdown ↔ Word ↔ PDF ↔ HTML ↔ LaTeX ↔ EPUB with smart defaults, professional templates, and comprehensive tooling.

Registry SourceRecently Updated
Coding

Monitored Ralph Loop

Generate copy-paste bash scripts for Ralph Wiggum/AI agent loops (Codex, Claude Code, OpenCode, Goose). Use when asked for a "Ralph loop", "Ralph Wiggum loop", or an AI loop to plan/build code via PROMPT.md + AGENTS.md, SPECS, and IMPLEMENTATION_PLAN.md, including PLANNING vs BUILDING modes, backpressure, sandboxing, and completion conditions.

Registry SourceRecently Updated
1.3K0endogen
Coding

Forge

Autonomous quality engineering swarm that forges production-ready code through continuous behavioral verification, exhaustive E2E testing, and self-healing fix loops. Combines DDD+ADR+TDD methodology with BDD/Gherkin specifications, 7 quality gates, defect prediction, chaos testing, and cross-context dependency awareness. Architecture-agnostic — works with monoliths, microservices, modular monoliths, and any bounded-context topology.

Registry SourceRecently Updated