Repository navigation
Explore Claude Code mods across the skill families #1497
Description
What
Claude Code shipped mods on 2026-10-02 (v2.1.287, on by default).
This issue is for exploring where mods could make Magpie's skill families better, and where they shouldn't be used.
It is meant for discussion first. Each idea that holds up should get its own issue or PR.
What a mod is
A mod is a Claude Code plugin that contains a JS/TS "hooks module".
Claude Code calls the module's functions inside its own process when events happen.
Each hook works like middleware, ($, e, next), and can do one of three things with an event:
- observe it,
- rewrite it (
next({ ...e, ... })), or - answer it, so Claude Code's default behaviour doesn't run.
Compared with what we use today (skills, settings hooks, MCP), mods can do the following:
| Capability | Events / API |
|---|---|
| Draw interactive UI: a pane beside the transcript, a band above the prompt, buttons, inputs, selects, toasts, status-line entries | ui.render (Pane, AbovePrompt), $.ui.open/toast/status |
Redraw Claude Code's own UI: tool-call rows, spinner, the AskUserQuestion dialog (but never the permission prompt) |
ui.render on built-in render sites |
| Guard, rewrite or answer a tool call, including holding it while asking the user | tool.call, tool.check |
| Rewrite prompts, system-prompt sections, reminders, skill text, commit/PR attribution text | prompt.submit, prompt.compose, prompt.section, skill.prompt, attribution.text |
Run a /command as plain code: no Claude turn, no tokens, works even while Claude is busy |
$.command.register + command.run |
| Register tools and subagent types, call or fork a model, route one request to another model or effort level | $.tool, $.agent, $.model, turn.step |
| Timers, files, processes, HTTP, MCP calls, cross-session messages, a key-value store shared across sessions | $.clock, $.fs, $.process, $.http, $.mcp, $.session.send, $.store |
| Inspect or refuse other mods as they load (policy mods) | plugin.register, managed prependPlugins |
You can see what a mod does without running it: claude plugin validate <dir> prints the events it hooks and the API calls it makes.
Mods are tested with claude plugin test (*.test.ts).
Docs
- Overview: https://code.claude.com/docs/en/plugins/mods/overview
- Create a mod: https://code.claude.com/docs/en/plugins/mods/create
- Reference (events, API, render sites, limits, settings): https://code.claude.com/docs/en/plugins/mods/reference
- Managing mods for an organization: https://code.claude.com/docs/en/plugins/mods/admin
- TypeScript declarations (the complete reference): https://github.com/anthropics/claude-code/blob/main/mods/types/claude-code.d.ts
- Source of the built-in mods (
diff,agents-md,sec-default): https://github.com/anthropics/claude-code/tree/main/mods - Sample mods: https://github.com/anthropics/claude-code-playground/tree/main/claude-code/mods
Constraints any Magpie mod has to respect
- Vendor neutrality. Mods exist only in Claude Code (CLI and the Desktop Code tab). They don't run in Codex or Gemini CLI, and the VS Code panel and
claude -pdon't draw them.
So a mod can only enhance a skill. Every skill must still work end-to-end without it (docs/vendor-neutrality.md). - Mods are not sandboxed. A mod's
$.fs/$.process/$.httpcalls run as the user, outside the Bash sandbox our secure setup relies on.
A user-installed mod can also approve tool calls that anaskrule would prompt for.
Any mod we ship needs a minimal, auditablecalls:surface, and the secure-setup docs need to explain the trade-off. - No new LLM hop by accident.
$.model.complete/$.model.fork/turn.stepmodel routing is an LLM hop under the privacy-LLM rules. - Distribution. Magpie already ships as plugins via the marketplace, so a mod can sit in the same family plugin as its skills.
Orgs running withallowManagedModsOnlywon't load it, which is one more reason the skill can't depend on it.
Starting points, by family
Each idea below is a candidate, not a commitment.
The recurring theme is moving deterministic or presentational work out of the model's context.
Setup / secure setup (family:setup)
- Drift check without tokens. Today every skill's pre-flight compares
.apache-magpie.local.lockagainst.apache-magpie.lockinside the model's context.
Asession.starthook could do the comparison in code and show a band ("snapshot drift, run/magpie-setup upgrade").
The skill's pre-flight then becomes a one-line fallback for non-Claude harnesses. /magpie-statusas a code-only command. It would printsetup-status's report with no Claude turn.- agent-guard as a mod? The
commit-trailerand similar guards arePreToolUsesettings hooks today.
Atool.callmod could hold a call and offer "fix it" instead of only blocking.
Open question: is that worth losing the shell-script portability? Settings hooks still work and aren't deprecated. - Signing-wait toast. A toast or band while a signed commit waits for a hardware-key touch.
It would complementgpg-touch-overlay.shfor terminal-only users. setup-isolated-setup-verify/doctor. Report which mods are loaded, and flag any user mod whosecalls:includeprocess.*/http.fetch.
Utilities (family:utilities)
/magpie-skills(list-skills) as a zero-token command.- Token-cost band while authoring. Show
$.session.usage()context and cost while runningwrite-skill/optimize-skill/ evals, next to the skill'smeasured_tokens. - Commit attribution. An
attribution.texthook could emit the trailer thatcommit-attribution.tomlresolves to, so it's correct before agent-guard has to block anything.
Security (family:security)
- Deterministic public-surface scrub. A
tool.callhook ongh pr create/gh pr comment/git commitagainst<upstream>could grep the body file forCVE-, "security fix", "vulnerability", "advisory".
It would hold the call and show what it found, which makessecurity-issue-fix's pre-push grep impossible to skip. - Queue pane. A pane listing
needs triage/cve allocatedtrackers with buttons that start the matching skill.
Tracker content stays local: it's drawn in the terminal and never posted anywhere. - Open question: could
session.append/prompt.submithelp with privacy-LLM PII redaction?
Probably not, because rewriting what's stored isn't the same as controlling what reaches the model. Worth a written answer either way.
PR management (family:pr-management)
- Review pane for
pr-management-code-review. Show drafted inline comments as rows with accept / skip / edit buttons, instead of oneAskUserQuestionround-trip per finding.
The skill keeps posting the accepted set as one review. - Triage sweep progress band ("PR 7/23 · 3 drafted · 1 closed").
pr-management-statsrendered as a live pane (Svgon Desktop,Rasterin the terminal), not regenerated by the model.
Issue management (family:issue)
- Same shape as PR management: a backlog pane fed by
issue-backlog-stats, and a progress band forissue-stale-sweep/issue-triage.
Release management (family:release-management)
- Vote-tally band. Binding / non-binding counts and the time left on the 72h window, refreshed on a
$.clock.everytimer. release-verify-rcchecklist pane. One row per check, filled in as the steps finish.release-rc-cutkeeps printing the signing commands for the RM and never runsgpg. A mod must not change that.
Pairing (family:pairing)
pairing-multi-agent-review. A pane showing the reviewers' findings side by side.
turn.step/$.model.forkmight replace some of today's orchestration, subject to privacy-LLM constraint 3 above.
Mentoring / contributor growth (family:mentoring, family:contributor-growth)
- Lower priority. Possibly a pane for
contributor-activity-sweepresults, or for nomination drafts under review.
Proposed next steps
- Agree on the constraints above, and write them up as a short
docs/page ("When to use a mod in a Magpie family plugin"). - Pick one pilot with a measurable win. The setup drift check (fewer tokens on every skill run) or the code-review pane (fewer round-trips) look like the best candidates.
- Wire
claude plugin validate --strictandclaude plugin testinto prek / CI for any directory that contains a hooks module. - Open one follow-up issue per idea that survives the discussion.
Activity
Kaap10 commentedon Oct 5, 2026
+1 on keeping mods strictly additive so other harnesses (Gemini, Codex) continue to work normally.
Starting with the guidelines doc first makes total sense. For the first pilot, something simple like a zero-token
/magpie-skillscommand or the setup drift check would be great to test packaging and CI validation first.Happy to help draft the guidelines doc if that works!
potiuk commentedon Oct 5, 2026
Go for it :)
docs(architecture): add guidelines for Claude Code mods and vendor ne…
Kaap10 commentedon Oct 6, 2026
Step 1 has landed in
docs/when-to-use-mods.mdvia #1541.Following the next steps, I'd like to pick up Step 2 (Pilot 1): implementing the zero-token setup drift check mod in
plugins/magpie-setup/along with unit tests and CI validation (claude plugin validate/test).*Will open PR shortly!
fix(setup): align drift-check mod with YAML lockfile parser, floor se…
fix(setup): retain SessionStart hook in plugin.json for family plugin…
12 remaining items
fix(setup): reconcile hooks.json mod manifest and eliminate duplicate…
fix(setup): align drift-check mod with Claude Code sandbox API and te…
fix(setup): align hook registration AST and test exports for Claude C…
fix(setup): align hook registration AST and ui.render return for Clau…
fix(setup): restore SessionStart shell hook in hooks.json, fix PEP 44…
feat(setup): add zero-token setup drift check Claude Code mod (apache…
fix(setup): align drift-check mod with YAML lockfile parser, floor se…
fix(setup): retain SessionStart hook in plugin.json for family plugin…
fix(setup): reconcile hooks.json mod manifest and eliminate duplicate…
fix(setup): align drift-check mod with Claude Code sandbox API and te…
fix(setup): align hook registration AST and test exports for Claude C…
fix(setup): align hook registration AST and ui.render return for Clau…
fix(setup): restore SessionStart shell hook in hooks.json, fix PEP 44…
feat(setup): add zero-token setup drift check Claude Code mod (part of …
Kaap10 commentedon Oct 12, 2026
Steps 1–3 are complete on
main: mod guidelines landed indocs/when-to-use-mods.md(#1541), and Pilot 1 (zero-token setup drift check mod, engine test suite, andprek/CI wiring) has merged via #1552.Following the roadmap, picking up the zero-token
/magpie-statuscode command next inplugins/magpie-setupusing$.command.registerto print the setup-status report without consuming model turns or tokens.Will open a follow-up PR shortly!