no-polling-agents
No Polling for Background Agents
When & Why to Use This Skill
This Claude skill optimizes background agent management by implementing a non-polling architectural pattern. It prevents token waste and execution blocking by utilizing status files instead of inefficient sleep loops, ensuring high-performance parallel task orchestration and improved system responsiveness for complex agentic workflows.
Use Cases
- Parallel Task Execution: Launching multiple background agents for intensive data processing or research while maintaining an uninterrupted dialogue with the user.
- Resource Optimization: Significantly reducing token consumption and API overhead by eliminating repetitive 'sleep and check' loops in automated background processes.
- Asynchronous Workflow Management: Efficiently tracking agent completion via status files, allowing the system to proceed with other tasks until results are strictly required or requested.
| name | no-polling-agents |
|---|---|
| description | No Polling for Background Agents |
| user-invocable | false |
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.txtin loops - Continuously poll for completion
- Waste tokens checking status repeatedly
- Block on agents unless absolutely necessary
When to Check Status
- User explicitly asks "are they done?"
- You need agent output to proceed with next task
- Significant time has passed and user is waiting
Example
// 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"