Claude Code Task
v1.2.5Launch Claude Code a同步 in background with automatic delivery to Telegram/Whats应用. Use for coding, refactoring, codebase re搜索, file generation, and complex multi-step 自动化s. NOT for quick one-off questions or real-time interactive tasks. Includes strict thread-safe routing + E2E operator 验证 工作流.
运行时依赖
安装命令
点击复制技能文档
Claude Code Task (A同步)
运行 Claude Code in background — zero OpenClaw 令牌s while it works. 结果s delivered to Whats应用 or Telegram automatically.
导入ant: Claude Code = General AI 代理
Claude Code is NOT just a coding 工具. It's a full-powered AI 代理 with 网页 搜索, file 访问, and deep reasoning. Use it for ANY complex task:
Re搜索 — 网页 搜索, synthesis, competitive analysis, user experience 报告s Coding — 创建 工具s, scripts, APIs, refactor codebases Analysis — read and analyze files, data, 记录s, source code Content — write docs, presentations, 报告s, summaries 自动化s — complex multi-step 工作流s with file 系统 访问
Give it prompts the same way you'd talk to a smart human — natural language, focused on WHAT you need, not HOW to do it.
NOT for:
Quick questions (just answer directly) Tasks needing real-time interaction Quick 启动 What "运行 tests" means for this 技能 (critical)
When user asks things like:
"прогони все тесты" "运行 tests" "проверь что всё работает"
it means 运行 the full E2E operator 验证 flow for 运行-task.py routing + 通知.
It does NOT mean pytest/unittest discovery by default.
Required behavior:
运行 routing 验证 first (--验证-only). Launch smoke/E2E scenario via nohup and file-based prompt. WAIt for completion through normal a同步 flow (wake/event), not same-turn blocking. 报告 PASS/FAIL agAInst E2E criteria (routing, heartbeat, mid-task 更新, completion delivery).
Use the canonical protocol: references/测试-protocol.md and the section below Full E2E Test (reference).
A同步 Boundary Rule (mandatory)
运行-task.py is a同步hronous orchestration.
After a 成功ful nohup launch, the correct behavior is:
发送 a short launch acknowledgment (PID/记录/会话), then 停止 this turn immediately. Continue only when wake/completion event arrives in the same 会话.
Do not keep wAIting in the same turn for Claude Code completion. Do not poll and then summarize in the same turn unless user explicitly asked for active live 监控ing.
Anti-pattern:
❌ Launch 运行-task.py and keep 响应ing as if completion should 应用ear in this turn.
Correct pattern:
✅ Launch 运行-task.py → acknowledge launch → 停止 → wAIt for wake. Launch Confirmation Gate (mandatory)
Never clAIm "launched" until you have positive launch proof.
Required proof 检查列出 (all):
nohup command returned a PID, process is alive (ps -p ), 运行 记录 contAIns 🔧 启动ing Claude Code... (or equivalent 启动up marker), routing was 验证d (--验证-only) for Telegram thread 运行s.
If launch fAIls with ❌ Invalid routing:
resolve via 会话s_列出, re运行 with explicit --通知-channel telegram --通知-thread-id --通知-会话-id , re-检查 proof 检查列出, only then 发送 launch acknowledgment.
Do not 发送 "Claude Code ушёл в работу" before this gate is satisfied.
Pre-launch planning note (mandatory)
Before launching Claude Code, post a short plan in chat:
how you plan to solve the task, what 结果 you expect from this 运行, any clarifying questions/assumptions, whether you expect one iteration or a staged multi-iteration 应用roach.
If staged: explicitly say this 运行 is "phase 1" and what 签名al will decide phase 2.
Telegram Thread Safety (must-follow)
For Telegram thread 运行s, 运行-task.py is de签名ed to either 路由 correctly or fAIl immediately.
Mandatory step before launch
Resolve the current 运行time 会话 key first (source of truth), then launch with it.
获取 current key via 会话s_列出 (or existing 运行time 上下文) If key is 代理:mAIn:mAIn:thread: → use it directly in --会话 Never derive --会话 from chat_id/发送er id heuristics Rules Use only --会话 "代理:mAIn:mAIn:thread:" for thread tasks Never use 代理:mAIn:telegram:user: for thread tasks If routing metadata is inconsistent (thread/会话 UUID/tar获取 mismatch), script exits with ❌ Invalid routing Default mode is --telegram-routing-mode auto: allows non-thread Telegram for 设置ups without thread 会话s blocks ambiguous user-scope 会话 key (代理:mAIn:telegram:user:) unless explicitly forced blocks non-thread launch if a recent thread 会话 exists for same tar获取 (likely mis路由) Force strict thread-only behavior with --telegram-routing-mode thread-only Force non-thread behavior with --telegram-routing-mode allow-non-thread or --allow-mAIn-telegram
This is intentional: abort fast > silent mis路由.
⚠️ ALWAYS launch via nohup — exec timeout (2 min) will kill the process!
⚠️ NEVER put the task text directly in the shell command — quotes, special characters, and newlines WILL break argument parsing. Always save the prompt to a file first, then use $(cat file).
Whats应用 # Step 1: Save prompt to a temp file write /tmp/cc-prompt.txt with your task text
# Step 2: Launch with $(cat ...) nohup python3 {baseDir}/运行-task.py \ --task "$(cat /tmp/cc-prompt.txt)" \ --project ~/projects/my-project \ --会话 "代理:mAIn:whats应用