π 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
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
π§ Align hooks.json format with .claude/settings.json
rUv2cf69b9c1c77
diff --git a/.claude-plugin/hooks/hooks.json b/.claude-plugin/hooks/hooks.jsonindex 4a4754d065..519bf22a86 100644--- a/.claude-plugin/hooks/hooks.json+++ b/.claude-plugin/hooks/hooks.json@@ -2,114 +2,70 @@"hooks": {"PreToolUse": [{- "matcher": "Task",+ "matcher": "Bash","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks pre-task --description '${TOOL_DESCRIPTION}'",- "description": "Prepare coordination before spawning agents"+ "command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"}]},{- "matcher": "Write|Edit",+ "matcher": "Write|Edit|MultiEdit","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks pre-edit --file '${FILE_PATH}'",- "description": "Setup agent coordination before file modifications"+ "command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"}]}],"PostToolUse": [- {- "matcher": "Task",- "hooks": [- {- "type": "command",- "command": "npx claude-flow@alpha hooks post-task --task-id '${TASK_ID}'",- "description": "Store task completion metrics and learnings"- }- ]- },- {- "matcher": "Write|Edit",- "hooks": [- {- "type": "command",- "command": "npx claude-flow@alpha hooks post-edit --file '${FILE_PATH}' --memory-key 'swarm/${AGENT_ID}/${STEP_ID}'",- "description": "Format code and update neural patterns"- }- ]- },{"matcher": "Bash","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks notify --message 'Command executed: ${COMMAND}'",- "description": "Log bash command execution"+ "command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true"}]- }- ],- "UserPromptSubmit": [- {- "matcher": ".*",- "hooks": [- {- "type": "command",- "command": "npx claude-flow@alpha hooks session-restore --session-id 'swarm-${SESSION_ID}'",- "description": "Restore swarm context from previous session"- }- ]- }- ],- "SessionStart": [+ },{- "matcher": ".*",+ "matcher": "Write|Edit|MultiEdit","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks session-start --enable-memory true",- "description": "Initialize coordination system and restore context"+ "command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true"}]}],- "SessionEnd": [+ "PreCompact": [{- "matcher": ".*",+ "matcher": "manual","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks session-end --export-metrics true",- "description": "Persist state, export metrics, and train neural patterns"+ "command": "/bin/bash -c 'INPUT=$(cat); CUSTOM=$(echo \"$INPUT\" | jq -r \".custom_instructions // \\\"\\\"\"); echo \"π PreCompact Guidance:\"; echo \"π IMPORTANT: Review CLAUDE.md in project root for:\"; echo \" β’ 54 available agents and concurrent usage patterns\"; echo \" β’ Swarm coordination strategies (hierarchical, mesh, adaptive)\"; echo \" β’ SPARC methodology workflows with batchtools optimization\"; echo \" β’ Critical concurrent execution rules (GOLDEN RULE: 1 MESSAGE = ALL OPERATIONS)\"; if [ -n \"$CUSTOM\" ]; then echo \"π― Custom compact instructions: $CUSTOM\"; fi; echo \"β Ready for compact operation\"'"}]- }- ],- "Notification": [+ },{- "matcher": "error|warning",+ "matcher": "auto","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks error-log --level '${LEVEL}' --message '${MESSAGE}'",- "description": "Log errors and warnings for pattern analysis"+ "command": "/bin/bash -c 'echo \"π Auto-Compact Guidance (Context Window Full):\"; echo \"π CRITICAL: Before compacting, ensure you understand:\"; echo \" β’ All 54 agents available in .claude/agents/ directory\"; echo \" β’ Concurrent execution patterns from CLAUDE.md\"; echo \" β’ Batchtools optimization for 300% performance gains\"; echo \" β’ Swarm coordination strategies for complex tasks\"; echo \"β‘ Apply GOLDEN RULE: Always batch operations in single messages\"; echo \"β Auto-compact proceeding with full agent context\"'"}]}],- "SubagentStop": [+ "Stop": [{- "matcher": ".*","hooks": [{"type": "command",- "command": "npx claude-flow@alpha hooks agent-cleanup --agent-id '${AGENT_ID}'",- "description": "Clean up agent resources and store completion status"+ "command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true"}]}