# Extension points — anthropics/claude-code

> Canonical page: https://codevetter.com/unpack/claude-code/extension-points

# Extension points — anthropics/claude-code

Scanned commit b486776a2eef0d3f39abaebaa3c03e378c7480b8 (2026-09-21). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

New product behaviour is supposed to arrive as a plugin (markdown command, agent, skill, or hooks.json command) registered in marketplace.json, or as another event subscription inside a mod's register. The engine nouns are extended by declaration merging on EngineInterface. Diff reserves a compile-time probe set for non-git VCS. security-guidance and hookify are the two user-file extension mechanisms. Organizations move sec-default by listing prependPlugins.
- Marketplace registration is the plugins array in .claude-plugin/marketplace.json. Each entry has name, description, source (a ./plugins/<dir> path), and category. plugins/README.md specifies the folder contract: .claude-plugin/plugin.json, optional commands/, agents/, skills/, hooks/, .mcp.json, and README.md. — [.claude-plugin/marketplace.json#L10-L16](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/.claude-plugin/marketplace.json#L10-L16) [plugins/README.md#L47-L71](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/README.md#L47-L71)
- A function-hook plugin's entry is hooks/hooks.json modules: ["./register.ts"] and export function register(on). diff, telemetry, agents-md, and sec-default all follow that shape. New events are additional on('event.name', matcher, handler) calls. The matcher objects in this repo include {component}, {command}, {id}, {plugin}, {requestId}, {tool}, {fork}, and {instructionFiles}. — [mods/telemetry/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/telemetry/hooks/hooks.json) [mods/diff/hooks/register.ts#L644-L967](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/diff/hooks/register.ts#L644-L967) [mods/agents-md/hooks/register.ts#L50-L179](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/agents-md/hooks/register.ts#L50-L179) [mods/sec-default/hooks/register.ts#L20-L33](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/sec-default/hooks/register.ts#L20-L33)
- Adding a noun on $ is a types contract: a .d.ts with no imports that exports the noun's types and uses declare module 'claude-code' { interface EngineInterface { ... } }. telemetry/plugin.json points types at ./types/index.d.ts. Callers include that folder via tsconfig; they must not copy the types. — [mods/telemetry/types/index.d.ts#L1-L20](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/telemetry/types/index.d.ts#L1-L20) [mods/telemetry/.claude-plugin/plugin.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/telemetry/.claude-plugin/plugin.json) [mods/README.md#L84-L112](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/README.md#L84-L112) [mods/types/claude-code.d.ts#L82-L91](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/types/claude-code.d.ts#L82-L91)
- agents-md is configured without code changes: pluginConfigs['agents-md@builtin'].options.instructionFiles in user, --settings, or managed settings (not project .claude/settings.json). The four legal strings are listed on userConfig.options in plugin.json. An unknown hand-typed value is told once and read as the default. — [mods/agents-md/.claude-plugin/plugin.json#L8-L21](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/agents-md/.claude-plugin/plugin.json#L8-L21) [mods/agents-md/README.md#L47-L67](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/agents-md/README.md#L47-L67)
- Organization seating of sec-default is the managed prependPlugins list. If that list is set, it replaces the whole prepend tier and the org must name sec-default@builtin to keep the default. Example from the README: ["acme-guard@acme-tools", "sec-default@builtin"]. — [mods/sec-default/README.md#L45-L52](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/sec-default/README.md#L45-L52) [mods/README.md#L10](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/README.md#L10)
- Non-git diff backends plug in by adding a BackendProbe to INSTALLED_BACKEND_PROBES before register runs. backendOf asks those probes in insertion order and only then Git.gitBackendOf. The set is empty as published; tests pass probes into backendOf directly instead of mutating the set. — [mods/diff/hooks/backend/installed-backend-probes.ts](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/diff/hooks/backend/installed-backend-probes.ts) [mods/diff/hooks/backend/backend-of.ts#L1-L29](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/diff/hooks/backend/backend-of.ts#L1-L29)
- security-guidance user extension is two additive files, discovered user then project then project-local: claude-security-guidance.md (prompt text, cannot suppress built-in findings) and security-patterns.yaml or .json (regex/substring rules merged with SECURITY_PATTERNS). Built-in patterns cannot be disabled individually; ENABLE_PATTERN_RULES=0 disables all pattern checks. Managed-settings delivery of these files is not supported. — [plugins/security-guidance/hooks/extensibility.py#L1-L33](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/security-guidance/hooks/extensibility.py#L1-L33) [plugins/security-guidance/hooks/patterns.py#L29-L31](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/security-guidance/hooks/patterns.py#L29-L31)
- hookify rules are markdown files matching .claude/hookify.*.local.md with YAML frontmatter (name, enabled, event, action warn|block, tool_matcher, pattern or conditions[{field, operator, pattern}]). The RuleEngine is the evaluator. Examples live in plugins/hookify/examples (dangerous-rm.local.md, sensitive-files-warning.local.md, require-tests-stop.local.md, console-log-warning.local.md). — [plugins/hookify/core/config_loader.py#L32-L84](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/hookify/core/config_loader.py#L32-L84) [plugins/hookify/core/rule_engine.py#L27-L44](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/hookify/core/rule_engine.py#L27-L44) [plugins/README.md#L22](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/README.md#L22)
- Slash commands are markdown files under commands/ with YAML frontmatter (description, argument-hint, allowed-tools). Agents are markdown under agents/. Skills are SKILL.md plus references. frontend-design is a skill with no command, meant to be auto-invoked. Output-style plugins are only a SessionStart shell hook (explanatory-output-style and learning-output-style). — [plugins/commit-commands/commands/commit.md#L1-L4](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/commit-commands/commands/commit.md#L1-L4) [plugins/feature-dev/commands/feature-dev.md#L1-L4](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/feature-dev/commands/feature-dev.md#L1-L4) [plugins/frontend-design/skills/frontend-design/SKILL.md#L1-L6](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/frontend-design/skills/frontend-design/SKILL.md#L1-L6) [plugins/explanatory-output-style/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/explanatory-output-style/hooks/hooks.json) [plugins/README.md#L19-L23](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/README.md#L19-L23)
- Classic command hooks, as opposed to function hooks, are JSON in hooks/hooks.json with keys SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, and Stop. Each hook has type command, a command string that may use ${CLAUDE_PLUGIN_ROOT}, optional timeout, matcher, if, asyncRewake, rewakeMessage. security-guidance, hookify, ralph-wiggum, and the two output-style plugins use this format. The four mods use the modules array format instead. — [plugins/security-guidance/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/security-guidance/hooks/hooks.json) [plugins/hookify/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/hookify/hooks/hooks.json) [plugins/ralph-wiggum/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/plugins/ralph-wiggum/hooks/hooks.json) [mods/telemetry/hooks/hooks.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/mods/telemetry/hooks/hooks.json)
- Issue-bot behaviour is extended by editing the lifecycle table, not by scattering day counts. scripts/issue-lifecycle.ts is the single source imported by sweep.ts and lifecycle-comment.ts. Triage label policy is the prompt .claude/commands/triage-issue.md. New gh operations must go through scripts/gh.sh's allowlist (issue view, issue list, search issues, label list) or a new capped script listed in CLAUDE_CODE_SCRIPT_CAPS. — [scripts/issue-lifecycle.ts#L1-L3](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/scripts/issue-lifecycle.ts#L1-L3) [scripts/sweep.ts#L3](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/scripts/sweep.ts#L3) [scripts/lifecycle-comment.ts#L6](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/scripts/lifecycle-comment.ts#L6) [.claude/commands/triage-issue.md#L14-L23](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/.claude/commands/triage-issue.md#L14-L23) [scripts/gh.sh#L29-L36](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/scripts/gh.sh#L29-L36)
- Enterprise policy extension points documented as examples, not code registries: permissions.deny/ask, allowManagedPermissionRulesOnly, allowManagedHooksOnly, strictKnownMarketplaces, sandbox.network.allowedDomains, and MDM payloads for com.anthropic.claudecode (macOS) and HKLM\SOFTWARE\Policies\ClaudeCode\Settings (Windows). — [examples/settings/settings-strict.json](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/examples/settings/settings-strict.json) [examples/settings/README.md#L12-L31](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/examples/settings/README.md#L12-L31) [examples/mdm/README.md#L9-L19](https://github.com/anthropics/claude-code/blob/b486776a2eef0d3f39abaebaa3c03e378c7480b8/examples/mdm/README.md#L9-L19)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
