diff --git a/src/services/hooks/__tests__/HookMatcher.spec.ts b/src/services/hooks/__tests__/HookMatcher.spec.ts index 004857366a..caca0a9a24 100644 --- a/src/services/hooks/__tests__/HookMatcher.spec.ts +++ b/src/services/hooks/__tests__/HookMatcher.spec.ts @@ -189,6 +189,14 @@ describe("HookMatcher", () => { const matching = filterMatchingHooks(hooks, "Write") expect(matching).toHaveLength(0) }) + + it("should NOT treat Claude Code-style tool labels as Roo Code internal tool ids", () => { + // Roo Code hook matching is against tool ids like write_to_file/apply_diff. + // A Claude Code-style matcher like Write|Edit should not match apply_diff. + const hooks = [createMockHook("hook1", "Write|Edit")] + const matching = filterMatchingHooks(hooks, "apply_diff") + expect(matching).toHaveLength(0) + }) }) describe("hookMatchesTool", () => { diff --git a/webview-ui/src/components/settings/HooksSettings.tsx b/webview-ui/src/components/settings/HooksSettings.tsx index fee595d2af..63b229a45c 100644 --- a/webview-ui/src/components/settings/HooksSettings.tsx +++ b/webview-ui/src/components/settings/HooksSettings.tsx @@ -127,7 +127,21 @@ export const HooksSettings: React.FC = () => { )} {/* Note about edits requiring reload */} -
{t("settings:hooks.matcherExamples.writeOrEdit")}
+ {t("settings:hooks.matcherExamples.readOnly")}
+