Use when dispatching work through the Hermes gateway with /claw, especially when the task may resolve slash commands or hand off into AO worker orchestration.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Use when dispatching work through the Hermes gateway with /claw, especially when the task may resolve slash commands or hand off into AO worker orchestration.
Claw Dispatch
Default behavior — AO workers first
/claw defaults to spawning AO workers directly. Hermes gateway is the fallback, not the default.
Input
Default action
PR number (#633, PR 633, 633)
Expand to draft-first readiness followed by /green, then post to Slack → Hermes (5 attempt cap)
General task description
Post to Slack → Hermes
--max-attempts N
Override attempt cap (default 5 for PR tasks)
--bidi prefix
Hermes interactive session (streaming)
--hermes prefix
Force through Hermes gateway
Slash command resolution (e.g. /green)
Resolve skill then pass to Hermes via Slack
Project auto-detection for PR tasks: resolve from current git remote (git remote get-url origin).
When to use Hermes instead of AO: only when the user explicitly says --hermes, uses --bidi for interactive output, or the task is explicitly a Hermes-native operation (routing config, gateway status, etc.).
Overview
/claw routes work to AO workers by default. Use:
~/.claude/commands/ao.md
~/.claude/skills/ao-operator-discipline/SKILL.md
User-specified AO parameters remain mandatory.
Requirements
For AO tasks: ao session ls must not show ≥30 active sessions (spawn cap)
For Hermes fallback: gateway must be healthy via hermes gateway status
Slash command resolution must search .claude/commands first, then .claude/skills
After every/claw dispatch — AO or Hermes — always print these lines in your reply:
AO spawn path
✅ AO worker spawned: <session-name>
Attach: ao attach <session-name>
Status: ao status <session-name>
tmux: tmux attach-session -t <container-id>-<session-name>
Dashboard: http://localhost:3030
Get the session name from ao session ls --project <project> immediately after spawn. The dashboard URL is the live AO web UI (next.js on :3030 in prod, :3020 in dev).
Always emit the exact logfile path so the user can monitor or kill.
Slack path
✅ Dispatched to Hermes via Slack
Channel: #claw-dispatch
Thread: <thread_url>
Hermes: U0AEZC7RX1Q (@hermes)
Monitor: open the thread URL above; Hermes acks within ~30s, then works the task in thread
Re-check: /claw --status <logfile>
Never omit these lines. The user must always know how to attach, monitor, or kill the worker without asking.
Notes
Hermes replaced OpenClaw as the live gateway agent
slash commands are resolved before dispatch
/claw sessions are hidden from normal Hermes session lists via --source tool
--yolo bypasses tool approvals for autonomous runs
when /claw leads to AO dispatch, spawned AO sessions must still be verified post-spawn
# 2. `port:` under the `gateway:` block in $HERMES_CFG (canonical config)
# 3. Hard-coded default :8643 (current prod gateway port as of 2026-06-28;
# see ~/.hermes/config.yaml)
#
# Note: the previous default of :8642 is stale — the live Hermes gateway has
# been on :8643 for some time. Hard-coding 8642 silently breaks /claw on
# healthy gateways. Always resolve from the YAML config or CLAW_HERMES_PORT.
"${CLAW_HERMES_PORT:-$(python3 -c "
import yaml, sys
try:
with open('$HERMES_CFG') as fh:
cfg = yaml.safe_load(fh) or {}
gw = cfg.get('gateway') or {}
p = gw.get('port')
if isinstance(p, int):
print(p)
elif isinstance(p, str) and p.isdigit():
print(p)
except Exception:
pass
"
"
HERMES_PORT="
${HERMES_PORT:-8643}
"
HEALTH_LOG="
mktemp
"$LOGDIR/.claw-health-XXXXXXXX"
"
if ! curl -sS -m 3 "
${HERMES_PORT}
" >"
$HEALTH_LOG
" 2>&1; then
echo "
${HERMES_PORT}
"
echo "
set
in
$HERMES_CFG
"
sed -n '1,20p' "
$HEALTH_LOG
"
exit 1
fi
if ! grep -q '"
": "
"' "
$HEALTH_LOG
"; then
echo "
return
"
sed -n '1,20p' "
$HEALTH_LOG
"
exit 1
fi
TASK_WITH_RESOLVED="
$TASK_DESCRIPTION
"
# PR shorthand expansion: when the task is a bare PR number (e.g. "
", "
",
# "
"), expand it to the full draft-first readiness + `/green` task with repo auto-detection.
PR_NUMBER=$(printf '%s' "$TASK_DESCRIPTION" | python3 -c "
import sys, re
text = sys.stdin.read().strip()
m = re.match(r'^(?:PR\s*#?|#)\s*(\d+)$', text)
if m:
print(m.group(1))
" 2>/dev/null)
if [ -n "
$PR_NUMBER
" ]; then
# Auto-detect repo from current git remote
REPO_SLUG=$(git remote get-url origin 2>/dev/null | python3 -c "
import sys, re
url = sys.stdin.read().strip()
m = re.match(r'(?:https?://github\.com/|git@github\.com:)([\w-]+/[\w-]+?)(?:\.git)?$', url)
if m:
print(m.group(1))
" 2>/dev/null || echo "")
if [ -n "
$REPO_SLUG
" ]; then
PR_URL="
${REPO_SLUG}
${PR_NUMBER}
"
else
PR_URL="
#${PR_NUMBER}"
fi
"Keep ${PR_URL} draft while completing /es, /er, and /advice; then mark it ready and bring it to /green. Fix CI failures and merge conflicts, and treat CodeRabbit/Bugbot as advisory. Use /green ${PR_NUMBER} to verify. Act autonomously — do not ask for permission to fix things. IMPORTANT: attempt at most ${CLAW_MAX_ATTEMPTS:-5} fix-push-CI cycles. After reaching the limit, post a status summary of remaining blockers and stop — do not continue iterating."
"$TASK_WITH_RESOLVED"
fi
# PR URL augmentation: when the task contains a GitHub PR URL, inject an explicit
# autonomy directive so Hermes acts without asking for confirmation.
printf
'%s'
"$TASK_DESCRIPTION"
"
import sys, re
m = re.search(r'https://github\.com/[\w-]+/[\w-]+/pull/\d+', sys.stdin.read())
if m:
print(m.group(0))
"
if
"$PR_URL"
then
"${TASK_DESCRIPTION}
IMPORTANT: You are acting as an autonomous agent. If you find that CI checks are failing, review threads are unresolved, or the PR needs remediation, automatically route to AO for remediation (ao spawn --claim-pr N). Do NOT ask 'Would you like me to route to AO?' — just do it. The user invoked /claw to get autonomous action, not a status report."
fi
printf
'%s'
"$TASK_DESCRIPTION"
"
import sys, re
text = sys.stdin.read().strip()
clean = re.sub(r'https?://\\S+', '', text)
m = re.search(r'(?:^|\\s)/([\\w-]+)', clean)
if m:
print(m.group(1))
"
if
"$SLASH_CMD"
then
""
""
for
in
".claude/commands"
"$HOME/.claude/commands"
do
if
"$search_dir/$SLASH_CMD.md"
then
cat
"$search_dir/$SLASH_CMD.md"
"$search_dir/$SLASH_CMD.md"
break
fi
done
if
"$RESOLVED_CONTENT"
then
for
in
".claude/skills"
"$HOME/.claude/skills"
do
if
"$search_dir/$SLASH_CMD/SKILL.md"
then
cat
"$search_dir/$SLASH_CMD/SKILL.md"
"$search_dir/$SLASH_CMD/SKILL.md"
break
elif
"$search_dir/$SLASH_CMD.md"
then
cat
"$search_dir/$SLASH_CMD.md"
"$search_dir/$SLASH_CMD.md"
break
fi
done
fi
if
"$RESOLVED_CONTENT"
then
echo
"Resolved /$SLASH_CMD from $RESOLVED_SOURCE"
"The user asked: $TASK_DESCRIPTION
Below is the full definition of /$SLASH_CMD (resolved from $RESOLVED_SOURCE). Execute it as instructed:
---
$RESOLVED_CONTENT
---"
fi
fi
# Max-attempts override: --max-attempts N (default 5 for PR tasks; no cap for freeform tasks)
if
printf
'%s'
"$TASK_WITH_RESOLVED"
'--max-attempts'
then
printf
'%s'
"$TASK_WITH_RESOLVED"
'--max-attempts[[:space:]]+[0-9]+'
'{print $2}'
head
printf
'%s'
"$TASK_WITH_RESOLVED"
"s/--max-attempts[[:space:]]*[0-9]*//"
's/^[[:space:]]*//'
export
fi
# Bidi mode: synchronous, streaming output
false
""
if
printf
'%s'
"$TASK_WITH_RESOLVED"
'^--bidi'
then
true
printf
'%s'
"$TASK_WITH_RESOLVED"
's/^--bidi[[:space:]]*//'
fi
if
printf
'%s'
"$TASK_WITH_RESOLVED"
'^--continue'
then
printf
'%s'
"$TASK_WITH_RESOLVED"
's/^--continue[[:space:]]*//'
'{print $1}'
fi
# --hermes: force the task to run inline in the gateway (skip the AO directive).
false
if
printf
'%s'
"$TASK_WITH_RESOLVED"
'^--hermes'
then
true
printf
'%s'
"$TASK_WITH_RESOLVED"
's/^--hermes[[:space:]]*//'
fi
# General AO-dispatch directive (the documented "AO workers first" default).
# For freeform tasks — no PR URL (those already carry their own AO remediation
# directive above), not --bidi (interactive), not --hermes (forced inline) — tell
# the gateway to delegate to an AO worker unless the task is small enough to finish
# inline. The trivial-vs-AO judgment is the gateway LLM's to make (ZFC: the model
# decides, the skill only states the policy) — we never classify the task in code.
if
"$BIDI_MODE"
true
"$FORCE_HERMES"
true
"${PR_URL:-}"
then
"${TASK_WITH_RESOLVED}
IMPORTANT — dispatch policy: unless this is a very small task you can fully complete inline in a few steps, dispatch it to an AO worker (e.g. \`ao spawn\` / \`ao spawn --claim-pr N\`) rather than doing the whole thing inline in this gateway session. Default to AO for multi-file changes, PR/CI/build/deploy work, or anything beyond a few minutes; handle only genuinely small asks inline. You decide which side of that line this task is on. Act autonomously — do not ask whether to dispatch to AO, just route it."