v3/implementation/migration/MIGRATION-GUIDE.md
This guide walks you through migrating from Claude-Flow v2.x to v3.0. The migration is designed to be zero-breaking-changes - all v2 code continues to work while you gradually adopt v3 features.
# Update to v3
npm install [email protected]
# Install new optional dependencies
npm install sql.js # Windows support
npx claude-flow migrate --to v3
This command:
.claude/config.json.v2.backup# Run compatibility tests
npm run test:compatibility
# Check migration status
npx claude-flow status --check-migration
If you prefer manual control or auto-migration fails:
.claude/
├── settings.json
├── settings-enhanced.json
├── settings-complete.json
├── settings-github-npx.json
└── ... (9 files total)
.claude/
├── config.json # Master config
├── settings.prod.json # Production
├── settings.dev.json # Development
└── settings.github.json # GitHub automation
{
"version": "3.0.0",
"agenticFlow": {
"enabled": true,
"attention": "flash",
"sona": "balanced",
"learning": true
},
"extends": "./settings.prod.json"
}
# settings.prod.json = settings-enhanced.json content
cp .claude/settings-enhanced.json .claude/settings.prod.json
# Update version in settings.prod.json
rm .claude/settings-complete.json
rm .claude/settings-checkpoint-*.json
rm .claude/settings.reasoningbank-*.json
rm .claude/settings-npx-hooks.json
Hooks scattered in multiple files:
.claude/settings-enhanced.json.claude/settings-complete.json.claude-plugin/hooks/hooks.jsonSingle source in config.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"commands": ["npx claude-flow hooks pre-tool --tool=$TOOL_NAME"]
}
],
"PostToolUse": [
{
"matcher": "*",
"commands": ["npx claude-flow hooks post-tool --tool=$TOOL_NAME"]
}
]
}
}
.claude/agents/
├── consensus/
├── core/
├── devops/
├── flow-nexus/
├── github/
├── hive-mind/
├── orchestration/
├── performance/
├── planning/
├── sparc/
├── specialized/
├── swarm/
├── templates/
├── testing/
└── ... (22 directories)
.claude/agents/
├── core/ # Essential: coder, tester, reviewer, researcher, planner
├── orchestration/ # All coordinators consolidated
├── platform/ # github, flow-nexus, devops
├── specialized/ # Domain experts
├── methodology/ # sparc, tdd
├── consensus/ # Distributed consensus
└── testing/ # Quality & validation
// v2 code (still works!)
const coordinator = new SwarmCoordinator();
const agentId = await coordinator.spawnAgent({ type: 'coder' });
// v3 enhanced (opt-in)
import { AgenticFlowAdapter } from 'claude-flow/v3';
const adapter = new AgenticFlowAdapter({ sona: 'research' });
const agentId = await adapter.createAgent('coder', {
learning: true, // +55% quality
reflexion: true // Self-improvement
});
// v2 code (still works!)
const memory = new MemoryManager();
const results = await memory.search('query');
// v3 enhanced (opt-in)
import { HybridMemorySystem } from 'claude-flow/v3';
const memory = new HybridMemorySystem();
const results = await memory.search('query', {
semantic: true, // AgentDB vector search
k: 5 // 150x faster with HNSW
});
npm install sql.js
Claude-Flow v3 automatically detects Windows and uses sql.js.
// .claude/config.json
{
"database": {
"provider": "sql.js" // Force sql.js even on Linux/macOS
}
}
| Feature | better-sqlite3 | sql.js |
|---|---|---|
| Core operations | ✅ | ✅ |
| Memory storage | ✅ | ✅ |
| Swarm coordination | ✅ | ✅ |
| ReasoningBank | ✅ | ❌ |
| Vector search | ✅ | ❌ |
v2 accumulated 3,720+ checkpoint files. v3 auto-archives old ones.
# Archive checkpoints older than 7 days
cd .claude/checkpoints
mkdir -p archive
find . -maxdepth 1 -name "*.json" -mtime +7 -exec mv {} archive/ \;
tar -czf archive.tar.gz archive/
rm -rf archive/
// .claude/config.json
{
"checkpoints": {
"maxActive": 20,
"archiveAfterDays": 7,
"compressArchive": true
}
}
// .claude/config.json
{
"agenticFlow": {
"sona": "research" // Options: real-time, balanced, research, edge, batch
}
}
| Profile | Quality | Speed | Use Case |
|---|---|---|---|
| real-time | Baseline | <0.5ms | Live apps |
| balanced | +25% | 18ms | Default |
| research | +55% | 18ms | Max accuracy |
| edge | Balanced | Minimal | <5MB footprint |
| batch | +25% | 15-50ms | Processing |
// .claude/config.json
{
"agenticFlow": {
"attention": "flash" // 2.49x-7.47x speedup
}
}
import { AgenticFlowAdapter } from 'claude-flow/v3';
const adapter = new AgenticFlowAdapter({ enableGNN: true });
const results = await adapter.searchPatterns(query, {
k: 5,
graphContext: knowledgeBase // +12.4% accuracy
});
If you need to rollback to v2:
# Restore v2 config
cp .claude/config.json.v2.backup .claude/config.json
# Downgrade package
npm install [email protected]
# Restore v2 settings (if needed)
git checkout HEAD~1 -- .claude/settings-*.json
npm install [email protected]
# Ensure WASM file is accessible
npm rebuild sql.js
These are informational only. Your code still works. To silence:
// .claude/config.json
{
"deprecationWarnings": false
}
Manual resolution needed:
.claude/config.json.v2.backup.claude/config.json under hooks keyMigration Guide Version: 1.0.0