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/.claude/commands/hooks/overview.md

rUvabd25d52087f
diff --git a/.claude/checkpoints/1758908711.json b/.claude/checkpoints/1758908711.json
new file mode 100644
index 0000000000..026230b0ab
--- /dev/null
+++ b/.claude/checkpoints/1758908711.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250926-174511", "file": "/workspaces/claude-code-flow/.claude/commands/hooks/overview.md", "timestamp": "2025-09-26T17:45:11Z", "type": "pre-edit", "original_branch": "alpha-125"}
diff --git a/.claude/checkpoints/1758908713.json b/.claude/checkpoints/1758908713.json
new file mode 100644
index 0000000000..82a9e84e88
--- /dev/null
+++ b/.claude/checkpoints/1758908713.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250926-174513", "file": "/workspaces/claude-code-flow/.claude/commands/hooks/overview.md", "timestamp": "2025-09-26T17:45:13Z", "type": "post-edit", "branch": "alpha-125", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 48 ++++++++ .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1758908688.json | 1 + .claude/checkpoints/1758908690.json | 1 + .claude/commands/coordination/task-orchestrate.md | 136 ++++++++++++++++++++-- .claude/commands/hooks/overview.md | 15 ++- .claude/commands/memory/memory-usage.md | 106 +++++++++++++++-- claude-flow-wiki | 0 9 files changed, 291 insertions(+), 24 deletions(-) "}
diff --git a/.claude/commands/hooks/overview.md b/.claude/commands/hooks/overview.md
index 6fb39ccb28..8c8a5a3b10 100644
--- a/.claude/commands/hooks/overview.md
+++ b/.claude/commands/hooks/overview.md
@@ -42,7 +42,16 @@ Hooks are configured in `.claude/settings.json`:
"matcher": "^(Write|Edit|MultiEdit)$",
"hooks": [{
"type": "command",
- "command": "npx claude-flow hook pre-edit --file '${tool.params.file_path}'"
+ "command": "npx claude-flow hook pre-edit --file '${tool.params.file_path}' --memory-key 'swarm/editor/current'"
+ }]
+ }
+ ],
+ "PostToolUse": [
+ {
+ "matcher": "^(Write|Edit|MultiEdit)$",
+ "hooks": [{
+ "type": "command",
+ "command": "npx claude-flow hook post-edit --file '${tool.params.file_path}' --memory-key 'swarm/editor/complete'"
}]
}
]
@@ -50,14 +59,74 @@ Hooks are configured in `.claude/settings.json`:
}
```
+## MCP Tool Integration in Hooks
+
+Hooks automatically trigger MCP tools for coordination:
+
+```javascript
+// Pre-task hook spawns agents
+npx claude-flow hook pre-task --description "[task]"
+// Internally calls:
+mcp__claude-flow__agent_spawn { type: "appropriate-agent" }
+
+// Post-edit hook updates memory
+npx claude-flow hook post-edit --file "[file]"
+// Internally calls:
+mcp__claude-flow__memory_usage {
+ action: "store",
+ key: "swarm/editor/[file]",
+ namespace: "coordination",
+ value: JSON.stringify({ file, changes, timestamp })
+}
+
+// Session-end hook persists state
+npx claude-flow hook session-end
+// Internally calls:
+mcp__claude-flow__memory_persist { sessionId: "[session-id]" }
+```
+
+## Memory Coordination Protocol
+
+All hooks follow the mandatory memory write pattern:
+
+```javascript
+// 1. STATUS - Hook starts
+mcp__claude-flow__memory_usage {
+ action: "store",
+ key: "swarm/hooks/[hook-name]/status",
+ namespace: "coordination",
+ value: JSON.stringify({ status: "running", hook: "[name]" })
+}
+
+// 2. PROGRESS - Hook processes
+mcp__claude-flow__memory_usage {
+ action: "store",
+ key: "swarm/hooks/[hook-name]/progress",
+ namespace: "coordination",
+ value: JSON.stringify({ progress: 50, action: "processing" })
+}
+
+// 3. COMPLETE - Hook finishes
+mcp__claude-flow__memory_usage {
+ action: "store",
+ key: "swarm/hooks/[hook-name]/complete",
+ namespace: "coordination",
+ value: JSON.stringify({ status: "complete", result: "success" })
+}
+```
+
## Benefits
- πŸ€– Automatic agent assignment based on file type
- 🎨 Consistent code formatting
-- 🧠 Continuous neural pattern improvement
-- πŸ’Ύ Cross-session memory persistence
-- πŸ“Š Performance metrics tracking
+- 🧠 Continuous neural pattern improvement
+- πŸ’Ύ Cross-session memory persistence via MCP tools
+- πŸ“Š Performance metrics tracking through memory
+- πŸ”„ Automatic memory coordination between agents
+- 🎯 Smart agent spawning based on task analysis
## See Also
- [Pre-Edit Hook](./pre-edit.md)
- [Post-Edit Hook](./post-edit.md)
-- [Session End Hook](./session-end.md)
\ No newline at end of file
+- [Session End Hook](./session-end.md)
+- [Memory Usage](../memory/memory-usage.md)
+- [Agent Spawning](../agents/agent-spawning.md)
\ No newline at end of file