# raytan37/anth-claude-code architecture

> Architecture diagram of the GitHub repository raytan37/anth-claude-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raytan37/anth-claude-code
- Repository: https://github.com/raytan37/anth-claude-code

## Overview

Claude Code is a terminal-oriented agentic coding tool; users give it natural-language tasks and it can explain code, execute routine work, and handle Git workflows. The sampled repository also exposes plugins and runtime mods: instruction-file attachment, Git-diff inspection, tool-policy enforcement, hookify rules, security review, and telemetry. The graph emphasizes these product paths and the internal components shown in the excerpts. Several subsystems are represented at directory level because their runtime implementation was not sampled; those links are omitted unless documented or evidenced.

Main entry points: [`mods/agents-md/hooks/register.ts`](https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/register.ts) (Instruction files), [`mods/diff/hooks/git/probes/repository-of/repository-of.ts`](https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/git/probes/repository-of/repository-of.ts) (Repository discovery), [`plugins/hookify/hooks/pretooluse.py`](https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/hooks/pretooluse.py) (Hookify plugin), [`mods/diff/hooks/register.ts`](https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/register.ts) (Git diff pane)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mods["Claude Code mods"]
  node_agents_md["Instruction files<br/>[register.ts]"]
  node_agent_files["File selection<br/>[insertion-index.ts]"]
  node_agent_frames["Path frames<br/>[absolute-of.ts]"]
  node_diff_pane["Git diff pane<br/>[register.ts]"]
  node_repo_probe["Repository discovery<br/>[repository-of.ts]"]
  node_diff_fetch["Diff collection"]
  node_sec_policy["Tool policy<br/>[register.ts]"]
  node_org_tool["Organization tool check<br/>[names-org-tool.ts]"]
end

subgraph group_plugins["Plugins"]
  node_hookify["Hookify plugin<br/>[pretooluse.py]"]
  node_hook_config["Rule configuration<br/>[config_loader.py]"]
  node_rule_engine["Rule evaluation<br/>[rule_engine.py]"]
  node_security_hook["Security guidance"]
  node_security_review["Security analysis<br/>[llm.py]"]
  node_review_api["Review API<br/>[review_api.py]"]
end

subgraph group_telemetry["Telemetry"]
  node_telemetry_context["Session context<br/>[context-of.ts]"]
  node_telemetry_facts["Session facts<br/>[facts.ts]"]
end

node_developer(("Developer"))
node_claude["Claude Code"]
node_reviewer(("External reviewer"))
node_telemetry_sink[("Telemetry service")]
node_git["Git<br/>external system"]

node_developer -->|"requests work"| node_claude
node_claude -.->|"loads instructions"| node_agents_md
node_agents_md -->|"selects and orders"| node_agent_files
node_agents_md -->|"resolves paths"| node_agent_frames
node_claude -.->|"opens diff view"| node_diff_pane
node_diff_pane -.->|"discovers repository"| node_repo_probe
node_repo_probe -.->|"provides repository"| node_diff_fetch
node_repo_probe -->|"runs rev-parse"| node_git
node_claude -.->|"enforces hook policy"| node_sec_policy
node_sec_policy -->|"checks tool ownership"| node_org_tool
node_claude -.->|"runs tool hooks"| node_hookify
node_hookify -->|"loads rules"| node_hook_config
node_hookify -->|"evaluates rules"| node_rule_engine
node_claude -.->|"invokes security hooks"| node_security_hook
node_security_hook -->|"delegates analysis"| node_security_review
node_reviewer -->|"requests review"| node_review_api
node_claude -.->|"provides session state"| node_telemetry_context
node_telemetry_context -->|"reads facts"| node_telemetry_facts
node_telemetry_facts -.->|"reports usage"| node_telemetry_sink

click node_agents_md "https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/register.ts"
click node_agent_files "https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/files/insertion-index.ts"
click node_agent_frames "https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/frames/absolute-of.ts"
click node_diff_pane "https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/register.ts"
click node_repo_probe "https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/git/probes/repository-of/repository-of.ts"
click node_diff_fetch "https://github.com/raytan37/anth-claude-code/tree/main/mods/diff/hooks/git/tiers"
click node_sec_policy "https://github.com/raytan37/anth-claude-code/blob/main/mods/sec-default/hooks/register.ts"
click node_org_tool "https://github.com/raytan37/anth-claude-code/blob/main/mods/sec-default/hooks/policy/names-org-tool.ts"
click node_hookify "https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/hooks/pretooluse.py"
click node_hook_config "https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/core/config_loader.py"
click node_rule_engine "https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/core/rule_engine.py"
click node_security_hook "https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/security_reminder_hook.py"
click node_security_review "https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/llm.py"
click node_review_api "https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/review_api.py"
click node_telemetry_context "https://github.com/raytan37/anth-claude-code/blob/main/mods/telemetry/hooks/context/context-of.ts"
click node_telemetry_facts "https://github.com/raytan37/anth-claude-code/blob/main/mods/telemetry/hooks/facts/facts.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agents_md,node_agent_files,node_agent_frames,node_diff_pane,node_repo_probe,node_diff_fetch,node_sec_policy,node_org_tool,node_reviewer toneBlue
class node_hookify,node_hook_config,node_rule_engine,node_security_hook,node_security_review,node_review_api,node_telemetry_sink toneAmber
class node_telemetry_context,node_telemetry_facts toneMint
class node_developer,node_claude,node_git toneIndigo
```

## Components

### Claude Code mods

- [Instruction files](https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/register.ts): `mods/agents-md/hooks/register.ts`
- [File selection](https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/files/insertion-index.ts): `mods/agents-md/hooks/files/insertion-index.ts`
- [Path frames](https://github.com/raytan37/anth-claude-code/blob/main/mods/agents-md/hooks/frames/absolute-of.ts): `mods/agents-md/hooks/frames/absolute-of.ts`
- [Git diff pane](https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/register.ts): `mods/diff/hooks/register.ts`
- [Repository discovery](https://github.com/raytan37/anth-claude-code/blob/main/mods/diff/hooks/git/probes/repository-of/repository-of.ts): `mods/diff/hooks/git/probes/repository-of/repository-of.ts`
- [Diff collection](https://github.com/raytan37/anth-claude-code/tree/main/mods/diff/hooks/git/tiers): `mods/diff/hooks/git/tiers`
- [Tool policy](https://github.com/raytan37/anth-claude-code/blob/main/mods/sec-default/hooks/register.ts): `mods/sec-default/hooks/register.ts`
- [Organization tool check](https://github.com/raytan37/anth-claude-code/blob/main/mods/sec-default/hooks/policy/names-org-tool.ts): `mods/sec-default/hooks/policy/names-org-tool.ts`

### Plugins

- [Hookify plugin](https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/hooks/pretooluse.py): `plugins/hookify/hooks/pretooluse.py`
- [Rule configuration](https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/core/config_loader.py): `plugins/hookify/core/config_loader.py`
- [Rule evaluation](https://github.com/raytan37/anth-claude-code/blob/main/plugins/hookify/core/rule_engine.py): `plugins/hookify/core/rule_engine.py`
- [Security guidance](https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/security_reminder_hook.py): `plugins/security-guidance/hooks/security_reminder_hook.py`
- [Security analysis](https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/llm.py): `plugins/security-guidance/hooks/llm.py`
- [Review API](https://github.com/raytan37/anth-claude-code/blob/main/plugins/security-guidance/hooks/review_api.py): `plugins/security-guidance/hooks/review_api.py`

### Telemetry

- [Session context](https://github.com/raytan37/anth-claude-code/blob/main/mods/telemetry/hooks/context/context-of.ts): `mods/telemetry/hooks/context/context-of.ts`
- [Session facts](https://github.com/raytan37/anth-claude-code/blob/main/mods/telemetry/hooks/facts/facts.ts): `mods/telemetry/hooks/facts/facts.ts`

### Other components

- **Developer**
- **Claude Code**
- **External reviewer**
- **Telemetry service**
- **Git**: external system

## Connections

- Developer → Claude Code: requests work (evidence: `README.md`)
- Claude Code → Instruction files: loads instructions
- Instruction files → File selection: selects and orders (evidence: `mods/agents-md/hooks/register.ts`)
- Instruction files → Path frames: resolves paths (evidence: `mods/agents-md/hooks/register.ts`)
- Claude Code → Git diff pane: opens diff view
- Git diff pane → Repository discovery: discovers repository
- Repository discovery → Diff collection: provides repository
- Repository discovery → Git: runs rev-parse (evidence: `mods/diff/hooks/git/probes/repository-of/repository-of.ts`)
- Claude Code → Tool policy: enforces hook policy
- Tool policy → Organization tool check: checks tool ownership (evidence: `mods/sec-default/hooks/register.ts`)
- Claude Code → Hookify plugin: runs tool hooks
- Hookify plugin → Rule configuration: loads rules (evidence: `plugins/hookify/hooks/pretooluse.py`)
- Hookify plugin → Rule evaluation: evaluates rules (evidence: `plugins/hookify/hooks/pretooluse.py`)
- Claude Code → Security guidance: invokes security hooks
- Security guidance → Security analysis: delegates analysis (evidence: `plugins/security-guidance/hooks/llm.py`)
- External reviewer → Review API: requests review (evidence: `plugins/security-guidance/hooks/review_api.py`)
- Claude Code → Session context: provides session state
- Session context → Session facts: reads facts (evidence: `mods/telemetry/hooks/context/context-of.ts`)
- Session facts → Telemetry service: reports usage
