run_claude
Run Claude headlessly for reasoning/architecture tasks, with session resume and automatic retry on rate limits or timeouts.
Instructions
Async call Claude CLI (claude -p headless) to run a task. For reasoning/architecture. Injects auth env. Non-blocking. Auto-tracks task. Pass session_id to resume a prior Claude session (preserves context); the new session id is captured from output and returned for later resumption. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| task_id | No | ||
| workdir | No | ||
| plan_mode | No | Plan 模式:只读调研,强制关 auto,产出方案不落盘 | |
| session_id | No | ||
| max_retries | No | ||
| timeout_sec | No | ||
| fork_on_fail | No | A 失败自动 fork:真失败时父 superseded + 生成备选子任务给此 agent 承接(仅工作流任务,≤3 上限)。不传不自动 fork。 | |
| retry_max_ms | No | ||
| capture_trace | No | 捕获完整推理 step 流存 task.trace,默认 false | |
| retry_base_ms | No |