Use the local runner script instead of raw claude -p when the task needs any of these:
cc-switch~/.openclaw/state/cc-tasks/--expect-file, --expect-contains, --expect-glob)Primary script:
/Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.shUse this skill when:
Do not use this skill when:
read / edit is simplerGLM-5.1 for architecture / long-context reasoningminimax-m2.7 for deeper problem solving and robust headless runs--json-schema-file--expect-file, --expect-contains, --expect-globcc-task-runner.sh run or run-file.status, then log if anything looks off.structured_output.status=failure as a real failure.bash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh run \
"task-name" \
"GLM-5.1" \
"/abs/workdir" \
-- "Your task prompt here"
bash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh run \
"task-name" \
"GLM-5.1" \
"/abs/workdir" \
--permission-mode bypassPermissions \
-- "Create /abs/workdir/output.txt with content: hello world"
All --expect-file, --expect-contains, --expect-glob support repeat usage.
--expect-contains binds to the most recent --expect-file before it.
bash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh run \
"multi-check" \
"GLM-5.1" \
"/abs/workdir" \
--permission-mode bypassPermissions \
--expect-file "/abs/workdir/a.txt" \
--expect-contains "alpha" \
--expect-file "/abs/workdir/b.txt" \
--expect-glob "out/*.log" \
-- "Create a.txt with 'alpha ok', b.txt with 'bravo ok', and out/run.log"
Meaning:
a.txt must exist AND contain "alpha"b.txt must exist (no content check)out/*.log glob must match at least one filebash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh run \
"full-check" \
"GLM-5.1" \
"/abs/workdir" \
--permission-mode bypassPermissions \
--json-schema-file "/abs/schema.json" \
--expect-file "/abs/workdir/output.txt" \
--expect-contains "expected text" \
--expect-glob "logs/*.log" \
-- "Your task prompt"
bash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh run-file \
"task-name" \
"minimax-m2.7" \
"/abs/workdir" \
"/abs/prompt.txt" \
--json-schema-file "/abs/schema.json"
bash
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh status "task-name"
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh log "task-name"
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh list
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh kill "task-name"
bash /Users/zhengweidong/.openclaw/workspace/scripts/cc-task-runner.sh clean
ParameterRepeatableBinds toDescription--expect-file <path>✅ yesselfFile must exist after task--expect-contains <text>✅ yesprevious --expect-fileThat file must contain text--expect-glob <pattern>✅ yesselfGlob must match ≥1 file--json-schema-file <file>❌ noselfEnforces structured output--permission-mode <mode>❌ noselfbypassPermissions or acceptEdits``--fallback-model <alias>❌ noselfRetry with this model on failure--max-retries <n>❌ noselfMax retry attempts (default: 1)
bash
--expect-file a.txt \
--expect-contains "hello" \
--expect-contains "world" \ # both "hello" AND "world" checked in a.txt
--expect-file b.txt \ # b.txt just needs to exist
--expect-glob "out/*.csv" # independent glob check
For tasks that must produce files, always provide at least one artifact check.
Preferred combinations:
--expect-file--expect-file + --expect-contains--expect-glob--json-schema-filePermission mode: Prefer --permission-mode bypassPermissions in trusted local environments when the task must write files or run Bash. Without it, Claude may ask for manual approval and the task will hang.
Do not trust plain language like "已完成" or "done" without validation.
CodeMeaning0Task completed, all validations passed1Model/runtime error2Artifact validation failed3Structured output reported failure
Keep schemas small. Use them to force a machine-checkable result contract.
Good default schema for most tasks:
status: success|failuresummary: short textfiles_changed: optional arrayerror_category: optionalsuggestion: optionalCurrent local environment supports GLM-5.1 headless via:
https://open.bigmodel.cn/api/anthropicglm-5.1The local cc-switch wrapper already special-cases this. Use the alias GLM-5.1, not a raw model id, when calling the runner.
If a task fails:
statuslogIf the model says success but artifact validation fails, trust the validator, not the prose.
Read these only when you need deeper details:
references/runner-usage.md for usage notes and patternsreferences/task-schema-example.json for a reusable schema templatescripts/run-task-example.sh for a concrete invocation pattern