Avoid Gemini loading Claude hook events (#139)

This commit is contained in:
Sonai Biswas
2026-06-19 00:24:43 +02:00
committed by GitHub
parent 0ac987f995
commit 4dad14fac5
7 changed files with 31 additions and 5 deletions
+12 -1
View File
@@ -11,7 +11,11 @@ const fs = require('fs');
const path = require('path');
const root = path.join(__dirname, '..');
const HOOKS_JSON = 'hooks/hooks.json';
const HOOKS_JSON = 'hooks/claude-codex-hooks.json';
const HOST_PLUGIN_MANIFESTS = [
'.claude-plugin/plugin.json',
'.codex-plugin/plugin.json',
];
// cmd.exe variable syntax (%FOO%); PowerShell leaves it literal, breaking the path.
const CMD_VAR_SYNTAX = /%[A-Za-z_][A-Za-z0-9_]*%/;
// Pull the hooks/<script> a command launches, so we can check it exists.
@@ -46,3 +50,10 @@ test('every hook command points at a script that ships in hooks/', () => {
}
}
});
test('Claude and Codex manifests point at the shared host-specific hook config', () => {
for (const rel of HOST_PLUGIN_MANIFESTS) {
const manifest = JSON.parse(fs.readFileSync(path.join(root, rel), 'utf8'));
assert.equal(manifest.hooks, `./${HOOKS_JSON}`, `${rel} must not rely on root hooks auto-discovery`);
}
});