fix: register hyperstack as Claude Code plugin during setup#100
Merged
KailasMahavarkar merged 1 commit intomainfrom Apr 22, 2026
Merged
fix: register hyperstack as Claude Code plugin during setup#100KailasMahavarkar merged 1 commit intomainfrom
KailasMahavarkar merged 1 commit intomainfrom
Conversation
Claude Code's SessionStart bootstrap hook (hooks/hooks.json) only
activates when hyperstack is registered as a first-class plugin via the
native plugin loader. Before this change, setup only wrote the MCP
server entry, leaving the hooks dormant - users saw MCP tools but no
bootstrap injection, no Iron Laws, no skill auto-discovery.
Changes:
- Add .claude-plugin/marketplace.json so hyperstack self-declares as a
1-plugin marketplace (inline source: "./" pattern).
- Add registerClaudeCodePlugin() in setup-hyperstack.ts that:
* Symlinks plugin into ~/.claude/plugins/marketplaces and cache
* Deep-merges known_marketplaces.json and installed_plugins.json
* Enables hyperstack@hyperstack in settings.json::enabledPlugins
All paths use os.homedir() - portable across users.
- Wire registerClaudeCodePlugin() into scripts/setup.ts after MCP patch,
gated on platform === "claude-code".
Idempotent. Skips cleanly when Claude Code not detected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hooks/hooks.json(SessionStart bootstrap) actually activates on install.claude-plugin/marketplace.jsonso the repo self-declares as a 1-plugin marketplaceregisterClaudeCodePlugin()tosetup-hyperstack.tsand wire it intoscripts/setup.tsWhy
Before this patch,
bun run setuponly wired the MCP server entry into the user's config. The plugin format (.claude-plugin/plugin.json,hooks/hooks.json,skills/) was on disk but Claude Code never discovered it - no entry in~/.claude/plugins/installed_plugins.json, no entry inenabledPlugins. Result: users saw MCP tools but no SessionStart bootstrap, no Iron Laws injection, no skill auto-discovery for the hyperstack-prefixed skills (blueprint, forge-plan, ship-gate, etc).What changes
.claude-plugin/marketplace.json(new): declares hyperstack as 1-plugin marketplace using the inlinesource: \"./\"pattern (matches caveman / other single-plugin marketplaces).src/internal/setup-hyperstack.ts: new exportedregisterClaudeCodePlugin(pluginRoot)that:~/.claude/plugins/marketplaces/hyperstackand~/.claude/plugins/cache/hyperstack/hyperstackknown_marketplaces.jsonandinstalled_plugins.json\"hyperstack@hyperstack\": truein~/.claude/settings.json::enabledPlugins(only that key - no hand-written hook block, no MCP mutation)os.homedir()- portable across usersscripts/setup.ts: callsregisterClaudeCodePlugin(pluginRoot)after MCP patch whenplatform === \"claude-code\". Silent no-op on other platforms.Behaviour
enabledPlugins,installed_plugins.json,known_marketplaces.json, and creates two symlinks. Leaves all other keys alone.~/.claude/settings.jsonis absent.Test plan
bunx tsc --noEmit)registerClaudeCodePlugin(pluginRoot)produces expected registry mutationshookSpecificOutputvianode hooks/session-start.mjs~/.claude(reviewer)