| name | manifold-parallel |
| description | Execute tasks in parallel using git worktrees. Analyzes dependencies and file overlaps to safely parallelize independent tasks. |
/manifold:parallel
/manifold:parallel - Parallel Task Execution
Execute multiple tasks in parallel using isolated git worktrees.
Usage
/manifold:parallel "task1" "task2" "task3" [options]
Options
| Flag | Description |
|---|
--auto-parallel | Enable automatic parallelization without confirmation |
--max-parallel N | Maximum concurrent tasks (default: 4) |
--verbose, -v | Show detailed output |
--deep | Use deep analysis (slower but more accurate) |
--timeout N | Task timeout in seconds (default: 300) |
--strategy TYPE | Merge strategy: sequential, squash, rebase |
--no-cleanup | Don't cleanup worktrees after completion |
--dry-run | Analyze but don't execute |
--file, -f FILE | Load tasks from YAML file |
Process
- Task Analysis - Parse task descriptions and identify file mentions
- File Prediction - Predict which files each task will modify using:
- Explicit mentions (95% confidence)
- Pattern matching (80% confidence)
- Module inference (70% confidence)
- Git history (60% confidence)
- Heuristics (50% confidence)
- Overlap Detection - Identify file conflicts between tasks
- Group Formation - Form safe parallel groups (no file overlap)
- Resource Check - Verify disk, memory, CPU capacity
- Parallel Execution - Create isolated worktrees and execute concurrently
- Merge - Automatically merge results to main worktree
- Cleanup - Remove temporary worktrees
Example
User: /manifold:parallel "Add login form" "Add signup form" "Add password reset" --dry-run
Response:
🔄 Analyzing tasks for parallelization...
PARALLELIZATION ANALYSIS
────────────────────────
Recommendation: ✅ PARALLELIZE (85% confidence)
Safe Parallel Groups:
Group 1: [Add login form, Add signup form]
└─ No file overlap detected
Group 2: [Add password reset]
└─ Overlaps with Group 1 on src/auth/utils.ts
Sequential Tasks: None
Estimated Speedup: 1.8x (2 parallel + 1 sequential)
ℹ️ Dry run mode - no execution performed
Configuration
Create .parallel.yaml in project root:
enabled: true
autoSuggest: true
autoParallel: false
maxParallel: 4
maxDiskUsagePercent: 90
maxMemoryUsagePercent: 85
maxCpuLoadPercent: 80
timeout: 300000
cleanupOnComplete: true
mergeStrategy: sequential
Constraints Satisfied
| Constraint | Description | Implementation |
|---|
| B1 | No merge conflicts | Overlap detection prevents file conflicts |
| B2 | Faster than sequential | Parallel execution with resource-aware concurrency |
| B3 | Auto-identify opportunities | Task analysis and file prediction |
| B4 | Opt-in control | Configuration and explicit flags |
| T1 | Clean branch state | Pre-check before worktree creation |
| T2 | Isolated worktrees | Each task runs in separate worktree |
| T3 | No same-file parallel | Overlap detector enforces |
Execution Instructions
When this command is invoked:
- Parse task descriptions from arguments
- Load configuration from
.parallel.yaml if present
- Analyze tasks for dependencies and predict file modifications
- Detect overlaps and form safe parallel groups
- Check system resources (disk, memory, CPU)
- If
--dry-run, display analysis and exit
- Create isolated git worktrees for each parallel task
- Execute tasks concurrently using Claude Code agents
- Merge completed worktrees back to main branch
- Cleanup temporary worktrees unless
--no-cleanup
- Report results with timing and any failures
Requirements
- Git repository in clean state (no uncommitted changes)
- Sufficient disk space for worktrees (~500MB per worktree)
- Claude Code agent capabilities for task execution
Related Commands
/manifold:m0-init - Initialize a constraint manifold
/manifold:m-status - Show current manifold state
How It Works
The parallel execution system:
- TaskAnalyzer parses task descriptions and builds dependency graphs
- FilePredictor predicts which files each task will modify using keyword/path heuristics
- OverlapDetector identifies file conflicts between tasks — overlapping tasks cannot run in parallel
- WorktreeManager creates isolated git worktrees for each parallel group
- ResourceMonitor checks disk/memory/CPU to determine safe parallelism level
- After execution, results are merged back to the main worktree
Use --dry-run to see the analysis without executing.