[JQ_VALIDATION] Hook triggered at Mon Jul 14 21:56:09 UTC 2025 [JQ_VALIDATION] Raw input: {"session_id":"c32082bb-89a7-445f-afa8-fd02d592b88e","transcript_path":"/home/codespace/.claude/projects/-workspaces-claude-code-flow/c32082bb-89a7-445f-afa8-fd02d592b88e.jsonl","hook_event_name":"PostToolUse","tool_name":"Edit","tool_input":{"file_path":"/workspaces/claude-code-flow/src/cli/simple-commands/init/templates/enhanced-templates.js","old_string":" command: \"npx claude-flow@alpha hooks pre-command --command \\\"${command}\\\" --validate-safety true --prepare-resources true\"","new_string":" command: \"cat | jq -r '.tool_input.command // \\\"\\\"' | xargs -I {} npx claude-flow@alpha hooks pre-command --command \\\"{}\\\" --validate-safety true --prepare-resources true\""},"tool_response":{"filePath":"/workspaces/claude-code-flow/src/cli/simple-commands/init/templates/enhanced-templates.js","oldString":" command: \"npx claude-flow@alpha hooks pre-command --command \\\"${command}\\\" --validate-safety true --prepare-resources true\"","newString":" command: \"cat | jq -r '.tool_input.command // \\\"\\\"' | xargs -I {} npx claude-flow@alpha hooks pre-command --command \\\"{}\\\" --validate-safety true --prepare-resources true\"","originalFile":"// enhanced-templates.js - Generate Claude Flow v2.0.0 enhanced templates\nimport { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// Load template files\nconst loadTemplate = (filename) => {\n try {\n return readFileSync(join(__dirname, filename), 'utf8');\n } catch (error) {\n // Silently fall back to hardcoded templates if files not found\n // This handles npm packaging scenarios where template files may not be included\n return null;\n }\n};\n\nexport function createEnhancedClaudeMd() {\n const template = loadTemplate('CLAUDE.md');\n if (!template) {\n // Fallback to hardcoded if template file not found\n return createEnhancedClaudeMdFallback();\n }\n return template;\n}\n\nexport function createEnhancedSettingsJson() {\n const template = loadTemplate('settings.json');\n if (!template) {\n return createEnhancedSettingsJsonFallback();\n }\n return template;\n}\n\nexport function createWrapperScript(type = 'unix') {\n // For unix, use the universal wrapper that works in both CommonJS and ES modules\n if (type === 'unix') {\n const universalTemplate = loadTemplate('claude-flow-universal');\n if (universalTemplate) {\n return universalTemplate;\n }\n }\n \n const filename = type === 'unix' ? 'claude-flow' : \n type === 'windows' ? 'claude-flow.bat' : \n 'claude-flow.ps1';\n \n const template = loadTemplate(filename);\n if (!template) {\n return createWrapperScriptFallback(type);\n }\n return template;\n}\n\nexport function createCommandDoc(category, command) {\n const template = loadTemplate(`commands/${category}/${command}.md`);\n if (!template) {\n // Silently fall back to generated documentation\n return createCommandDocFallback(category, command);\n }\n return template;\n}\n\n// Generate command documentation fallbacks\nfunction createCommandDocFallback(category, command) {\n const docs = {\n analysis: {\n 'bottleneck-detect': `# bottleneck-detect\n\nAutomatically detect performance bottlenecks in your swarm operations.\n\n## Usage\n\\`\\`\\`bash\nnpx claude-flow analysis bottleneck-detect [options]\n\\`\\`\\`\n\n## Options\n- \\`--swarm-id \\` - Target specific swarm\n- \\`--threshold \\` - Performance threshold (default: 1000ms)\n- \\`--export \\` - Export results to file\n\n## Examples\n\\`\\`\\`bash\n# Detect bottlenecks in current swarm\nnpx claude-flow analysis bottleneck-detect\n\n# Set custom threshold\nnpx claude-flow analysis bottleneck-detect --threshold 500\n\n# Export results\nnpx claude-flow analysis bottleneck-detect --export bottlenecks.json\n\\`\\`\\`\n`,\n 'token-usage': `# token-usage\n\nAnalyze token usage patterns and optimize for efficiency.\n\n## Usage\n\\`\\`\\`bash\nnpx claude-flow analysis token-usage [options]\n\\`\\`\\`\n\n## Options\n- \\`--period