首页/ AI 技能 / @skilllib/skill-2117939930272411022
Skill站外收录 @skilllib/skill-2117939930272411022

no-polling-agents

执行后台任务时无需轮询,通过状态文件监听完成状态,在用户询问或需获取结果时再读取反馈,避免阻塞和资源浪费,实现高效异步协作。

0.0 (0) 19 次安装 原作者 编程导航
收录于 2026-01-22
效率工具 AI 技能

Skills.MD

# No Polling for Background Agents When launching parallel background agents, do NOT poll with sleep loops. ## Pattern Background agents write to status files when complete. Wait for them naturally. ## DO - Launch agents with `run_in_background: true` - Continue with other work while agents run - Check status file only when user asks or when you need results to proceed - Trust the agent completion system ## DON'T - Run `sleep 10 && cat status.txt` in loops - Continuously poll for completion - Waste tokens checking status repeatedly - Block on agents unless absolutely necessary ## When to Check Status 1. User explicitly asks "are they done?" 2. You need agent output to proceed with next task 3. Significant time has passed and user is waiting ## Example ```typescript // Launch agents Task({ ..., run_in_background: true }) Task({ ..., run_in_background: true }) // Continue with other work or conversation // Agents will write to status file when done // Only check when needed cat .claude/cache/status.txt ``` ## Source User feedback: "You can just wait until everyone pings you"

评论 0

还没有评论,来抢沙发。