Knowledge Base updated: 2026-11-16
Knowledge base index
Orientation
This repository is a Claude Code plugin/mod collection plus examples and maintenance automation. The highest-level runtime flow is: Claude Code loads plugin metadata, registers hook modules from mods/*/hooks, and those hooks alter or observe Claude Code behavior such as AGENTS.md handling, diff panes, privacy controls, security defaults, and telemetry.
Main parts:
mods/agents-md— AGENTS.md discovery, framing, modes, switches, and related telemetry.mods/diff— diff command routing, git/file-state analysis, and pane/view/tool integration.mods/privacy— outbound privacy hook behavior.mods/sec-default— security-default policy, admission, and refusal behavior.mods/telemetry— telemetry registration, gating, event construction, batching, and sending.examples— gateway, hook, MDM, and settings templates.scripts— GitHub issue and duplicate-management automation.
Critical state is mostly local/runtime rather than centralized: Claude Code settings and managed settings live in examples/templates; plugin metadata lives under .claude-plugin/, plugins/, and per-mod .claude-plugin/; diff behavior reads git/worktree state; telemetry builds local event batches and sends them through its sender path. There is no application database, queue, cache, or object store represented in this repository.
Architecture diagrams
flowchart TD
subgraph Metadata[Plugin metadata and docs]
RootPlugin[.claude-plugin]
Plugins[plugins]
TopDocs[README / CLAUDE / CHANGELOG]
end
subgraph Mods[mods]
Agents[agents-md]
Diff[diff]
Privacy[privacy]
Sec[sec-default]
Telemetry[telemetry]
Types[mods/types]
end
subgraph Support[Support surfaces]
Examples[examples]
Scripts[scripts]
end
RootPlugin --> Mods
Plugins --> Mods
TopDocs --> Mods
Types --> Agents
Types --> Diff
Types --> Privacy
Types --> Sec
Types --> Telemetry
Examples --> Mods
Scripts --> GitHub[GitHub issues]
flowchart LR
Claude[Claude Code runtime] --> PluginMeta[per-mod plugin metadata]
PluginMeta --> HooksJson[hooks/hooks.json]
HooksJson --> Register[hooks/register.ts]
Register --> HookIndex[hooks/index.ts]
HookIndex --> Behavior[Runtime hook behavior]
Behavior --> Agents[agents-md]
Behavior --> Diff[diff]
Behavior --> Privacy[privacy]
Behavior --> Sec[sec-default]
Behavior --> Telemetry[telemetry]
flowchart TD
DiffCommand[diff command / trigger] --> Routing[command-spec and ask/message helpers]
Routing --> Backend[backend orchestration]
Backend --> Git[git helpers]
Backend --> FileState[file classification and kept/open outcomes]
Backend --> PaneState[pane state]
PaneState --> Views[views]
Views --> Tools[tools / todos / turns]
flowchart TD
TelemetryRegister[telemetry register] --> Deps[telemetry deps]
Deps --> Gate[analytics-off and gate checks]
Gate -->|allowed| Entries[event entries]
Gate -->|refused| Refusal[served/refused result]
Entries --> Batch[batching]
Batch --> Sender[sender]
Sender --> Wire[telemetry wire format]
Glossary
- mod — A plugin-style subsystem under
mods/<name>/with metadata, hooks, README, and often tests. - hook — A Claude Code runtime integration point implemented under
mods/*/hooks/**and registered by hooks/register.ts / hooks/index.ts. - sec-default — The security-default mod that applies policy/admission checks and refusal flows.
- diff pane — The diff mod’s UI/state surface for presenting git/file changes and related tool actions.
- managed settings — Example enterprise/MDM-style configuration files under
examples/mdm/**andexamples/settings/**.
Codebase-wide invariants
- Each primary mod directory has a README.md and
hooks/subtree; evidence: mods/…/README.md,mods/diff/hooks/,mods/privacy/hooks/,mods/sec-default/hooks/,mods/telemetry/hooks/. - Hook-based mods expose hook metadata and registration files under
mods/*/hooks/; evidence: mods/…/hooks.json, mods/…/index.ts, and mods/…/register.ts. - Most larger mods keep their tests inside the mod directory rather than a repo-level test tree; evidence:
mods/agents-md/tests/**,mods/diff/tests/**,mods/sec-default/tests/**,mods/telemetry/tests/**. - Shared Claude Code typing is centralized outside individual mods; evidence: mods/…/claude-code.d.ts, with telemetry-specific types under
mods/telemetry/types/**. - Operational examples and repository maintenance automation are separated from runtime mods; evidence:
examples/**andscripts/**/Script/**are routed independently frommods/**.
Routing table
-
README.md, CLAUDE.md, CHANGELOG.md, LICENSE.md, SECURITY.md, feed.xml, demo.gif,
.gitattributes,.gitignore,.vscode/**,.devcontainer/**,.claude/**,.claude-plugin/**,plugins/**, mods/README.md, mods/tsconfig.json,mods/types/**-> docs/repository-plugin-structure.md -
any change to repo-level plugin packaging, marketplace metadata, or shared mod typing -> docs/repository-plugin-structure.md
-
mods/agents-md/**-> docs/agents-md-mod.md -
any change to AGENTS.md discovery/framing/mode/switch behavior -> docs/agents-md-mod.md
-
mods/diff/.claude-plugin/**, mods/…/README.md, mods/…/hooks.json, mods/…/index.ts, mods/…/register.ts,mods/diff/hooks/command-spec/**,mods/diff/hooks/ask/**,mods/diff/hooks/message-of/**,mods/diff/hooks/names/**,mods/diff/hooks/is-record/**,mods/diff/tests/**-> docs/diff-entrypoints-and-command-routing.md -
any change to diff command registration, user-facing command specs, or command routing helpers -> docs/diff-entrypoints-and-command-routing.md
-
mods/diff/hooks/backend/**,mods/diff/hooks/git/**,mods/diff/hooks/drawn-files-of/**,mods/diff/hooks/entry-kinds-of/**,mods/diff/hooks/classify/**,mods/diff/hooks/kept-of/**,mods/diff/hooks/open-outcome/**,mods/diff/hooks/mtime-of/**,mods/diff/hooks/count-of/**,mods/diff/hooks/limits/**,mods/diff/hooks/array-of/**,mods/diff/hooks/is-checkpointing/**-> docs/diff-backend-git-and-file-state.md -
any change to diff git inspection, file classification, checkpoint detection, or backend state derivation -> docs/diff-backend-git-and-file-state.md
-
mods/diff/hooks/host/**,mods/diff/hooks/is-on-pane-surface/**,mods/diff/hooks/pane-state/**,mods/diff/hooks/pane-toggle/**,mods/diff/hooks/refresh-rest-of/**,mods/diff/hooks/todos/**,mods/diff/hooks/tools/**,mods/diff/hooks/turns/**,mods/diff/hooks/views/**,mods/diff/hooks/record/**-> docs/diff-pane-views-and-tools.md -
any change to diff pane rendering, pane state, tool integration, todos, or turn handling -> docs/diff-pane-views-and-tools.md
-
mods/privacy/**-> docs/privacy-outbound-mod.md -
any change to outbound privacy hook behavior -> docs/privacy-outbound-mod.md
-
mods/sec-default/**-> docs/sec-default-policy-and-admission.md -
any change to security-default policy, admission, held verdicts, or refusal flows -> docs/sec-default-policy-and-admission.md
-
mods/telemetry/.claude-plugin/**, mods/…/README.md, mods/…/hooks.json, mods/…/index.ts, mods/…/register.ts,mods/telemetry/hooks/telemetry-deps/**,mods/telemetry/hooks/telemetry-of/**,mods/telemetry/hooks/policy-pins/**,mods/telemetry/hooks/context/**,mods/telemetry/hooks/facts/**,mods/telemetry/types/**-> docs/telemetry-registration-and-dependencies.md -
any change to telemetry plugin registration, dependency construction, policy pins, context/facts, or public telemetry typing -> docs/telemetry-registration-and-dependencies.md
-
mods/telemetry/hooks/answer-of/**,mods/telemetry/hooks/entries/**,mods/telemetry/hooks/batching/**,mods/telemetry/hooks/sender/**,mods/telemetry/hooks/config-location/**,mods/telemetry/tests/**-> docs/telemetry-event-pipeline-and-sending.md -
any change to telemetry event construction, batching, sender transport, config location, or wire-format tests -> docs/telemetry-event-pipeline-and-sending.md
-
mods/telemetry/hooks/is-analytics-off/**,mods/telemetry/hooks/gate/**,mods/telemetry/hooks/environment/**,mods/telemetry/hooks/deployment/**-> docs/telemetry-gating-environment-and-deployment.md -
any change to telemetry opt-out, gate served/refused decisions, environment probing, or deployment detection -> docs/telemetry-gating-environment-and-deployment.md
-
examples/**-> docs/examples-and-configuration-templates.md -
any change to gateway, hook, MDM, managed-settings, or settings-profile examples -> docs/examples-and-configuration-templates.md
-
scripts/**,Script/**-> docs/issue-automation-scripts.md -
any change to duplicate issue handling, issue lifecycle automation, label editing, GitHub shell helpers, or sweep behavior -> docs/issue-automation-scripts.md