mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 06:36:49 +09:00
🔖 Checkpoint: Edit /workspaces/claude-code-flow/.claude/commands/hooks/overview.md
This commit is contained in:
1 parent
c6613fc2f8
commit
abd25d5208
3 files changed
+76
-5
No files matched your search
@@ -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"}
|
||||
@@ -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(-) "}
|
||||
@@ -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)
|
||||
- [Session End Hook](./session-end.md)
|
||||
- [Memory Usage](../memory/memory-usage.md)
|
||||
- [Agent Spawning](../agents/agent-spawning.md)
|
||||
Reference in new issue
Block a user