add-sub — Claude Code command: subscribe to skill events
add-sub creates a skill-event subscription, so context lands before or after a skill runs, gated on files, git branch or environment variables.
no license ★ 2,003 updated 2026-07-26
.claude/commands/add-sub.mdWhat add-sub does
The command runs as a conversation. It asks where the subscription lives: global goes to ~/.claude/skill-bus.json, project to .claude/skill-bus.json inside the repo. Then it locates the cli.py helper in the skill-bus plugin cache, prints the available skills, and asks when the context should land: pre, post, or complete.
Inserts come from the existing list or you write a new one, and the name is checked for collisions. Conditions are optional. Pick from fileExists, gitBranch, envSet, envEquals or fileContains, and any of them can be negated. Insert-level conditions carry over to the subscription; its own conditions stack on top with AND, unless inheritConditions: false switches the inherited ones off. A duplicate insert+skill+timing pair ends the run with nothing written.
Complete timing needs "completionHooks": true in settings. A * pattern is allowed, though the command pushes back first: every match pulls the context in, and that costs tokens. The same nudge appears for insert text past 200 characters.
What it helps with
- attach project notes before a skill starts
- gate a subscription on
feature/*branches - chain two skills with the complete timing
- reuse an existing insert in another subscription
- catch a duplicate subscription before it is saved
Example prompts for the agent
- /add-sub subscribe
superpowers:brainstormingto the plan insert, pre timing, project scope. - /add-sub add a subscription for the deploy skill that only fires on
feature/*. - /add-sub create an insert named
migration-checkand hook it to post for the release skill.
How to install add-sub
Manually: put the files in place
.claude/commands/add-sub.mdCall it with /add-sub. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/add-sub.mdCall it with /prompts:add-sub. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/add-sub.prompt.mdManually: put the files in place
.gemini/commands/add-sub.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about add-sub
How to install add-sub in Claude Code?
Copy the command file into your project at .claude/commands/add-sub.md. It is then called as /add-sub.
What does add-sub do?
It walks through building a subscription to a skill event: scope, skill, pre/post/complete timing, insert and conditions. The result is appended to the skill-bus.json of the chosen scope.
What does complete timing require?
"completionHooks": true has to be set in your settings. That timing is also marked experimental.