claude-flow 2.0.0-alpha.66 → 2.0.0-alpha.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.claude/cache/agent-pool.json +33 -0
  2. package/.claude/cache/memory-optimization.json +19 -0
  3. package/.claude/cache/neural-optimization.json +25 -0
  4. package/.claude/cache/optimized-hooks.json +19 -0
  5. package/.claude/cache/parallel-processing.json +26 -0
  6. package/.claude/optimized-settings.json +270 -0
  7. package/.claude/settings-backup.json +186 -0
  8. package/.claude/settings-enhanced.json +278 -0
  9. package/.claude/settings-fixed.json +186 -0
  10. package/.claude/settings.json +105 -8
  11. package/CHANGELOG.md +38 -0
  12. package/bin/claude-flow +1 -1
  13. package/dist/cli/simple-commands/hive-mind.js +1 -1
  14. package/dist/cli/simple-commands/hive-mind.js.map +1 -1
  15. package/dist/cli/simple-commands/hooks.js +6 -4
  16. package/dist/cli/simple-commands/hooks.js.map +1 -1
  17. package/dist/providers/anthropic-provider.d.ts +27 -0
  18. package/dist/providers/anthropic-provider.d.ts.map +1 -0
  19. package/dist/providers/anthropic-provider.js +247 -0
  20. package/dist/providers/anthropic-provider.js.map +1 -0
  21. package/dist/providers/base-provider.d.ts +134 -0
  22. package/dist/providers/base-provider.d.ts.map +1 -0
  23. package/dist/providers/base-provider.js +407 -0
  24. package/dist/providers/base-provider.js.map +1 -0
  25. package/dist/providers/cohere-provider.d.ts +28 -0
  26. package/dist/providers/cohere-provider.d.ts.map +1 -0
  27. package/dist/providers/cohere-provider.js +407 -0
  28. package/dist/providers/cohere-provider.js.map +1 -0
  29. package/dist/providers/google-provider.d.ts +23 -0
  30. package/dist/providers/google-provider.d.ts.map +1 -0
  31. package/dist/providers/google-provider.js +362 -0
  32. package/dist/providers/google-provider.js.map +1 -0
  33. package/dist/providers/index.d.ts +14 -0
  34. package/dist/providers/index.d.ts.map +1 -0
  35. package/dist/providers/index.js +18 -0
  36. package/dist/providers/index.js.map +1 -0
  37. package/dist/providers/ollama-provider.d.ts +23 -0
  38. package/dist/providers/ollama-provider.d.ts.map +1 -0
  39. package/dist/providers/ollama-provider.js +374 -0
  40. package/dist/providers/ollama-provider.js.map +1 -0
  41. package/dist/providers/openai-provider.d.ts +23 -0
  42. package/dist/providers/openai-provider.d.ts.map +1 -0
  43. package/dist/providers/openai-provider.js +349 -0
  44. package/dist/providers/openai-provider.js.map +1 -0
  45. package/dist/providers/provider-manager.d.ts +139 -0
  46. package/dist/providers/provider-manager.d.ts.map +1 -0
  47. package/dist/providers/provider-manager.js +513 -0
  48. package/dist/providers/provider-manager.js.map +1 -0
  49. package/dist/providers/types.d.ts +356 -0
  50. package/dist/providers/types.d.ts.map +1 -0
  51. package/dist/providers/types.js +61 -0
  52. package/dist/providers/types.js.map +1 -0
  53. package/dist/providers/utils.d.ts +37 -0
  54. package/dist/providers/utils.d.ts.map +1 -0
  55. package/dist/providers/utils.js +322 -0
  56. package/dist/providers/utils.js.map +1 -0
  57. package/dist/services/agentic-flow-hooks/hook-manager.d.ts +70 -0
  58. package/dist/services/agentic-flow-hooks/hook-manager.d.ts.map +1 -0
  59. package/dist/services/agentic-flow-hooks/hook-manager.js +512 -0
  60. package/dist/services/agentic-flow-hooks/hook-manager.js.map +1 -0
  61. package/dist/services/agentic-flow-hooks/index.d.ts +36 -0
  62. package/dist/services/agentic-flow-hooks/index.d.ts.map +1 -0
  63. package/dist/services/agentic-flow-hooks/index.js +325 -0
  64. package/dist/services/agentic-flow-hooks/index.js.map +1 -0
  65. package/dist/services/agentic-flow-hooks/llm-hooks.d.ts +33 -0
  66. package/dist/services/agentic-flow-hooks/llm-hooks.d.ts.map +1 -0
  67. package/dist/services/agentic-flow-hooks/llm-hooks.js +415 -0
  68. package/dist/services/agentic-flow-hooks/llm-hooks.js.map +1 -0
  69. package/dist/services/agentic-flow-hooks/memory-hooks.d.ts +45 -0
  70. package/dist/services/agentic-flow-hooks/memory-hooks.d.ts.map +1 -0
  71. package/dist/services/agentic-flow-hooks/memory-hooks.js +532 -0
  72. package/dist/services/agentic-flow-hooks/memory-hooks.js.map +1 -0
  73. package/dist/services/agentic-flow-hooks/neural-hooks.d.ts +39 -0
  74. package/dist/services/agentic-flow-hooks/neural-hooks.d.ts.map +1 -0
  75. package/dist/services/agentic-flow-hooks/neural-hooks.js +561 -0
  76. package/dist/services/agentic-flow-hooks/neural-hooks.js.map +1 -0
  77. package/dist/services/agentic-flow-hooks/performance-hooks.d.ts +33 -0
  78. package/dist/services/agentic-flow-hooks/performance-hooks.d.ts.map +1 -0
  79. package/dist/services/agentic-flow-hooks/performance-hooks.js +621 -0
  80. package/dist/services/agentic-flow-hooks/performance-hooks.js.map +1 -0
  81. package/dist/services/agentic-flow-hooks/types.d.ts +379 -0
  82. package/dist/services/agentic-flow-hooks/types.d.ts.map +1 -0
  83. package/dist/services/agentic-flow-hooks/types.js +8 -0
  84. package/dist/services/agentic-flow-hooks/types.js.map +1 -0
  85. package/dist/services/agentic-flow-hooks/workflow-hooks.d.ts +39 -0
  86. package/dist/services/agentic-flow-hooks/workflow-hooks.d.ts.map +1 -0
  87. package/dist/services/agentic-flow-hooks/workflow-hooks.js +742 -0
  88. package/dist/services/agentic-flow-hooks/workflow-hooks.js.map +1 -0
  89. package/package.json +1 -1
  90. package/scripts/optimize-performance.js +400 -0
  91. package/scripts/performance-monitor.js +263 -0
  92. package/src/cli/help-text.js +1 -1
  93. package/src/cli/simple-cli.js +1 -1
  94. package/src/cli/simple-commands/hive-mind.js +1 -1
  95. package/src/providers/anthropic-provider.ts +282 -0
  96. package/src/providers/base-provider.ts +560 -0
  97. package/src/providers/cohere-provider.ts +521 -0
  98. package/src/providers/google-provider.ts +477 -0
  99. package/src/providers/index.ts +21 -0
  100. package/src/providers/ollama-provider.ts +489 -0
  101. package/src/providers/openai-provider.ts +476 -0
  102. package/src/providers/provider-manager.ts +654 -0
  103. package/src/providers/types.ts +531 -0
  104. package/src/providers/utils.ts +376 -0
  105. package/src/services/agentic-flow-hooks/hook-manager.ts +701 -0
  106. package/src/services/agentic-flow-hooks/index.ts +386 -0
  107. package/src/services/agentic-flow-hooks/llm-hooks.ts +557 -0
  108. package/src/services/agentic-flow-hooks/memory-hooks.ts +710 -0
  109. package/src/services/agentic-flow-hooks/neural-hooks.ts +758 -0
  110. package/src/services/agentic-flow-hooks/performance-hooks.ts +827 -0
  111. package/src/services/agentic-flow-hooks/types.ts +503 -0
  112. package/src/services/agentic-flow-hooks/workflow-hooks.ts +1026 -0
@@ -0,0 +1,33 @@
1
+ {
2
+ "agents": {
3
+ "coordinator": {
4
+ "min": 1,
5
+ "max": 3
6
+ },
7
+ "coder": {
8
+ "min": 2,
9
+ "max": 5
10
+ },
11
+ "researcher": {
12
+ "min": 1,
13
+ "max": 3
14
+ },
15
+ "analyst": {
16
+ "min": 1,
17
+ "max": 2
18
+ },
19
+ "tester": {
20
+ "min": 1,
21
+ "max": 2
22
+ }
23
+ },
24
+ "lifecycle": {
25
+ "idleTimeout": 300000,
26
+ "healthCheck": 30000,
27
+ "recycleAfter": 100
28
+ },
29
+ "resources": {
30
+ "maxMemoryPerAgent": 134217728,
31
+ "maxCpuPercent": 10
32
+ }
33
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "connectionPool": {
3
+ "min": 2,
4
+ "max": 10,
5
+ "idleTimeout": 30000
6
+ },
7
+ "writeBatch": {
8
+ "size": 50,
9
+ "flushInterval": 1000
10
+ },
11
+ "readCache": {
12
+ "maxSize": 1000,
13
+ "ttl": 60000
14
+ },
15
+ "compression": {
16
+ "enabled": true,
17
+ "threshold": 1024
18
+ }
19
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "predictionCache": {
3
+ "enabled": true,
4
+ "maxEntries": 10000,
5
+ "ttl": 300000
6
+ },
7
+ "preload": {
8
+ "models": [
9
+ "task_predictor",
10
+ "error_preventer",
11
+ "performance_optimizer"
12
+ ],
13
+ "warmup": true
14
+ },
15
+ "batching": {
16
+ "enabled": true,
17
+ "maxBatchSize": 100,
18
+ "maxWaitTime": 50
19
+ },
20
+ "wasm": {
21
+ "simd": true,
22
+ "threads": 4,
23
+ "memoryPages": 256
24
+ }
25
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "PreToolUse": [
3
+ {
4
+ "matcher": "Bash",
5
+ "hooks": [
6
+ {
7
+ "type": "batch",
8
+ "parallel": true,
9
+ "cache": true,
10
+ "commands": [
11
+ "npx claude-flow@alpha hooks pre-command --batch true",
12
+ "npx claude-flow@alpha memory store --batch true",
13
+ "npx claude-flow@alpha neural predict --cache true"
14
+ ]
15
+ }
16
+ ]
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "tasks": {
3
+ "maxConcurrent": 10,
4
+ "queueSize": 100,
5
+ "priorityLevels": 4
6
+ },
7
+ "fileOps": {
8
+ "readConcurrency": 20,
9
+ "writeConcurrency": 10,
10
+ "usePipelining": true
11
+ },
12
+ "network": {
13
+ "maxSockets": 50,
14
+ "keepAlive": true,
15
+ "timeout": 30000
16
+ },
17
+ "workers": {
18
+ "enabled": true,
19
+ "count": 4,
20
+ "taskTypes": [
21
+ "neural_training",
22
+ "data_processing",
23
+ "analysis"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,270 @@
1
+ {
2
+ "env": {
3
+ "CLAUDE_FLOW_AUTO_COMMIT": "true",
4
+ "CLAUDE_FLOW_AUTO_PUSH": "false",
5
+ "CLAUDE_FLOW_HOOKS_ENABLED": "true",
6
+ "CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
7
+ "CLAUDE_FLOW_REMOTE_EXECUTION": "true",
8
+ "CLAUDE_FLOW_GITHUB_INTEGRATION": "true",
9
+ "CLAUDE_FLOW_CHECKPOINT_ENABLED": "true",
10
+ "CLAUDE_FLOW_MEMORY_PERSISTENCE": "true",
11
+ "CLAUDE_FLOW_NEURAL_OPTIMIZATION": "true",
12
+ "CLAUDE_FLOW_AUTO_LEARNING": "true",
13
+ "CLAUDE_FLOW_PERFORMANCE_MODE": "optimized",
14
+ "CLAUDE_FLOW_CACHE_ENABLED": "true",
15
+ "CLAUDE_FLOW_PARALLEL_PROCESSING": "true",
16
+ "CLAUDE_FLOW_AGENT_POOL": "true"
17
+ },
18
+ "performance": {
19
+ "caching": {
20
+ "hooks": {
21
+ "enabled": true,
22
+ "ttl": 300000,
23
+ "maxSize": 1000
24
+ },
25
+ "neural": {
26
+ "enabled": true,
27
+ "ttl": 300000,
28
+ "maxSize": 10000
29
+ },
30
+ "memory": {
31
+ "enabled": true,
32
+ "ttl": 60000,
33
+ "maxSize": 1000
34
+ }
35
+ },
36
+ "parallelization": {
37
+ "enabled": true,
38
+ "maxConcurrent": 10,
39
+ "workerThreads": 4,
40
+ "taskQueue": {
41
+ "size": 100,
42
+ "priorityLevels": 4
43
+ }
44
+ },
45
+ "batching": {
46
+ "hooks": {
47
+ "enabled": true,
48
+ "size": 10,
49
+ "flushInterval": 100
50
+ },
51
+ "memory": {
52
+ "enabled": true,
53
+ "size": 50,
54
+ "flushInterval": 1000
55
+ },
56
+ "neural": {
57
+ "enabled": true,
58
+ "size": 100,
59
+ "maxWaitTime": 50
60
+ }
61
+ },
62
+ "pooling": {
63
+ "agents": {
64
+ "enabled": true,
65
+ "sizes": {
66
+ "coordinator": { "min": 1, "max": 3 },
67
+ "coder": { "min": 2, "max": 5 },
68
+ "researcher": { "min": 1, "max": 3 },
69
+ "analyst": { "min": 1, "max": 2 },
70
+ "tester": { "min": 1, "max": 2 }
71
+ },
72
+ "idleTimeout": 300000,
73
+ "recycleAfter": 100
74
+ },
75
+ "connections": {
76
+ "database": { "min": 2, "max": 10 },
77
+ "mcp": { "min": 1, "max": 5 }
78
+ }
79
+ }
80
+ },
81
+ "checkpoints": {
82
+ "enabled": true,
83
+ "interval": 300,
84
+ "auto_commit": true,
85
+ "commit_message_prefix": "🔄 Checkpoint:",
86
+ "include_metrics": true,
87
+ "branch_strategy": "checkpoint/{timestamp}",
88
+ "max_checkpoints": 20
89
+ },
90
+ "memory": {
91
+ "auto_persist": true,
92
+ "compression": true,
93
+ "sync_interval": 60,
94
+ "namespaces": ["swarm", "tasks", "patterns", "errors", "optimizations"],
95
+ "retention_days": 30,
96
+ "backup_to_github": true,
97
+ "optimization": {
98
+ "writeBatch": true,
99
+ "readCache": true,
100
+ "compressionThreshold": 1024
101
+ }
102
+ },
103
+ "neural": {
104
+ "auto_optimize": true,
105
+ "optimization_triggers": ["error", "success", "pattern", "performance"],
106
+ "models": {
107
+ "task_predictor": {
108
+ "enabled": true,
109
+ "learning_rate": 0.001,
110
+ "update_frequency": 100,
111
+ "preload": true,
112
+ "cache": true
113
+ },
114
+ "error_preventer": {
115
+ "enabled": true,
116
+ "threshold": 0.85,
117
+ "block_risky_operations": true,
118
+ "preload": true,
119
+ "cache": true
120
+ },
121
+ "performance_optimizer": {
122
+ "enabled": true,
123
+ "target_metrics": ["speed", "accuracy", "efficiency"],
124
+ "auto_tune": true,
125
+ "preload": true,
126
+ "cache": true
127
+ }
128
+ },
129
+ "wasm": {
130
+ "enabled": true,
131
+ "simd": true,
132
+ "threads": 4,
133
+ "memoryPages": 256
134
+ }
135
+ },
136
+ "permissions": {
137
+ "allow": [
138
+ "Bash(npx claude-flow *)",
139
+ "Bash(npm run lint)",
140
+ "Bash(npm run test:*)",
141
+ "Bash(npm test *)",
142
+ "Bash(git status)",
143
+ "Bash(git diff *)",
144
+ "Bash(git log *)",
145
+ "Bash(git add *)",
146
+ "Bash(git commit *)",
147
+ "Bash(git push)",
148
+ "Bash(git config *)",
149
+ "Bash(gh *)",
150
+ "Bash(node *)",
151
+ "Bash(which *)",
152
+ "Bash(pwd)",
153
+ "Bash(ls *)"
154
+ ],
155
+ "deny": [
156
+ "Bash(rm -rf /)",
157
+ "Bash(curl * | bash)",
158
+ "Bash(wget * | sh)",
159
+ "Bash(eval *)"
160
+ ]
161
+ },
162
+ "hooks": {
163
+ "_optimization": {
164
+ "batch": true,
165
+ "parallel": true,
166
+ "cache": true,
167
+ "deduplicate": true
168
+ },
169
+ "PreToolUse": [
170
+ {
171
+ "matcher": "Bash",
172
+ "batch": true,
173
+ "parallel": true,
174
+ "hooks": [
175
+ {
176
+ "type": "command",
177
+ "command": "npx claude-flow@alpha hooks pre-command --command \"$CLAUDE_COMMAND\" --validate-safety true --prepare-resources true --predict-outcome true --check-patterns true --batch true --cache true"
178
+ },
179
+ {
180
+ "type": "command",
181
+ "command": "npx claude-flow@alpha memory store --key \"command/pre/$CLAUDE_TIMESTAMP\" --value \"$CLAUDE_COMMAND\" --namespace \"commands\" --batch true"
182
+ },
183
+ {
184
+ "type": "command",
185
+ "command": "npx claude-flow@alpha neural predict --model \"error_preventer\" --input \"$CLAUDE_COMMAND\" --block-if-risky true --cache true"
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "matcher": "Write|Edit|MultiEdit",
191
+ "batch": true,
192
+ "parallel": true,
193
+ "hooks": [
194
+ {
195
+ "type": "command",
196
+ "command": "npx claude-flow@alpha hooks pre-edit --file \"$CLAUDE_EDITED_FILE\" --auto-assign-agents true --load-context true --analyze-impact true --batch true --cache true"
197
+ },
198
+ {
199
+ "type": "command",
200
+ "command": "npx claude-flow@alpha memory store --key \"edit/pre/$CLAUDE_EDITED_FILE\" --value \"$CLAUDE_OPERATION_CONTEXT\" --namespace \"edits\" --batch true"
201
+ },
202
+ {
203
+ "type": "command",
204
+ "command": "npx claude-flow@alpha neural optimize --operation \"file-edit\" --target \"$CLAUDE_EDITED_FILE\" --suggest-improvements true --cache true"
205
+ }
206
+ ]
207
+ }
208
+ ],
209
+ "PostToolUse": [
210
+ {
211
+ "matcher": "Bash",
212
+ "batch": true,
213
+ "parallel": true,
214
+ "hooks": [
215
+ {
216
+ "type": "command",
217
+ "command": "npx claude-flow@alpha hooks post-command --command \"$CLAUDE_COMMAND\" --track-metrics true --store-results true --analyze-performance true --batch true"
218
+ },
219
+ {
220
+ "type": "command",
221
+ "command": "npx claude-flow@alpha memory store --key \"command/post/$CLAUDE_TIMESTAMP\" --value \"{\\\"command\\\": \\\"$CLAUDE_COMMAND\\\", \\\"result\\\": \\\"$CLAUDE_RESULT\\\", \\\"duration\\\": $CLAUDE_DURATION}\" --namespace \"commands\" --batch true"
222
+ },
223
+ {
224
+ "type": "command",
225
+ "command": "npx claude-flow@alpha neural train --model \"performance_optimizer\" --data \"{\\\"operation\\\": \\\"bash\\\", \\\"duration\\\": $CLAUDE_DURATION, \\\"success\\\": $CLAUDE_SUCCESS}\" --batch true"
226
+ }
227
+ ]
228
+ }
229
+ ],
230
+ "Stop": [
231
+ {
232
+ "hooks": [
233
+ {
234
+ "type": "command",
235
+ "command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true --backup-memory true --optimize-models true"
236
+ }
237
+ ]
238
+ }
239
+ ]
240
+ },
241
+ "github": {
242
+ "checkpoint_branch": "checkpoints",
243
+ "memory_backup_gists": true,
244
+ "auto_issue_on_error": true,
245
+ "pr_on_major_improvement": true,
246
+ "sync_learnings": true
247
+ },
248
+ "optimization": {
249
+ "continuous_improvement": true,
250
+ "performance_targets": {
251
+ "command_execution": "< 100ms overhead",
252
+ "memory_operations": "< 20ms",
253
+ "neural_predictions": "< 10ms",
254
+ "hook_execution": "< 50ms",
255
+ "agent_spawn": "< 100ms"
256
+ },
257
+ "auto_tune_parameters": true,
258
+ "share_anonymized_patterns": true,
259
+ "monitoring": {
260
+ "enabled": true,
261
+ "metrics": ["latency", "throughput", "errors", "cache_hits"],
262
+ "alert_thresholds": {
263
+ "latency": 200,
264
+ "error_rate": 0.05
265
+ }
266
+ }
267
+ },
268
+ "includeCoAuthoredBy": true,
269
+ "enabledMcpjsonServers": ["claude-flow", "ruv-swarm"]
270
+ }
@@ -0,0 +1,186 @@
1
+ {
2
+ "env": {
3
+ "CLAUDE_FLOW_AUTO_COMMIT": "true",
4
+ "CLAUDE_FLOW_AUTO_PUSH": "false",
5
+ "CLAUDE_FLOW_HOOKS_ENABLED": "true",
6
+ "CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
7
+ "CLAUDE_FLOW_REMOTE_EXECUTION": "true",
8
+ "CLAUDE_FLOW_GITHUB_INTEGRATION": "true",
9
+ "CLAUDE_FLOW_CHECKPOINT_ENABLED": "true",
10
+ "CLAUDE_FLOW_MEMORY_PERSISTENCE": "true",
11
+ "CLAUDE_FLOW_NEURAL_OPTIMIZATION": "true",
12
+ "CLAUDE_FLOW_AUTO_LEARNING": "true"
13
+ },
14
+ "permissions": {
15
+ "allow": [
16
+ "Bash(npx claude-flow *)",
17
+ "Bash(npm run lint)",
18
+ "Bash(npm run test:*)",
19
+ "Bash(npm test *)",
20
+ "Bash(git status)",
21
+ "Bash(git diff *)",
22
+ "Bash(git log *)",
23
+ "Bash(git add *)",
24
+ "Bash(git commit *)",
25
+ "Bash(git push)",
26
+ "Bash(git config *)",
27
+ "Bash(gh *)",
28
+ "Bash(node *)",
29
+ "Bash(which *)",
30
+ "Bash(pwd)",
31
+ "Bash(ls *)"
32
+ ],
33
+ "deny": [
34
+ "Bash(rm -rf /)",
35
+ "Bash(curl * | bash)",
36
+ "Bash(wget * | sh)",
37
+ "Bash(eval *)"
38
+ ]
39
+ },
40
+ "hooks": {
41
+ "PreToolUse": [
42
+ {
43
+ "matcher": "Bash",
44
+ "hooks": [
45
+ {
46
+ "type": "command",
47
+ "command": "npx claude-flow@alpha hooks pre-command --command \"$CLAUDE_COMMAND\" --validate-safety true --prepare-resources true --predict-outcome true --check-patterns true"
48
+ },
49
+ {
50
+ "type": "command",
51
+ "command": "npx claude-flow@alpha memory store --key \"command/pre/$CLAUDE_TIMESTAMP\" --value \"$CLAUDE_COMMAND\" --namespace \"commands\""
52
+ },
53
+ {
54
+ "type": "command",
55
+ "command": "npx claude-flow@alpha neural predict --model \"error_preventer\" --input \"$CLAUDE_COMMAND\" --block-if-risky true"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "matcher": "Write|Edit|MultiEdit",
61
+ "hooks": [
62
+ {
63
+ "type": "command",
64
+ "command": "npx claude-flow@alpha hooks pre-edit --file \"$CLAUDE_EDITED_FILE\" --auto-assign-agents true --load-context true --analyze-impact true"
65
+ },
66
+ {
67
+ "type": "command",
68
+ "command": "npx claude-flow@alpha memory store --key \"edit/pre/$CLAUDE_EDITED_FILE\" --value \"$CLAUDE_OPERATION_CONTEXT\" --namespace \"edits\""
69
+ },
70
+ {
71
+ "type": "command",
72
+ "command": "npx claude-flow@alpha neural optimize --operation \"file-edit\" --target \"$CLAUDE_EDITED_FILE\" --suggest-improvements true"
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ "matcher": "TodoWrite",
78
+ "hooks": [
79
+ {
80
+ "type": "command",
81
+ "command": "npx claude-flow@alpha memory store --key \"todos/$CLAUDE_TIMESTAMP\" --value \"$CLAUDE_TODOS\" --namespace \"tasks\""
82
+ },
83
+ {
84
+ "type": "command",
85
+ "command": "npx claude-flow@alpha neural predict --model \"task_predictor\" --input \"$CLAUDE_TODOS\" --optimize-order true"
86
+ }
87
+ ]
88
+ }
89
+ ],
90
+ "PostToolUse": [
91
+ {
92
+ "matcher": "Bash",
93
+ "hooks": [
94
+ {
95
+ "type": "command",
96
+ "command": "npx claude-flow@alpha hooks post-command --command \"$CLAUDE_COMMAND\" --track-metrics true --store-results true --analyze-performance true"
97
+ },
98
+ {
99
+ "type": "command",
100
+ "command": "npx claude-flow@alpha memory store --key \"command/post/$CLAUDE_TIMESTAMP\" --value \"{\\\"command\\\": \\\"$CLAUDE_COMMAND\\\", \\\"result\\\": \\\"$CLAUDE_RESULT\\\", \\\"duration\\\": $CLAUDE_DURATION}\" --namespace \"commands\""
101
+ },
102
+ {
103
+ "type": "command",
104
+ "command": "npx claude-flow@alpha neural train --model \"performance_optimizer\" --data \"{\\\"operation\\\": \\\"bash\\\", \\\"duration\\\": $CLAUDE_DURATION, \\\"success\\\": $CLAUDE_SUCCESS}\""
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "matcher": "Write|Edit|MultiEdit",
110
+ "hooks": [
111
+ {
112
+ "type": "command",
113
+ "command": "npx claude-flow@alpha hooks post-edit --file \"$CLAUDE_EDITED_FILE\" --format true --update-memory true --train-neural true --analyze-quality true"
114
+ },
115
+ {
116
+ "type": "command",
117
+ "command": "npx claude-flow@alpha memory store --key \"edit/post/$CLAUDE_EDITED_FILE\" --value \"{\\\"changes\\\": $CLAUDE_CHANGES, \\\"quality_score\\\": $CLAUDE_QUALITY_SCORE}\" --namespace \"edits\""
118
+ },
119
+ {
120
+ "type": "command",
121
+ "command": "npx claude-flow@alpha neural train --model \"task_predictor\" --data \"{\\\"file_type\\\": \\\"$CLAUDE_FILE_TYPE\\\", \\\"operation\\\": \\\"$CLAUDE_OPERATION\\\", \\\"success\\\": true}\""
122
+ },
123
+ {
124
+ "type": "command",
125
+ "command": "test $CLAUDE_CHECKPOINT_DUE = true && git add -A && git commit -m \"🔄 Checkpoint: $CLAUDE_EDITED_FILE edited\" || true"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "matcher": "Task",
131
+ "hooks": [
132
+ {
133
+ "type": "command",
134
+ "command": "npx claude-flow@alpha memory store --key \"task/complete/$CLAUDE_TASK_ID\" --value \"{\\\"task\\\": \\\"$CLAUDE_TASK\\\", \\\"agent\\\": \\\"$CLAUDE_AGENT\\\", \\\"result\\\": \\\"$CLAUDE_RESULT\\\"}\" --namespace \"tasks\""
135
+ },
136
+ {
137
+ "type": "command",
138
+ "command": "npx claude-flow@alpha neural train --model \"task_predictor\" --data \"{\\\"task_type\\\": \\\"$CLAUDE_TASK_TYPE\\\", \\\"agent_type\\\": \\\"$CLAUDE_AGENT_TYPE\\\", \\\"performance\\\": $CLAUDE_PERFORMANCE}\""
139
+ }
140
+ ]
141
+ }
142
+ ],
143
+ "Stop": [
144
+ {
145
+ "hooks": [
146
+ {
147
+ "type": "command",
148
+ "command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true --backup-memory true"
149
+ },
150
+ {
151
+ "type": "command",
152
+ "command": "npx claude-flow@alpha memory backup --namespace \"all\" --destination \".claude/memory-backup-$CLAUDE_SESSION_ID.json\""
153
+ },
154
+ {
155
+ "type": "command",
156
+ "command": "npx claude-flow@alpha neural train --model \"all\" --data \"session\" --comprehensive true"
157
+ },
158
+ {
159
+ "type": "command",
160
+ "command": "git add .claude/memory-backup-*.json && git commit -m \"🧠 Session memory backup: $CLAUDE_SESSION_ID\" || true"
161
+ },
162
+ {
163
+ "type": "command",
164
+ "command": "npx claude-flow@alpha github create-gist --name \"session-learnings-$CLAUDE_SESSION_ID\" --content \"$CLAUDE_SESSION_LEARNINGS\" --private true || true"
165
+ }
166
+ ]
167
+ }
168
+ ],
169
+ "UserPromptSubmit": [
170
+ {
171
+ "hooks": [
172
+ {
173
+ "type": "command",
174
+ "command": "npx claude-flow@alpha memory store --key \"prompt/$CLAUDE_TIMESTAMP\" --value \"$CLAUDE_PROMPT\" --namespace \"prompts\""
175
+ },
176
+ {
177
+ "type": "command",
178
+ "command": "npx claude-flow@alpha neural analyze --prompt \"$CLAUDE_PROMPT\" --suggest-approach true --predict-complexity true"
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ },
184
+ "includeCoAuthoredBy": true,
185
+ "enabledMcpjsonServers": ["claude-flow", "ruv-swarm"]
186
+ }