# a6083450/clawgod-plus architecture

> Architecture diagram of the GitHub repository a6083450/clawgod-plus, 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/a6083450/clawgod-plus
- Repository: https://github.com/a6083450/clawgod-plus

## Overview

ClawGod Plus modifies Claude Code’s embedded JavaScript and runs the patched CLI with Bun. The main flow is installation or update, extraction of the vendor CLI, selection and application of patches, then launch through the runtime wrapper. The graph also preserves documented provider, voice, plugin-compatibility, and feature-gating capabilities. Several runtime connections are documented in the README rather than shown in sampled call sites; those links cite the README, and unsampled implementation details are not inferred.

Main entry points: [`src/generic/runtime`](https://github.com/a6083450/clawgod-plus/tree/main/src/generic/runtime) (Install and Update), [`src/generic/runtime/wrapper.cjs`](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/wrapper.cjs) (CLI Wrapper), [`src/generic/patcher/entry.mjs`](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/entry.mjs) (Patch Entry), [`src/generic/patcher/registry.mjs`](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/registry.mjs) (Patch Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_install["Install and Update"]
  node_installer["Install and Update"]
  node_extractor["CLI Extractor<br/>[extractor.mjs]"]
  node_vendor_tx["Vendor Transaction"]
  node_repatcher["Update Repatcher<br/>[repatcher.mjs]"]
end

subgraph group_patch["Patch System"]
  node_enhancement_config["Enhancement Selection"]
  node_patch_entry["Patch Entry<br/>[entry.mjs]"]
  node_registry["Patch Registry<br/>[registry.mjs]"]
  node_patch_core["Core Patches<br/>[core.mjs]"]
  node_enhancements["Enhancement Patches"]
  node_runtime_features["Feature Gates"]
end

subgraph group_runtime["Runtime and Providers"]
  node_wrapper["CLI Wrapper<br/>[wrapper.cjs]"]
  node_patched_cli["Patched Claude CLI"]
  node_openai_proxy["OpenAI Proxy<br/>[openai-proxy.cjs]"]
  node_fallback["Patch Fallback<br/>[patch-fallback.cjs]"]
  node_proxy_fetch["Proxy-aware Fetch<br/>[proxy-fetch.mjs]"]
end

subgraph group_capabilities["Runtime Capabilities"]
  node_computer_chrome["Computer Use and Chrome"]
  node_voice["Voice ASR"]
  node_mem_compat["claude-mem Compatibility"]
  node_hud["HUD Status Line"]
  node_plugin_deps["Plugin Dependencies"]
  node_provider_import["Provider Import<br/>[main.rs]"]
end

node_user(("Operator"))
node_bun(("Bun Runtime"))
node_vendor(("Claude Code Package"))

node_user -->|"starts install"| node_installer
node_vendor -->|"provides package"| node_extractor
node_installer -.->|"extracts CLI"| node_extractor
node_installer -.->|"manages vendor"| node_vendor_tx
node_installer -.->|"invokes patching"| node_patch_entry
node_user -->|"selects enhancements"| node_enhancement_config
node_enhancement_config -->|"resolves selection"| node_patch_entry
node_patch_entry -->|"creates selection"| node_registry
node_registry -->|"loads core patches"| node_patch_core
node_registry -->|"loads enhancements"| node_enhancements
node_enhancements -->|"uses AST helpers"| node_patch_core
node_enhancements -->|"embeds feature gates"| node_runtime_features
node_patch_entry -->|"patches CLI"| node_patched_cli
node_patched_cli -->|"runs through"| node_wrapper
node_user -->|"launches CLI"| node_wrapper
node_wrapper -->|"configures proxy"| node_openai_proxy
node_wrapper -->|"uses fallback"| node_fallback
node_wrapper -.->|"sets feature gates"| node_runtime_features
node_repatcher -->|"uses transactions"| node_vendor_tx
node_installer -.->|"downloads through"| node_proxy_fetch
node_proxy_fetch -->|"spawns worker"| node_bun
node_computer_chrome -->|"enhances CLI"| node_patched_cli
node_voice -->|"provides ASR adapter"| node_patched_cli
node_mem_compat -->|"reuses provider setup"| node_patched_cli
node_hud -.->|"provides status line"| node_patched_cli
node_plugin_deps -.->|"ensures plugin dependencies"| node_patched_cli
node_provider_import -.->|"imports provider configuration"| node_patched_cli

click node_installer "https://github.com/a6083450/clawgod-plus/tree/main/src/generic/runtime"
click node_extractor "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/extractor.mjs"
click node_vendor_tx "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/vendor-transaction.mjs"
click node_repatcher "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/repatcher.mjs"
click node_enhancement_config "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/enhancement-config.mjs"
click node_patch_entry "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/entry.mjs"
click node_registry "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/registry.mjs"
click node_patch_core "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/core.mjs"
click node_enhancements "https://github.com/a6083450/clawgod-plus/tree/main/src/generic/patcher/enhancements"
click node_runtime_features "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/runtime-features.mjs"
click node_wrapper "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/wrapper.cjs"
click node_openai_proxy "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/openai-proxy.cjs"
click node_fallback "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/patch-fallback.cjs"
click node_proxy_fetch "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/proxy-fetch.mjs"
click node_computer_chrome "https://github.com/a6083450/clawgod-plus/tree/main/src/generic/patcher/enhancements"
click node_voice "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/enhancements/voice-asr-cometix.js"
click node_mem_compat "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/claude-mem-compat.cjs"
click node_hud "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/claude-hud-statusline.mjs"
click node_plugin_deps "https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/plugin-dependencies.mjs"
click node_provider_import "https://github.com/a6083450/clawgod-plus/blob/main/tools/provider-import/src/main.rs"

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_installer,node_extractor,node_vendor_tx,node_repatcher toneBlue
class node_enhancement_config,node_patch_entry,node_registry,node_patch_core,node_enhancements,node_runtime_features toneAmber
class node_wrapper,node_patched_cli,node_openai_proxy,node_fallback,node_proxy_fetch toneMint
class node_computer_chrome,node_voice,node_mem_compat,node_hud,node_plugin_deps,node_provider_import toneRose
class node_user,node_bun,node_vendor toneIndigo
```

## Components

### Install and Update

- [Install and Update](https://github.com/a6083450/clawgod-plus/tree/main/src/generic/runtime): `src/generic/runtime`
- [CLI Extractor](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/extractor.mjs): `src/generic/runtime/extractor.mjs`
- [Vendor Transaction](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/vendor-transaction.mjs): `src/generic/runtime/vendor-transaction.mjs`
- [Update Repatcher](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/repatcher.mjs): `src/generic/runtime/repatcher.mjs`

### Patch System

- [Enhancement Selection](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/enhancement-config.mjs): `src/generic/enhancement-config.mjs`
- [Patch Entry](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/entry.mjs): `src/generic/patcher/entry.mjs`
- [Patch Registry](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/registry.mjs): `src/generic/patcher/registry.mjs`
- [Core Patches](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/core.mjs): `src/generic/patcher/core.mjs`
- [Enhancement Patches](https://github.com/a6083450/clawgod-plus/tree/main/src/generic/patcher/enhancements): `src/generic/patcher/enhancements`
- [Feature Gates](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/runtime-features.mjs): `src/generic/patcher/runtime-features.mjs`

### Runtime and Providers

- [CLI Wrapper](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/wrapper.cjs): `src/generic/runtime/wrapper.cjs`
- **Patched Claude CLI**
- [OpenAI Proxy](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/openai-proxy.cjs): `src/generic/runtime/openai-proxy.cjs`
- [Patch Fallback](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/patch-fallback.cjs): `src/generic/runtime/patch-fallback.cjs`
- [Proxy-aware Fetch](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/proxy-fetch.mjs): `src/generic/runtime/proxy-fetch.mjs`

### Runtime Capabilities

- [Computer Use and Chrome](https://github.com/a6083450/clawgod-plus/tree/main/src/generic/patcher/enhancements): `src/generic/patcher/enhancements`
- [Voice ASR](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/patcher/enhancements/voice-asr-cometix.js): `src/generic/patcher/enhancements/voice-asr-cometix.js`
- [claude-mem Compatibility](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/claude-mem-compat.cjs): `src/generic/runtime/claude-mem-compat.cjs`
- [HUD Status Line](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/claude-hud-statusline.mjs): `src/generic/runtime/claude-hud-statusline.mjs`
- [Plugin Dependencies](https://github.com/a6083450/clawgod-plus/blob/main/src/generic/runtime/plugin-dependencies.mjs): `src/generic/runtime/plugin-dependencies.mjs`
- [Provider Import](https://github.com/a6083450/clawgod-plus/blob/main/tools/provider-import/src/main.rs): `tools/provider-import/src/main.rs`

### Other components

- **Operator**
- **Bun Runtime**
- **Claude Code Package**

## Connections

- Operator → Install and Update: starts install
- Claude Code Package → CLI Extractor: provides package
- Install and Update → CLI Extractor: extracts CLI
- Install and Update → Vendor Transaction: manages vendor (evidence: `src/generic/runtime/repatcher.mjs`)
- Install and Update → Patch Entry: invokes patching
- Operator → Enhancement Selection: selects enhancements
- Enhancement Selection → Patch Entry: resolves selection (evidence: `src/generic/patcher/entry.mjs`)
- Patch Entry → Patch Registry: creates selection (evidence: `src/generic/patcher/entry.mjs`)
- Patch Registry → Core Patches: loads core patches (evidence: `src/generic/patcher/registry.mjs`)
- Patch Registry → Enhancement Patches: loads enhancements (evidence: `src/generic/patcher/registry.mjs`)
- Enhancement Patches → Core Patches: uses AST helpers (evidence: `src/generic/patcher/enhancements/cometix.mjs`)
- Enhancement Patches → Feature Gates: embeds feature gates (evidence: `src/generic/patcher/enhancements/cometix.mjs`)
- Patch Entry → Patched Claude CLI: patches CLI
- Patched Claude CLI → CLI Wrapper: runs through
- Operator → CLI Wrapper: launches CLI
- CLI Wrapper → OpenAI Proxy: configures proxy (evidence: `src/generic/runtime/wrapper.cjs`)
- CLI Wrapper → Patch Fallback: uses fallback (evidence: `src/generic/runtime/wrapper.cjs`)
- CLI Wrapper → Feature Gates: sets feature gates
- Update Repatcher → Vendor Transaction: uses transactions (evidence: `src/generic/runtime/repatcher.mjs`)
- Install and Update → Proxy-aware Fetch: downloads through (evidence: `src/generic/runtime/install-ripgrep.mjs`)
- Proxy-aware Fetch → Bun Runtime: spawns worker (evidence: `src/generic/runtime/proxy-fetch.mjs`)
- Computer Use and Chrome → Patched Claude CLI: enhances CLI
- Voice ASR → Patched Claude CLI: provides ASR adapter
- claude-mem Compatibility → Patched Claude CLI: reuses provider setup
- HUD Status Line → Patched Claude CLI: provides status line
- Plugin Dependencies → Patched Claude CLI: ensures plugin dependencies
- Provider Import → Patched Claude CLI: imports provider configuration
