From 0c7deb26a344db095c04a213eba5634d4ccce030 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sun, 22 Mar 2026 18:39:56 -0400 Subject: [PATCH] perf(hooks): move post-edit-format and post-edit-typecheck to strict-only (#757) * perf(hooks): move post-edit-format and post-edit-typecheck to strict-only These hooks fire synchronously on every Edit call with 15-30s timeouts each. During multi-file refactors this adds 5-10 minutes of overhead. Moving them from standard,strict to strict-only means they won't fire in the default profile but are still available for users who want the extra validation. Fixes #735 * Also update OpenCode plugin to strict-only for format/typecheck The OpenCode plugin had the same standard,strict profile for post:edit:format and post:edit:typecheck, so OpenCode users on the default profile would still get the per-edit overhead. --- .opencode/plugins/ecc-hooks.ts | 4 ++-- hooks/hooks.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.opencode/plugins/ecc-hooks.ts b/.opencode/plugins/ecc-hooks.ts index 30533147..9193bb41 100644 --- a/.opencode/plugins/ecc-hooks.ts +++ b/.opencode/plugins/ecc-hooks.ts @@ -77,7 +77,7 @@ export const ECCHooksPlugin = async ({ editedFiles.add(event.path) // Auto-format JS/TS files - if (hookEnabled("post:edit:format", ["standard", "strict"]) && event.path.match(/\.(ts|tsx|js|jsx)$/)) { + if (hookEnabled("post:edit:format", ["strict"]) && event.path.match(/\.(ts|tsx|js|jsx)$/)) { try { await $`prettier --write ${event.path} 2>/dev/null` log("info", `[ECC] Formatted: ${event.path}`) @@ -116,7 +116,7 @@ export const ECCHooksPlugin = async ({ ) => { // Check if a TypeScript file was edited if ( - hookEnabled("post:edit:typecheck", ["standard", "strict"]) && + hookEnabled("post:edit:typecheck", ["strict"]) && input.tool === "edit" && input.args?.filePath?.match(/\.tsx?$/) ) { diff --git a/hooks/hooks.json b/hooks/hooks.json index b44e6bf0..2b38e94f 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -182,7 +182,7 @@ "hooks": [ { "type": "command", - "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"post:edit:format\" \"scripts/hooks/post-edit-format.js\" \"standard,strict\"" + "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"post:edit:format\" \"scripts/hooks/post-edit-format.js\" \"strict\"" } ], "description": "Auto-format JS/TS files after edits (auto-detects Biome or Prettier)" @@ -192,7 +192,7 @@ "hooks": [ { "type": "command", - "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"post:edit:typecheck\" \"scripts/hooks/post-edit-typecheck.js\" \"standard,strict\"" + "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"post:edit:typecheck\" \"scripts/hooks/post-edit-typecheck.js\" \"strict\"" } ], "description": "TypeScript check after editing .ts/.tsx files"