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/analysis.js

rUv436c7cde9554
diff --git a/.claude/checkpoints/1755117241.json b/.claude/checkpoints/1755117241.json
new file mode 100644
index 0000000000..fd4258c152
--- /dev/null
+++ b/.claude/checkpoints/1755117241.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250813-203401", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/analysis.js", "timestamp": "2025-08-13T20:34:01Z", "type": "pre-edit", "original_branch": "alpha-89"}
diff --git a/.claude/checkpoints/1755117243.json b/.claude/checkpoints/1755117243.json
new file mode 100644
index 0000000000..a270f3150c
--- /dev/null
+++ b/.claude/checkpoints/1755117243.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250813-203403", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/analysis.js", "timestamp": "2025-08-13T20:34:03Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 120 +++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1755117172.json | 1 + .claude/checkpoints/1755117174.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/analysis.js | 6 ++ 7 files changed, 132 insertions(+), 4 deletions(-) "}
diff --git a/src/cli/simple-commands/analysis.js b/src/cli/simple-commands/analysis.js
index 3e222f6db7..eaf637fbc1 100644
--- a/src/cli/simple-commands/analysis.js
+++ b/src/cli/simple-commands/analysis.js
@@ -427,6 +427,67 @@ EXAMPLES:
// Helper functions for real token tracking are now imported from token-tracker.js
+async function claudeMonitorCommand(subArgs, flags) {
+ const sessionId = subArgs[1] || 'current';
+ const interval = flags.interval || 5000;
+
+ console.log(`πŸ“Š Starting Claude session monitor...`);
+ console.log(` Session ID: ${sessionId}`);
+ console.log(` Update interval: ${interval / 1000}s`);
+ console.log(` Press Ctrl+C to stop monitoring\n`);
+
+ try {
+ // Import the telemetry module
+ const { monitorClaudeSession } = await import('./claude-telemetry.js');
+
+ // Start monitoring
+ const stopMonitor = await monitorClaudeSession(sessionId, interval);
+
+ // Handle graceful shutdown
+ process.on('SIGINT', () => {
+ stopMonitor();
+ process.exit(0);
+ });
+
+ // Keep process running
+ await new Promise(() => {});
+ } catch (error) {
+ printError(`Failed to start Claude monitor: ${error.message}`);
+ console.log('\nπŸ’‘ TIP: Make sure Claude is installed and accessible');
+ }
+}
+
+async function claudeCostCommand(subArgs, flags) {
+ console.log(`πŸ’° Retrieving Claude session cost information...`);
+
+ try {
+ // Import the telemetry module
+ const { extractCostCommand } = await import('./claude-telemetry.js');
+
+ // Get cost data
+ const costData = await extractCostCommand();
+
+ console.log('\nπŸ“Š Current Session Usage:');
+ console.log(` Input Tokens: ${costData.tokens.input || 0}`);
+ console.log(` Output Tokens: ${costData.tokens.output || 0}`);
+ console.log(` Total Tokens: ${costData.tokens.total || 0}`);
+
+ if (costData.costs.length > 0) {
+ console.log(` Estimated Cost: $${costData.costs[0]}`);
+ }
+
+ // Also show pricing info
+ console.log('\nπŸ’° Claude 3 Pricing:');
+ console.log(' β€’ Opus: $15/1M input, $75/1M output');
+ console.log(' β€’ Sonnet: $3/1M input, $15/1M output');
+ console.log(' β€’ Haiku: $0.25/1M input, $1.25/1M output');
+
+ } catch (error) {
+ printError(`Failed to retrieve cost data: ${error.message}`);
+ console.log('\nπŸ’‘ TIP: Run this while Claude is active or immediately after');
+ }
+}
+
async function showSimulatedTokenUsage(breakdown, costAnalysis) {
// Show honest message about no data instead of fake numbers
console.log(`\nπŸ”’ TOKEN USAGE ANALYSIS:`);