Execute tasks from the shared deep loop task queue. Processes tasks with claim-based coordination for multi-session support.
Launch N concurrent Claude CLI workers to process .deep/tasks.md in parallel. Each worker claims ONE task, executes PLAN->BUILD->REVIEW->FIX->SHIP, then loops for the next.
/deep execute --workers 3
|
v
Orchestrator (this skill): read tasks, generate script, launch
|
v
.deep/execute.sh (bash master)
|-- worker 1 โ claude -p "claim+execute" โ loops until QUEUE_EMPTY
|-- worker 2 โ (staggered +2s)
|-- worker 3 โ (staggered +4s)
|
v
Wait all, print summary, notify Telegram
.deep/
โโโ tasks.md # Active task queue (input)
โโโ completed-tasks.md # Done tasks with commit SHA (output)
โโโ claims.json # Lock file for multi-worker coordination
โโโ git-conflicts.json # Tasks blocked by git conflicts
โโโ execute.sh # Generated worker script
โโโ worker-1.log # Worker 1 output
โโโ worker-2.log # Worker 2 output
โโโ worker-N.log # Worker N output
โโโ FORCE_EXECUTE_EXIT # Touch to stop all workers
{
"task-001": {
"claimedBy": "w1-a3f2b1c0",
"claimedAt": "2026-01-20T15:00:00Z",
"expiresAt": "2026-01-20T15:30:00Z"
}
}
Worker A: claim task-001 โ implement โ commit โ push โ
Worker B: claim task-003 โ implement โ commit โ push โ (rejected)
โ
fetch + rebase
โ
(conflict?) โ git-blocked + recovery branch
(clean?) โ push retry โ
| Scenario | Behavior |
|---|---|
| Clean rebase | Auto-retry push (up to 3 attempts) |
| File conflict | Mark git-blocked, save recovery branch, continue next task |
| Same file, no conflict | Git auto-merges, push succeeds |
{
"task-005": {
"blockedAt": "2026-01-20T15:30:00Z",
"session": "w2-b4e2c1d0",
"conflictingFiles": ["src/utils/helpers.ts"],
"localCommit": "def789",
"remoteCommit": "123abc",
"recoveryBranch": "deep-recovery/task-005-w2-b4e2c1d0"
}
}
git branch | grep deep-recovery/
git checkout deep-recovery/task-005-w2-b4e2c1d0
# Resolve conflicts, merge to main
| Setting | Value | Description |
|---|---|---|
| Workers default | 3 | Concurrent claude processes |
| Workers max | 8 | Hard cap |
| Claim timeout | 30 min | Time before claim expires |
| Max retries | 3 | Attempts per task before skipping |
| Max push attempts | 3 | Rebase+push retries before git-blocked |
| Stagger delay | 2s | Delay between worker launches |
When invoked:
# Count pending tasks
PENDING=$(grep -c "^## \[ \] task-" .deep/tasks.md 2>/dev/null || echo "0")
Show summary:
=== Deep Execute Queue ===
Pending tasks: {N}
{list first 10 task titles}
===========================
If PENDING == 0: output "No tasks in queue. Use /deep-add to add tasks." and STOP.
Parse --workers N from user input (or default 3).
Rules:
Workers: min(requested, pending, 8)
Get the plugin path for generate-execute-script.js:
PLUGIN_DIR=$(find ~/.claude/plugins -path "*/deep-loop/*/src/generate-execute-script.js" -print -quit 2>/dev/null | xargs dirname)
Generate the execute script:
node "$PLUGIN_DIR/generate-execute-script.js" {workers} "{cwd}"
This creates .deep/execute.sh.
Run the script in background:
bash .deep/execute.sh
Use run_in_background: true on the Bash tool.
Output:
=== Deep Execute Launched ===
Workers: {N}
Queue: {pending} tasks
Monitor logs:
tail -f .deep/worker-*.log
Force stop:
touch .deep/FORCE_EXECUTE_EXIT
Check progress:
grep -c "TASK_COMPLETE" .deep/worker-*.log
cat .deep/completed-tasks.md
=============================
Done. The bash script handles all worker lifecycle, aggregation, and Telegram notification.