Skip to content

Register the SessionStart hook in the plugin manifest - #82

Open
ZackCS1997 wants to merge 1 commit into
ayghri:mainfrom
ZackCS1997:fix/register-sessionstart-hook
Open

Register the SessionStart hook in the plugin manifest#82
ZackCS1997 wants to merge 1 commit into
ayghri:mainfrom
ZackCS1997:fix/register-sessionstart-hook

Conversation

@ZackCS1997

Copy link
Copy Markdown

Problem

Always-on mode never activates. hooks/hooks.json correctly defines the SessionStart hook that runs hooks/always-on.sh, but Claude Code only loads a plugin's hooks file when the manifest points at it. .claude-plugin/plugin.json has no hooks key, so the file is never read.

The failure is silent: the opt-in flag is set, the script is correct, and nothing happens.

Fix

One line in .claude-plugin/plugin.json:

"hooks": "./hooks/hooks.json"

Verification

On Windows 11 / Claude Code, with ~/.claude/.i-have-adhd-always present:

  • Before: no ADHD ruleset in the session-start context.
  • sh hooks/always-on.sh run directly: exit 0, emits the full ruleset (~6.6 KB) — so the script and the flag were both fine.
  • After adding the hooks key to the installed plugin's manifest: the ruleset is injected at session start as intended.

🤖 Generated with Claude Code

hooks/hooks.json defines the SessionStart hook that injects the ruleset
when ~/.claude/.i-have-adhd-always exists, but Claude Code only loads a
plugin hooks file that the manifest points at. Without the "hooks" key,
the file is never read and always-on mode silently never fires: the flag
is set, the script is correct, and nothing happens.

Verified by running hooks/always-on.sh directly (exits 0, emits the full
ruleset) while no ADHD ruleset appeared at session start.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant