# lugia19/claude-webextension-launcher architecture

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

- Interactive diagram: https://gitdiagram.com/lugia19/claude-webextension-launcher
- Repository: https://github.com/lugia19/claude-webextension-launcher

## Overview

This is a cross-platform Claude Desktop WebExtension installer and launcher. The main workflow checks the installed client and extensions, presents setup/checklist or instance selection, then launches Claude; when writes are needed, the launcher delegates installation and extension updates to a worker. Patching rebuilds the client from its package and modifies its ASAR resources. The README also documents self-updating, multi-instance management, shortcuts, session sharing, platform-specific Cowork/AppArmor setup, and uninstall. Several of those platform paths were not sampled, so their links are documented rather than inferred from imports.

Main entry points: [`main.go`](https://github.com/lugia19/claude-webextension-launcher/blob/master/main.go) (Launcher entry), [`worker.go`](https://github.com/lugia19/claude-webextension-launcher/blob/master/worker.go) (Install worker), [`patcher/patcher.go`](https://github.com/lugia19/claude-webextension-launcher/blob/master/patcher/patcher.go) (Client patcher), [`extensions/extensions.go`](https://github.com/lugia19/claude-webextension-launcher/blob/master/extensions/extensions.go) (Extension updates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher and UI"]
  node_main["Launcher entry<br/>[main.go]"]
  node_checklist["Setup checklist<br/>[checklist.go]"]
  node_setup["Setup screen<br/>[setup.go]"]
  node_instance_ui["Instance list<br/>[instances.go]"]
  node_instance_ops["Instance management<br/>[instances.go]"]
  node_settings[("Launcher settings<br/>[settings.go]")]
end

subgraph group_client["Client patching"]
  node_app["Claude Desktop"]
  node_patcher["Client patcher<br/>[patcher.go]"]
  node_asar["ASAR archive<br/>[asar.go]"]
  node_windows_hash["Integrity shim<br/>[dllmain.cpp]"]
end

subgraph group_extensions["Extensions"]
  node_extensions_runtime["Extension updates<br/>[extensions.go]"]
  node_recovery["Update recovery<br/>[recovery.go]"]
  node_injection["Extension injection<br/>[wrapper.js]"]
  node_sentinel["Sentinel extension<br/>[content.js]"]
end

subgraph group_lifecycle["Install lifecycle"]
  node_worker["Install worker<br/>[worker.go]"]
  node_status["Worker status<br/>[status.go]"]
  node_selfupdate["Self-update<br/>[selfupdate.go]"]
  node_uninstall["Uninstall<br/>[uninstall.go]"]
  node_shortcuts["Shortcuts<br/>[shortcuts.go]"]
  node_session_sharing["Session sharing"]
  node_cowork["Cowork service<br/>[cowork_windows.go]"]
  node_apparmor["AppArmor profile<br/>[apparmor_linux.go]"]
end

node_user(("Launcher user"))
node_github["GitHub releases"]
node_claude_package["Claude package source"]

node_user -->|"starts"| node_main
node_main -.->|"shows setup"| node_checklist
node_main -->|"runs UI"| node_setup
node_main -.->|"offers instances"| node_instance_ui
node_instance_ui -.->|"requests actions"| node_instance_ops
node_instance_ops -.->|"stores preferences"| node_settings
node_main -->|"finishes update"| node_selfupdate
node_main -->|"starts worker"| node_worker
node_main -->|"reads progress"| node_status
node_worker -->|"reports progress"| node_status
node_worker -->|"installs client"| node_patcher
node_patcher -->|"extracts archive"| node_asar
node_patcher -.->|"downloads package"| node_claude_package
node_patcher -.->|"builds modified client"| node_app
node_windows_hash -->|"adjusts integrity hash"| node_app
node_worker -->|"updates extensions"| node_extensions_runtime
node_extensions_runtime -->|"checks releases"| node_github
node_extensions_runtime -->|"recovers updates"| node_recovery
node_worker -->|"deploys extension"| node_sentinel
node_patcher -.->|"embeds injection"| node_injection
node_worker -->|"registers service"| node_cowork
node_main -.->|"supports uninstall"| node_uninstall
node_main -.->|"configures entries"| node_shortcuts
node_uninstall -.->|"returns shared sessions"| node_session_sharing
node_main -.->|"sets platform profile"| node_apparmor
node_main -.->|"launches instance"| node_app

click node_main "https://github.com/lugia19/claude-webextension-launcher/blob/master/main.go"
click node_checklist "https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/checklist.go"
click node_setup "https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/setup.go"
click node_instance_ui "https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/instances.go"
click node_instance_ops "https://github.com/lugia19/claude-webextension-launcher/blob/master/instances.go"
click node_settings "https://github.com/lugia19/claude-webextension-launcher/blob/master/utils/settings.go"
click node_worker "https://github.com/lugia19/claude-webextension-launcher/blob/master/worker.go"
click node_status "https://github.com/lugia19/claude-webextension-launcher/blob/master/status/status.go"
click node_selfupdate "https://github.com/lugia19/claude-webextension-launcher/blob/master/selfupdate/selfupdate.go"
click node_uninstall "https://github.com/lugia19/claude-webextension-launcher/blob/master/uninstall.go"
click node_shortcuts "https://github.com/lugia19/claude-webextension-launcher/blob/master/shortcuts.go"
click node_session_sharing "https://github.com/lugia19/claude-webextension-launcher/blob/master/sessionsharing_windows.go"
click node_patcher "https://github.com/lugia19/claude-webextension-launcher/blob/master/patcher/patcher.go"
click node_asar "https://github.com/lugia19/claude-webextension-launcher/blob/master/asar/asar.go"
click node_windows_hash "https://github.com/lugia19/claude-webextension-launcher/blob/master/ClaudeDLL/ClaudeDLL/dllmain.cpp"
click node_extensions_runtime "https://github.com/lugia19/claude-webextension-launcher/blob/master/extensions/extensions.go"
click node_recovery "https://github.com/lugia19/claude-webextension-launcher/blob/master/extensions/recovery.go"
click node_injection "https://github.com/lugia19/claude-webextension-launcher/blob/master/resources/injections/generic/wrapper.js"
click node_sentinel "https://github.com/lugia19/claude-webextension-launcher/blob/master/resources/sentinel_extension/content.js"
click node_cowork "https://github.com/lugia19/claude-webextension-launcher/blob/master/patcher/cowork_windows.go"
click node_apparmor "https://github.com/lugia19/claude-webextension-launcher/blob/master/apparmor_linux.go"

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_main,node_checklist,node_setup,node_instance_ui,node_instance_ops,node_settings,node_user toneBlue
class node_app,node_patcher,node_asar,node_windows_hash toneAmber
class node_extensions_runtime,node_recovery,node_injection,node_sentinel toneMint
class node_worker,node_status,node_selfupdate,node_uninstall,node_shortcuts,node_session_sharing,node_cowork,node_apparmor toneRose
class node_github,node_claude_package toneIndigo
```

## Components

### Launcher and UI

- [Launcher entry](https://github.com/lugia19/claude-webextension-launcher/blob/master/main.go): `main.go`
- [Setup checklist](https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/checklist.go): `gui/checklist.go`
- [Setup screen](https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/setup.go): `gui/setup.go`
- [Instance list](https://github.com/lugia19/claude-webextension-launcher/blob/master/gui/instances.go): `gui/instances.go`
- [Instance management](https://github.com/lugia19/claude-webextension-launcher/blob/master/instances.go): `instances.go`
- [Launcher settings](https://github.com/lugia19/claude-webextension-launcher/blob/master/utils/settings.go): `utils/settings.go`

### Client patching

- **Claude Desktop**
- [Client patcher](https://github.com/lugia19/claude-webextension-launcher/blob/master/patcher/patcher.go): `patcher/patcher.go`
- [ASAR archive](https://github.com/lugia19/claude-webextension-launcher/blob/master/asar/asar.go): `asar/asar.go`
- [Integrity shim](https://github.com/lugia19/claude-webextension-launcher/blob/master/ClaudeDLL/ClaudeDLL/dllmain.cpp): `ClaudeDLL/ClaudeDLL/dllmain.cpp`

### Extensions

- [Extension updates](https://github.com/lugia19/claude-webextension-launcher/blob/master/extensions/extensions.go): `extensions/extensions.go`
- [Update recovery](https://github.com/lugia19/claude-webextension-launcher/blob/master/extensions/recovery.go): `extensions/recovery.go`
- [Extension injection](https://github.com/lugia19/claude-webextension-launcher/blob/master/resources/injections/generic/wrapper.js): `resources/injections/generic/wrapper.js`
- [Sentinel extension](https://github.com/lugia19/claude-webextension-launcher/blob/master/resources/sentinel_extension/content.js): `resources/sentinel_extension/content.js`

### Install lifecycle

- [Install worker](https://github.com/lugia19/claude-webextension-launcher/blob/master/worker.go): `worker.go`
- [Worker status](https://github.com/lugia19/claude-webextension-launcher/blob/master/status/status.go): `status/status.go`
- [Self-update](https://github.com/lugia19/claude-webextension-launcher/blob/master/selfupdate/selfupdate.go): `selfupdate/selfupdate.go`
- [Uninstall](https://github.com/lugia19/claude-webextension-launcher/blob/master/uninstall.go): `uninstall.go`
- [Shortcuts](https://github.com/lugia19/claude-webextension-launcher/blob/master/shortcuts.go): `shortcuts.go`
- [Session sharing](https://github.com/lugia19/claude-webextension-launcher/blob/master/sessionsharing_windows.go): `sessionsharing_windows.go`
- [Cowork service](https://github.com/lugia19/claude-webextension-launcher/blob/master/patcher/cowork_windows.go): `patcher/cowork_windows.go`
- [AppArmor profile](https://github.com/lugia19/claude-webextension-launcher/blob/master/apparmor_linux.go): `apparmor_linux.go`

### Other components

- **Launcher user**
- **GitHub releases**
- **Claude package source**

## Connections

- Launcher user → Launcher entry: starts
- Launcher entry → Setup checklist: shows setup
- Launcher entry → Setup screen: runs UI (evidence: `main.go`)
- Launcher entry → Instance list: offers instances
- Instance list → Instance management: requests actions
- Instance management → Launcher settings: stores preferences
- Launcher entry → Self-update: finishes update (evidence: `main.go`)
- Launcher entry → Install worker: starts worker (evidence: `main.go`)
- Launcher entry → Worker status: reads progress (evidence: `main.go`)
- Install worker → Worker status: reports progress (evidence: `worker.go`)
- Install worker → Client patcher: installs client (evidence: `worker.go`)
- Client patcher → ASAR archive: extracts archive (evidence: `patcher/patcher.go`)
- Client patcher → Claude package source: downloads package
- Client patcher → Claude Desktop: builds modified client
- Integrity shim → Claude Desktop: adjusts integrity hash (evidence: `ClaudeDLL/ClaudeDLL/dllmain.cpp`)
- Install worker → Extension updates: updates extensions (evidence: `worker.go`)
- Extension updates → GitHub releases: checks releases (evidence: `extensions/extensions.go`)
- Extension updates → Update recovery: recovers updates (evidence: `extensions/extensions.go`)
- Install worker → Sentinel extension: deploys extension (evidence: `worker.go`)
- Client patcher → Extension injection: embeds injection
- Install worker → Cowork service: registers service (evidence: `worker.go`)
- Launcher entry → Uninstall: supports uninstall
- Launcher entry → Shortcuts: configures entries
- Uninstall → Session sharing: returns shared sessions
- Launcher entry → AppArmor profile: sets platform profile
- Launcher entry → Claude Desktop: launches instance
