Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

πŸ”– Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/swarm.js

rUve332f69033cd
diff --git a/.claude/checkpoints/task-1754223869.json b/.claude/checkpoints/task-1754223869.json
new file mode 100644
index 0000000000..ef64c4ea09
--- /dev/null
+++ b/.claude/checkpoints/task-1754223869.json
@@ -0,0 +1 @@
+{"checkpoint": "task-20250803-122429", "task": "{{user_prompt}} ", "timestamp": "2025-08-03T12:24:29Z", "commit": "43604c8db507b4e393a4132d1942035b14a29b8e", "github_release": "true"}
diff --git a/src/cli/simple-commands/swarm.js b/src/cli/simple-commands/swarm.js
index c649f6bded..74745a3d6f 100644
--- a/src/cli/simple-commands/swarm.js
+++ b/src/cli/simple-commands/swarm.js
@@ -768,15 +768,6 @@ The swarm should be self-documenting - use memory_store to save all important in
// If --claude flag is used, force Claude Code even if CLI not available
if (flags && flags.claude) {
- // Check if claude command exists
- let claudeAvailable = false;
- try {
- execSync('which claude', { stdio: 'ignore' });
- claudeAvailable = true;
- } catch {
- claudeAvailable = false;
- }
-
console.log('🐝 Launching Claude Flow Swarm System...');
console.log(`πŸ“‹ Objective: ${objective}`);
console.log(`🎯 Strategy: ${strategy}`);
@@ -801,7 +792,7 @@ The swarm should be self-documenting - use memory_store to save all important in
console.log('πŸ”“ Using --dangerously-skip-permissions by default for seamless swarm execution');
}
- // Spawn claude with the prompt as the first argument
+ // Spawn claude with the prompt as the first argument (exactly like hive-mind does)
const claudeProcess = spawn('claude', claudeArgs, {
stdio: 'inherit',
shell: false,
@@ -841,21 +832,19 @@ The swarm should be self-documenting - use memory_store to save all important in
process.exit(code || 0);
});
- return;
- } else {
- // Claude CLI not available, provide instructions
- console.log('⚠️ Claude CLI not found. Please install Claude Code:');
- console.log(' https://claude.ai/download');
- console.log('\nπŸ“‹ Once installed, copy this prompt into Claude Code:\n');
- console.log('═'.repeat(80));
- console.log(swarmPrompt);
- console.log('═'.repeat(80));
+ // Handle spawn errors (e.g., claude not found)
+ claudeProcess.on('error', (err) => {
+ if (err.code === 'ENOENT') {
+ console.error('\n❌ Claude Code CLI not found. Please install Claude Code:');
+ console.error(' https://claude.ai/download');
+ console.error('\nπŸ“‹ Swarm prompt saved to:', promptFile);
+ console.error(' You can copy the prompt from the file and paste it into Claude Code.');
+ } else {
+ console.error('\n❌ Failed to launch Claude Code:', err.message);
+ }
+ process.exit(1);
+ });
- // Save prompt to file for easy access
- const promptFile = path.join(process.cwd(), '.claude-flow', `swarm-prompt-${Date.now()}.txt`);
- await mkdirAsync(path.dirname(promptFile));
- await writeTextFile(promptFile, swarmPrompt);
- console.log(`\nπŸ’Ύ Prompt saved to: ${promptFile}`);
return;
}