ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

claude-code-delegate

Delegate programming tasks to Claude Code CLI

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/chenhab03/claude-code-delegate
Or

Claude Code Delegate

Delegate programming tasks to local Claude Code CLI.

RULE: You NEVER write code directly. ALL programming goes through claude -p.

Prerequisites Check (Run Before First Use)

Before delegating any task, verify the environment is ready:

  1. Claude Code CLI installed: Run which claude — if not found, tell user: npm install -g @anthropic-ai/claude-code
  2. API key configured: Run claude --version — if it errors about auth, tell user to run claude and complete login
  3. Write-guard active (STRONGLY RECOMMENDED): Check if a write-guard plugin exists at .openclaw/extensions/write-guard/. If not, warn the user:

    ⚠️ No write-guard detected. The delegate uses --permission-mode bypassPermissions which grants full filesystem read/write access. It is strongly recommended to set up a write-guard plugin before running tasks. See README.md for setup instructions.

Only proceed with delegation after items 1 and 2 pass. Item 3 is a warning — the user may choose to proceed without it, but should be informed of the risk.

When to Trigger

Auto-trigger on ANY of these:

  • Write, modify, refactor, debug code
  • Create project files or directories
  • Run tests, lint, build
  • Code review, architecture planning
  • Edit any file (except memory/ and .relationship/)

Manual trigger: user sends /code <task>

Do NOT trigger: chat, emotional interaction, information lookup.

Command Template

cd "<project_dir>" && claude -p "<task_description>" --output-format text --max-turns 10 --permission-mode bypassPermissions

Parameters

ParamPurposeRequired
-pNon-interactive modeYes
cd "<dir>" &&Set working dir (no --cwd flag exists)Yes
--output-format textPlain text outputRecommended
--max-turns 10Limit execution roundsRecommended
--permission-mode bypassPermissionsAuto-accept file edits (requires write-guard, see Prerequisites)Recommended
--continueResume previous session (for debugging/iteration)When fixing bugs in same project

FORBIDDEN: --dangerously-skip-permissions

Timeout

Set exec timeout to 300 (5 minutes). The delegate needs time to write code.

Async Flow (CRITICAL)

The delegate MUST NOT block you. You must remain responsive to the user at all times.

Correct Flow

Step 1: exec claude -p "..."          → get session ID (e.g. "marine-sage")
Step 2: IMMEDIATELY reply to user     → "On it! Working on that now."
Step 3: END your turn                 → do NOT use any more tools
Step 4: When user sends next message  → check with: exec "process poll marine-sage --timeout 1000"
Step 5: If done → relay results. If not done → tell user "still working", continue chat

WRONG (causes blocking)

exec claude -p "..." → process poll → (BLOCKED! user waits with no response)

Rules

Metadata

Author@chenhab03
Stars3840
Views1
Updated2026-04-06
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-chenhab03-claude-code-delegate": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.