Here's a straightforward update addressing the Run This First script, the database, and how to use the main script.
The Run This First script is no longer needed. It was a temporary wrapper used during early development when we had separate patch files for monitoring and troubleshooting. The current main deployment script (LegendaryTeamDeploy.sh or .ps1) now includes all those features directly. You can delete Run This First — it's redundant.
No database is required. The optional SQLite artifact index from earlier versions has been removed from the core script because the system works perfectly with simple file-based storage:
This keeps the setup lightweight and dependency-free. If you have a very large project and want advanced search, you can add SQLite manually later, but it's not necessary for normal use.
In your project root folder:
Linux/macOS/WSL2: nano LegendaryTeamDeploy.sh Windows: Create LegendaryTeamDeploy.ps1
Paste the full script from the latest version.
Linux/macOS/WSL2:textchmod +x LegendaryTeamDeploy.sh ./LegendaryTeamDeploy.sh
Start Claude Code:textclaude Run bootstrap:text/bootstrap Reply to prompts: "discovery complete — proceed" "specs approved"
The team is now active.
For returning sessions: @chief resume session.
This process works the same for empty folders, existing codebases, or projects with a pre-existing .claude folder — the script preserves everything and upgrades safely.
The Orchestration SOP.md is the unbreakable rulebook for your Legendary Team — it defines the exact, mandatory sequence @chief and all agents must follow every time. What It Does
Enforces strict hierarchy (@chief only orchestrates)
Defines the 13-step bootstrap process
Sets task execution rules (parallel teams, human approval gates)
Bans chat TODOs, requires pr-agent review, blocks code without "specs approved"
Includes emergency triggers, golden rules, and quality gates
How to Use It
Paste the full content of Orchestration SOP.md into the Claude session
From then on, every interaction follows the SOP exactly.
Without it, agents fall back to default Claude behavior (drift, rebellion possible) With it, your team is disciplined, safe, and predictable
__ ** Most Recent Updates ✅ @Planner - Dependency-aware task decomposition ✅ @Verifier - Quality assurance and scoring ✅ @ReflectionAgent - Self-critique and improvement ✅ /swarm-planner - Structured execution plans ✅ /parallel-task - Wave-based parallel execution ✅ /spawn-subagent - Dynamic agent spawning ✅ Enhanced hooks with reflection triggers ✅ Updated SOP with planning/iteration sections
The Legendary Team is a complete orchestration system for Claude Code that provides:
- 25 Specialized Agents - From @chief (orchestrator) to @DatabaseAgent, @SecurityAgent, etc.
- Confidence-Based Routing - Auto-proceed (≥70%), queue for review (40-69%), or block (<40%)
- File-Based Memory - Ledgers, handoffs, and plans that survive context clears
- Token Optimization - 96.7% reduction with lite agents + self-escalation
- Lifecycle Hooks - SessionStart, PreToolUse, PostToolUse, PreCompact, SessionEnd
See INSTALLATION.md for complete installation instructions.
# One-liner install into existing project
cd ~/your-project && \
git clone https://github.com/RegardV/LegendaryTeam_For_Claude .legendary-tmp && \
cp -r .legendary-tmp/.claude . && \
cp .legendary-tmp/CLAUDE.md .legendary-tmp/"Orchestration SOP.md" . && \
rm -rf .legendary-tmp && \
bash LegendaryTeamDeploy.shThen in Claude Code:
/bootstrap
The deploy script initializes your project with:
| Created | Purpose |
|---|---|
.claude/settings.json |
Registers hooks with Claude Code |
.claude/session-state.json |
Session tracking |
.claude/codebase-map.json |
File change tracking |
thoughts/ directories |
Memory system (ledgers, handoffs, plans) |
CLAUDE.md |
Entry point (if not exists) |
Important: The script preserves existing files. It only creates stubs if files don't exist.
Hooks are registered in .claude/settings.json and fire automatically:
| Hook | When | Purpose |
|---|---|---|
SessionStart.js |
Session begins | Load ledgers and handoffs |
PreToolUse.js |
Before Edit/Write | Validation, budget checks |
PostToolUse.js |
After Edit/Write | Track changes, update map |
PreCompact.js |
Before compaction | Block compaction, require handoff |
SessionEnd.js |
Session ends | Cleanup, extract learnings |
25 specialized agents in three tiers:
Always Loaded:
@chief- Master orchestrator@ConfidenceAgent- Routes tasks by confidence score
Loaded On-Demand:
@DatabaseAgent,@UIAgent,@TestAgent,@SecurityAgent, etc.
Token Optimization:
.claude/agents-lite/- Minimal prompts (~60-100 words).claude/agents-full/- Complete definitions (for self-escalation)
File-based memory that survives context clears:
thoughts/
├── ledgers/ # Current session state
│ └── CONTINUITY_CLAUDE-*.md
├── shared/
│ ├── handoffs/ # Cross-session knowledge
│ │ └── handoff-*.md
│ └── plans/ # Execution plans
│ └── plan-*.md
└── templates/ # Standard formats
your-project/
├── .claude/
│ ├── agents/ # 25 agent definitions
│ ├── agents-lite/ # Token-optimized versions
│ ├── agents-full/ # Full definitions for escalation
│ ├── hooks/ # Lifecycle hooks (JS files)
│ ├── rules/ # Behavioral rules
│ ├── skills/ # Best practice patterns
│ ├── commands/ # Slash commands
│ ├── settings.json # Hook registration
│ ├── session-state.json
│ └── codebase-map.json
├── thoughts/ # Memory system
├── OpenSpec/ # Specifications (if using)
├── CLAUDE.md # Entry point
└── Orchestration SOP.md # Full documentation
| Command | Description |
|---|---|
/bootstrap |
Initialize team, run on session start |
/review-queue |
Show tasks waiting for human review |
/team-status |
Show active agents and progress |
/approve-task [id] |
Approve a queued task |
/swarm-planner [task] |
Generate dependency-aware plan |
/emergency-stop |
Halt all operations |
Tasks are scored 0-100 and routed automatically:
| Score | Tier | Action |
|---|---|---|
| ≥70% | Auto-proceed | Executes immediately, no approval needed |
| 40-69% | Queue | Added to review queue, continues other work |
| <40% | Block | Requires human approval before proceeding |
Scoring factors:
- +40: Similar task succeeded before
- +30: Clear spec/requirements exist
- +20: Known patterns available
- -20: Security implications
- -30: Conflicting requirements
- -40: Destructive operations
- @chief - Master orchestrator, spawns teams, manages queue
- @ConfidenceAgent - Scores tasks, routes to tiers
- @SessionOrchestrator - Memory and continuity management
- @Planner - Task decomposition with dependencies
- @Verifier - Quality assurance, plan validation
- @ReflectionAgent - Self-critique, continuous improvement
- @DatabaseAgent - Schemas, migrations, CRUD
- @UIAgent - Components, styling, responsive design
- @TestAgent - Unit/integration tests (≥80% coverage)
- @E2ERunner - Playwright E2E tests
- @SecurityAgent - Auth, encryption, audits
- @PerformanceOptimizer - Profiling, benchmarking
- @RefactorAgent - Code cleanup, dead code removal
- @DocAgent - Documentation, README, API docs
- @BugResolver - Bug diagnosis, root cause analysis
- @ArchitectureAgent - System design decisions
- @InfrastructureAgent - Deployments, scaling
- @CodebaseCartographer - Tracks all file changes
- @TechStackFingerprinter - Detects technology stack
- @DiscoveryProtector - Drift detection, blocks on mismatch
- @OpenSpecPolice - Enforces specs as source of truth
- @SpecArchitect - Manages spec backups and rollbacks
- @InfraGuardian - Validates infrastructure config
- @TeamBuilder - Rebuilds agents from stack detection
- @ProjectAnalyzer - Deep scan, technical debt detection
| Document | Description |
|---|---|
| INSTALLATION.md | Installation instructions |
| Orchestration SOP.md | Complete operational guide |
| CLAUDE.md | Entry point (read by Claude Code) |
| .claude/hooks/README.md | Hooks documentation |
| thoughts/README.md | Memory system guide |
- Check
.claude/settings.jsonexists and is valid JSON - Verify hook files exist:
ls .claude/hooks/*.js - Make hooks executable:
chmod +x .claude/hooks/*.js
- Run the deploy script:
bash LegendaryTeamDeploy.sh - Check agents exist:
ls .claude/agents/
- Check
thoughts/directories exist - Verify ledger files are being created
- Run
/bootstrapto initialize
- Clear, Don't Compact - Never compact context. Clear and restore from ledgers.
- Specs First - Document before coding. OpenSpec is truth.
- Confidence Routing - Let data decide what needs human review.
- Token Efficiency - Lite agents with self-escalation when needed.
- Human Control - AI assists, humans decide on critical paths.
Version: 2026-ultimate Status: Production-ready Last Updated: 2026-02-10
See LICENSE file for details.
Built for Claude Code | GitHub