From 31631d0804c3f8a1a7fe72eecfc96ccb76ad6194 Mon Sep 17 00:00:00 2001 From: rUv Date: Thu, 8 Jan 2026 03:56:25 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-08T03:56:25Z - Changes: 3 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- v3/@claude-flow/cli/package.json | 2 +- .../cli/src/init/settings-generator.ts | 22 ++++++++++++++----- v3/package-lock.json | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json index 98248ca93f..9e697be20e 100644 --- a/v3/@claude-flow/cli/package.json +++ b/v3/@claude-flow/cli/package.json @@ -1,6 +1,6 @@ { "name": "@claude-flow/cli", - "version": "3.0.0-alpha.43", + "version": "3.0.0-alpha.44", "type": "module", "description": "CLI module - command parsing, prompts, output formatting", "main": "dist/src/index.js", diff --git a/v3/@claude-flow/cli/src/init/settings-generator.ts b/v3/@claude-flow/cli/src/init/settings-generator.ts index b4c53bc093..8f4cdc75c1 100644 --- a/v3/@claude-flow/cli/src/init/settings-generator.ts +++ b/v3/@claude-flow/cli/src/init/settings-generator.ts @@ -96,25 +96,25 @@ function generateHooksConfig(config: HooksConfig): object { // PreToolUse hooks if (config.preToolUse) { hooks.PreToolUse = [ - // File edit hooks + // File edit hooks with intelligence routing { matcher: '^(Write|Edit|MultiEdit)$', hooks: [ { type: 'command', - command: 'if [ -n "$TOOL_INPUT_file_path" ]; then npx claude-flow@v3alpha hooks pre-edit --file "$TOOL_INPUT_file_path" 2>/dev/null; fi; exit 0', + command: 'npx @claude-flow/cli@latest hooks pre-edit --file "$TOOL_INPUT_file_path" --intelligence 2>/dev/null || true', timeout: config.timeout, continueOnError: config.continueOnError, }, ], }, - // Bash command hooks + // Bash command hooks with safety validation { matcher: '^Bash$', hooks: [ { type: 'command', - command: 'if [ -n "$TOOL_INPUT_command" ]; then npx claude-flow@v3alpha hooks pre-command --command "$TOOL_INPUT_command" 2>/dev/null; fi; exit 0', + command: 'npx @claude-flow/cli@latest hooks pre-command --command "$TOOL_INPUT_command" --validate-safety 2>/dev/null || true', timeout: config.timeout, continueOnError: config.continueOnError, }, @@ -126,12 +126,24 @@ function generateHooksConfig(config: HooksConfig): object { hooks: [ { type: 'command', - command: 'if [ -n "$TOOL_INPUT_prompt" ]; then npx claude-flow@v3alpha hooks pre-task --task-id "task-$(date +%s)" --description "$TOOL_INPUT_prompt" 2>/dev/null; fi; exit 0', + command: 'npx @claude-flow/cli@latest hooks pre-task --task-id "task-$(date +%s)" --description "$TOOL_INPUT_prompt" 2>/dev/null || true', timeout: config.timeout, continueOnError: config.continueOnError, }, ], }, + // Search hooks for pattern caching + { + matcher: '^(Grep|Glob|Read)$', + hooks: [ + { + type: 'command', + command: 'npx @claude-flow/cli@latest hooks pre-search --pattern "$TOOL_INPUT_pattern" 2>/dev/null || true', + timeout: 2000, + continueOnError: config.continueOnError, + }, + ], + }, ]; } diff --git a/v3/package-lock.json b/v3/package-lock.json index 9511a679a1..0a6d3c7dd6 100644 --- a/v3/package-lock.json +++ b/v3/package-lock.json @@ -124,7 +124,7 @@ } }, "@claude-flow/cli": { - "version": "3.0.0-alpha.43", + "version": "3.0.0-alpha.44", "dependencies": { "@claude-flow/shared": "^3.0.0-alpha.1" },