Introducing a new way to review your PRs.

Read the announcement

anthropics / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

View on GitHub

13 documents · Updated Nov 16, 2026

overview

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/** and examples/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/** and scripts/** / Script/** are routed independently from mods/**.

Routing table