| name | thread-orchestrator-skill |
| description | Multi-agent thread orchestration and coordination |
| allowed-tools | Bash,Read |
| version | 1.2.1 |
Thread Orchestrator Skill
This skill provides orchestration capabilities for managing multiple Claude agent threads with git worktree isolation.
When to Use
Activate this skill when the user wants to:
- Run multiple Claude agents in parallel with isolated worktrees
- Coordinate complex workflows across multiple threads
- Manage thread lifecycle (create, start, stop, resume)
- Handle inter-thread communication via events
- Monitor and manage PR feedback loops
Core Capabilities
Thread Lifecycle Management
- Create threads with different modes (automatic, semi-auto, interactive, sleeping)
- Create threads with isolated git worktrees
- Start, stop, pause, and resume threads
- Query thread status and view logs
- Delete completed threads
Git Worktree Isolation
- Each thread can have its own isolated git worktree
- Multiple threads can work on different branches simultaneously
- Automatic worktree cleanup when threads complete
- Push changes from worktree to remote
Event-Driven Coordination
- Publish events to the blackboard
- Subscribe to events from other threads
- Send direct messages between threads
- Share artifacts between threads
PR Shepherd Integration
- Watch PRs with isolated worktrees
- Automatic CI failure detection and fix
- Review change request handling
- Worktree-per-PR isolation
Essential Commands
Thread Operations
ct init
ct thread create <name> --mode <mode> --template <template>
ct thread create <name> --mode automatic --worktree
ct thread create <name> --worktree --worktree-base develop
ct thread list [status]
ct thread start <id>
ct thread stop <id>
ct thread resume <id>
ct thread status <id>
ct thread logs <id>
Worktree Management
ct worktree list
ct worktree status <id>
ct worktree cleanup
Orchestrator Control
ct orchestrator start
ct orchestrator stop
ct orchestrator status
ct orchestrator restart
PR Shepherd
ct pr watch <pr_number>
ct pr status [pr_number]
ct pr list
ct pr stop <pr_number>
ct pr daemon
Event Operations
ct event list
ct event publish <type> '<json>'
Thread Modes
| Mode | Use Case |
|---|
automatic | Fully autonomous background tasks |
semi-auto | Autonomous with user approval for critical steps |
interactive | Step-by-step user confirmation |
sleeping | Scheduled or event-triggered tasks |
Workflow Patterns
Parallel Epic Development
ct thread create epic-7a --mode automatic --template bmad-developer.md --worktree --context '{"epic_id": "7A"}'
ct thread create epic-8a --mode automatic --template bmad-developer.md --worktree --context '{"epic_id": "8A"}'
ct orchestrator start
ct thread list running
ct worktree list
PR Fix Pipeline
ct pr watch 123
ct pr status 123
Coordinated Review
ct thread create reviewer --mode semi-auto --template reviewer.md --trigger DEVELOPMENT_COMPLETED
Event Types
| Event | Description |
|---|
THREAD_STARTED | Thread began execution |
THREAD_COMPLETED | Thread finished |
THREAD_BLOCKED | Thread encountered a blocker |
WORKTREE_CREATED | Isolated worktree created |
WORKTREE_PUSHED | Changes pushed from worktree |
WORKTREE_DELETED | Worktree cleaned up |
STORY_STARTED | Developer starting story |
STORY_COMPLETED | Story implementation done |
DEVELOPMENT_COMPLETED | All stories finished |
REVIEW_COMPLETED | Code review done |
PR_CREATED | Pull request opened |
CI_PASSED / CI_FAILED | CI status update |
PR_APPROVED | PR approved |
PR_MERGED | PR merged successfully |
Configuration
In .claude-threads/config.yaml:
threads:
max_concurrent: 5
default_max_turns: 80
orchestrator:
poll_interval: 1
idle_poll_interval: 10
idle_threshold: 30
worktrees:
enabled: true
max_age_days: 7
auto_cleanup: true
default_base_branch: main
auto_push: true
pr_shepherd:
max_fix_attempts: 5
ci_poll_interval: 30
auto_merge: false
State Locations
- Database:
.claude-threads/threads.db
- Logs:
.claude-threads/logs/
- Config:
.claude-threads/config.yaml
- Templates:
.claude-threads/templates/
- Worktrees:
.claude-threads/worktrees/
Error Handling
If a thread becomes blocked:
ct thread status <id>
ct thread logs <id>
ct thread resume <id>
ct thread stop <id> && ct thread start <id>
Best Practices
- Use worktrees for parallel development to avoid conflicts
- Start orchestrator before creating automatic threads
- Monitor events for workflow progress
- Use PR Shepherd for automatic CI/review handling
- Clean up orphaned worktrees periodically