Skip to content
Back to skills

Parallel Execution

ASecurity

Execute multiple Claude Code agents in parallel using the cpo CLI tool. Use when running parallel tasks, monitoring execution, or understanding the execution workflow.

  • 15 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 27, 2026
toolstypescriptbashdebugginggitci/cd

Works with

  • claude code
  • terminal
  • cli

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned May 27, 2026

npx -y skills add jpoutrin/product-forge --skill parallel-execution --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Parallel Execution?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Parallel Execution
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpoutrin-parallel-execution/badge)](https://www.skillsdirectory.com/skills/jpoutrin-parallel-execution)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: parallel-execution
description: Execute multiple Claude Code agents in parallel using the cpo CLI tool. Use when running parallel tasks, monitoring execution, or understanding the execution workflow.
user-invocable: false
---

# Parallel Execution

Execute multiple Claude Code agents in parallel using the `cpo` (Claude Parallel Orchestrator) CLI.

## Primary Method: cpo CLI

The `cpo` tool handles all execution complexity: git worktrees, wave dependencies, and progress monitoring.

### Installation

```bash
pip install claude-parallel-orchestrator
# or
pipx install claude-parallel-orchestrator
```

### Commands

| Command | Description |
|---------|-------------|
| `cpo validate <dir>` | Validate manifest structure and prompts |
| `cpo run <dir>` | Execute all waves (respects dependencies) |
| `cpo status <dir>` | Check execution status |

### Basic Workflow

```bash
# 1. Validate before execution
cpo validate parallel/TS-0042-inventory-system/

# 2. Execute parallel agents
cpo run parallel/TS-0042-inventory-system/

# 3. Monitor progress (in another terminal)
cpo status parallel/TS-0042-inventory-system/
```

### What `cpo run` Does

1. **Validates** manifest.json structure and prompt files
2. **Creates git worktrees** for each task (isolated workspaces)
3. **Launches agents** in parallel (respects wave dependencies)
4. **Monitors progress** with live output
5. **Collects results** in `logs/` and `report.json`

### Wave Execution

Tasks execute in waves based on dependencies:

```
Wave 1: task-001, task-002, task-003  (parallel - no deps)
         ↓ wait for completion
Wave 2: task-004, task-005            (parallel - depend on Wave 1)
         ↓ wait for completion
Wave 3: task-006                      (sequential - depend on Wave 2)
```

Each wave waits for all tasks in the previous wave to complete before starting.

### Agent Permissions

Agents run with `--dangerously-skip-permissions` because they're isolated in worktrees:
- Each agent runs in its own git worktree
- Agents can only affect files in their workspace
- Main branch remains protected until explicit merge

## Alternative: Claude Code SDK

For programmatic orchestration in CI/CD or custom workflows:

```typescript
// orchestrator.ts
import { ClaudeAgent } from '@anthropic-ai/claude-agent-sdk';
import { readdir, readFile } from 'fs/promises';
import { join } from 'path';

async function runParallelTasks(parallelDir: string) {
  const tasksDir = join(parallelDir, 'tasks');
  const contextFile = join(parallelDir, 'context.md');

  const context = await readFile(contextFile, 'utf-8');
  const tasks = await readdir(tasksDir);

  const agents = tasks
    .filter(f => f.endsWith('.md'))
    .map(async (taskFile) => {
      const taskPath = join(tasksDir, taskFile);
      const taskContent = await readFile(taskPath, 'utf-8');

      const agent = new ClaudeAgent({
        systemPrompt: `You are implementing a task.
                       Context: ${context}
                       Follow contracts in ${parallelDir}/contracts/.`,
      });

      return agent.run(`Execute this task:\n\n${taskContent}`);
    });

  const results = await Promise.all(agents);
  return results;
}

runParallelTasks('parallel/TS-0042-inventory-system');
```

## Completion Detection

Agents signal completion by creating a marker file:

```bash
touch .claude-task-complete
```

This enables:
- `cpo` to detect task completion
- Wave coordination (wait for all tasks before next wave)
- Status reporting

## Execution Patterns

| Method | Best For | Parallelism |
|--------|----------|-------------|
| **cpo CLI** | Standard workflow, most users | True parallel with wave deps |
| **Claude Code SDK** | CI/CD, custom orchestration | Fully programmable |

## Tips for Success

1. **Validate first**: Always run `cpo validate` before `cpo run`
2. **Start small**: Test with 2-3 parallel agents before scaling up
3. **Monitor resources**: Limit concurrent agents based on machine capacity
4. **Check logs**: Review `logs/task-*.log` for debugging
5. **Run integration**: Use `/parallel-integrate` after all tasks complete

## Output Files

After execution:
```
parallel/TS-0042-inventory-system/
  logs/
    task-001.log          # Agent output
    task-002.log
    ...
  report.json             # Execution summary
  integration-report.md   # Generated by /parallel-integrate
```

## Related

- `parallel-agents` skill: Overall workflow and directory structure
- `parallel-decompose` skill: Creating tasks before execution
- `parallel-prompt-generator` skill: Generate prompts from task specs
- `agent-tools` skill: Tool permissions (for granular control)
- `/parallel-integrate` command: Post-execution verification

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.