# talbarina/claude-editor-context architecture

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

- Interactive diagram: https://gitdiagram.com/talbarina/claude-editor-context
- Repository: https://github.com/talbarina/claude-editor-context

## Overview

editor-context is a Claude desktop plugin that shares live Cursor or VS Code context with Claude. Its main workflow is: the plugin starts a Node helper, the helper connects to the editor extension, and the plugin attaches the current selection to user messages while presenting a control band. The README documents pinning, explain, recent files, pause, unsaved-change warnings, and connection notices. Most behavior is implemented in register.tsx; the excerpts show only portions of it, so feature-level links rely on README descriptions where needed.

Main entry points: [`plugins/editor-context/hooks/register.tsx`](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx) (Plugin hooks), [`plugins/editor-context/hooks/controls.tsx`](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/controls.tsx) (Custom controls), [`plugins/editor-context/types/index.d.ts`](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/types/index.d.ts) (Plugin state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bridge["Editor bridge"]
  node_extension["Claude Code extension"]
  node_helper["Node helper<br/>[register.tsx]"]
  node_localrelay["Local socket relay<br/>[register.tsx]"]
end

subgraph group_runtime["Plugin runtime"]
  node_register["Plugin hooks<br/>[register.tsx]"]
  node_state["Plugin state<br/>[index.d.ts]"]
end

subgraph group_context["Context features"]
  node_messagecontext["Message context<br/>[register.tsx]"]
  node_pins["Pinned selections<br/>[register.tsx]"]
  node_explain["Explain action<br/>[register.tsx]"]
  node_recents["Recent files<br/>[register.tsx]"]
  node_warnings["Connection and save notices<br/>[register.tsx]"]
end

subgraph group_interface["Band interface"]
  node_band["Context band<br/>[register.tsx]"]
  node_controls["Custom controls<br/>[controls.tsx]"]
end

node_user(("User"))
node_desktop["Claude desktop"]

node_desktop -->|"starts session"| node_register
node_register -->|"launches"| node_helper
node_helper -->|"reads editor context"| node_extension
node_helper -->|"shares connection"| node_localrelay
node_localrelay -->|"streams events"| node_register
node_register -->|"updates"| node_state
node_register -->|"attaches to messages"| node_messagecontext
node_register -->|"manages"| node_pins
node_register -->|"submits prompt"| node_explain
node_register -->|"manages"| node_recents
node_register -->|"shows notices"| node_warnings
node_register -->|"renders"| node_band
node_band -->|"uses"| node_controls
node_controls -->|"posts presses"| node_register
node_user -.->|"uses controls"| node_band

click node_helper "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_localrelay "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_register "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_state "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/types/index.d.ts"
click node_messagecontext "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_pins "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_explain "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_recents "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_warnings "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_band "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx"
click node_controls "https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/controls.tsx"

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_extension,node_helper,node_localrelay,node_user toneBlue
class node_register,node_state toneAmber
class node_messagecontext,node_pins,node_explain,node_recents,node_warnings toneMint
class node_band,node_controls toneRose
class node_desktop toneIndigo
```

## Components

### Editor bridge

- **Claude Code extension**
- [Node helper](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Local socket relay](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`

### Plugin runtime

- [Plugin hooks](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Plugin state](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/types/index.d.ts): `plugins/editor-context/types/index.d.ts`

### Context features

- [Message context](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Pinned selections](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Explain action](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Recent files](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Connection and save notices](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`

### Band interface

- [Context band](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/register.tsx): `plugins/editor-context/hooks/register.tsx`
- [Custom controls](https://github.com/talbarina/claude-editor-context/blob/main/plugins/editor-context/hooks/controls.tsx): `plugins/editor-context/hooks/controls.tsx`

### Other components

- **User**
- **Claude desktop**

## Connections

- Claude desktop → Plugin hooks: starts session (evidence: `README.md`)
- Plugin hooks → Node helper: launches (evidence: `README.md`)
- Node helper → Claude Code extension: reads editor context (evidence: `README.md`)
- Node helper → Local socket relay: shares connection (evidence: `README.md`)
- Local socket relay → Plugin hooks: streams events (evidence: `plugins/editor-context/hooks/register.tsx`)
- Plugin hooks → Plugin state: updates (evidence: `plugins/editor-context/hooks/register.tsx`)
- Plugin hooks → Message context: attaches to messages (evidence: `README.md`)
- Plugin hooks → Pinned selections: manages (evidence: `README.md`)
- Plugin hooks → Explain action: submits prompt (evidence: `plugins/editor-context/hooks/register.tsx`)
- Plugin hooks → Recent files: manages (evidence: `README.md`)
- Plugin hooks → Connection and save notices: shows notices (evidence: `README.md`)
- Plugin hooks → Context band: renders (evidence: `plugins/editor-context/hooks/register.tsx`)
- Context band → Custom controls: uses (evidence: `plugins/editor-context/hooks/controls.tsx`)
- Custom controls → Plugin hooks: posts presses (evidence: `plugins/editor-context/hooks/controls.tsx`)
- User → Context band: uses controls
