From 0f146e2a7330389f36a61c5c0a64090dd16837e4 Mon Sep 17 00:00:00 2001 From: bendrucker Date: Mon, 12 Jan 2026 15:45:35 -0800 Subject: [PATCH 1/2] Move hooks to repo root for Claude Code discovery Claude Code expects hooks at /hooks/hooks.json, not inside .claude-plugin/. This was causing hooks to silently fail to load. Also adds integration test script for verifying hook functionality. --- .claude-plugin/plugin.json | 3 +-- CLAUDE.md | 3 ++- .claude-plugin/hook.ts => hook.ts | 0 {.claude-plugin/hooks => hooks}/hooks.json | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename .claude-plugin/hook.ts => hook.ts (100%) rename {.claude-plugin/hooks => hooks}/hooks.json (100%) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 49f1174..e90d6ca 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -8,6 +8,5 @@ }, "repository": "https://github.com/bendrucker/claude-code-agents-md", "license": "MIT", - "keywords": ["agents", "agents-md", "instructions"], - "hooks": "./hooks/hooks.json" + "keywords": ["agents", "agents-md", "instructions"] } diff --git a/CLAUDE.md b/CLAUDE.md index e192365..740b224 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,7 +26,8 @@ Claude Code plugin that loads `AGENTS.md` files using hooks. - `hook.ts`: Hook script that finds and reads `AGENTS.md` - Use only eraseable TypeScript syntax to allow execution via `node` -- `plugin.json`: Plugin manifest declaring the hook +- `hooks/hooks.json`: Hook registration +- `.claude-plugin/plugin.json`: Plugin manifest ## References diff --git a/.claude-plugin/hook.ts b/hook.ts similarity index 100% rename from .claude-plugin/hook.ts rename to hook.ts diff --git a/.claude-plugin/hooks/hooks.json b/hooks/hooks.json similarity index 100% rename from .claude-plugin/hooks/hooks.json rename to hooks/hooks.json From 96a13a968af52cbabc278824ea532ef3645cd552 Mon Sep 17 00:00:00 2001 From: bendrucker Date: Mon, 12 Jan 2026 15:52:51 -0800 Subject: [PATCH 2/2] Fix test plugin path after hooks relocation --- test/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run.ts b/test/run.ts index 7b9ffab..f4f002b 100644 --- a/test/run.ts +++ b/test/run.ts @@ -5,7 +5,7 @@ import { runTest, getAssistantResponse } from './harness.ts'; import { assertResponseContains, assertToolUsed } from './assertions.ts'; const FIXTURES_DIR = path.join(import.meta.dirname, 'fixtures'); -const PLUGIN_PATH = path.join(import.meta.dirname, '..', '.claude-plugin'); +const PLUGIN_PATH = path.join(import.meta.dirname, '..'); describe('AGENTS.md Plugin', () => { it('injects AGENTS.md content at session start', async () => {