# mr-destroyer/zim-claude architecture

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

- Interactive diagram: https://gitdiagram.com/mr-destroyer/zim-claude
- Repository: https://github.com/mr-destroyer/zim-claude

## Overview

zim-claude is a cross-platform launcher that preserves Claude Code’s command-line interface while routing its model traffic through a local LiteLLM proxy. The main workflow is user → launcher → Claude Code → CLI proxy → Token Juice → upstream model; the launcher starts the proxy when needed. A separate Claude Desktop gateway runs on port 4002, alongside the CLI proxy on port 4000. The README documents these relationships; source excerpts were unavailable, so the graph does not infer undocumented calls or configuration links.

Main entry points: [`scripts/zim-claude`](https://github.com/mr-destroyer/zim-claude/blob/main/scripts/zim-claude) (zim-claude launcher), [`windows/start-proxies.ps1`](https://github.com/mr-destroyer/zim-claude/blob/main/windows/start-proxies.ps1) (Windows proxy manager), [`scripts/start-litellm.sh`](https://github.com/mr-destroyer/zim-claude/blob/main/scripts/start-litellm.sh) (CLI proxy manager), [`claude-desktop-integration/start-desktop-proxy.sh`](https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/start-desktop-proxy.sh) (Desktop proxy starter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_launcher["zim-claude launcher"]
  node_claude["Claude Code"]
end

subgraph group_proxy["Proxy services"]
  node_climanager["CLI proxy manager<br/>[start-litellm.sh]"]
  node_cliconfig["CLI proxy config"]
  node_cliproxy["LiteLLM CLI proxy"]
  node_tokenjuice["Token Juice"]
end

subgraph group_desktop["Desktop gateway"]
  node_desktopconfig["Desktop proxy config"]
  node_desktopsettings["Desktop settings"]
  node_desktopproxy["Desktop gateway"]
  node_desktopstarter["Desktop proxy starter"]
end

subgraph group_windows["Windows runtime"]
  node_winlauncher["Windows launcher<br/>[zim-claude.ps1]"]
  node_winproxy["Windows proxy manager<br/>[start-proxies.ps1]"]
end

node_user(("User"))
node_model["Upstream model"]
node_desktopuser(("Claude Desktop"))

node_user -->|"runs"| node_launcher
node_launcher -->|"forwards arguments"| node_claude
node_launcher -->|"starts on demand"| node_climanager
node_claude -->|"sends requests"| node_cliproxy
node_climanager -->|"manages"| node_cliproxy
node_cliproxy -->|"routes requests"| node_tokenjuice
node_tokenjuice -->|"forwards requests"| node_model
node_desktopuser -->|"connects to"| node_desktopproxy
node_desktopstarter -->|"starts"| node_desktopproxy
node_winlauncher -->|"forwards arguments"| node_claude
node_winproxy -->|"starts CLI proxy"| node_cliproxy
node_winproxy -->|"starts gateway"| node_desktopproxy

click node_launcher "https://github.com/mr-destroyer/zim-claude/blob/main/scripts/zim-claude"
click node_winlauncher "https://github.com/mr-destroyer/zim-claude/blob/main/windows/zim-claude.ps1"
click node_winproxy "https://github.com/mr-destroyer/zim-claude/blob/main/windows/start-proxies.ps1"
click node_climanager "https://github.com/mr-destroyer/zim-claude/blob/main/scripts/start-litellm.sh"
click node_cliconfig "https://github.com/mr-destroyer/zim-claude/blob/main/config/litellm-config.yaml"
click node_desktopconfig "https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/litellm-config.desktop.yaml"
click node_desktopsettings "https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/managed-settings.json"
click node_desktopstarter "https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/start-desktop-proxy.sh"

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_launcher,node_claude,node_user toneBlue
class node_climanager,node_cliconfig,node_cliproxy,node_tokenjuice toneAmber
class node_desktopconfig,node_desktopsettings,node_desktopproxy,node_desktopstarter toneMint
class node_winlauncher,node_winproxy toneRose
class node_model,node_desktopuser toneIndigo
```

## Components

### CLI workflow

- [zim-claude launcher](https://github.com/mr-destroyer/zim-claude/blob/main/scripts/zim-claude): `scripts/zim-claude`
- **Claude Code**

### Proxy services

- [CLI proxy manager](https://github.com/mr-destroyer/zim-claude/blob/main/scripts/start-litellm.sh): `scripts/start-litellm.sh`
- [CLI proxy config](https://github.com/mr-destroyer/zim-claude/blob/main/config/litellm-config.yaml): `config/litellm-config.yaml`
- **LiteLLM CLI proxy**
- **Token Juice**

### Desktop gateway

- [Desktop proxy config](https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/litellm-config.desktop.yaml): `claude-desktop-integration/litellm-config.desktop.yaml`
- [Desktop settings](https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/managed-settings.json): `claude-desktop-integration/managed-settings.json`
- **Desktop gateway**
- [Desktop proxy starter](https://github.com/mr-destroyer/zim-claude/blob/main/claude-desktop-integration/start-desktop-proxy.sh): `claude-desktop-integration/start-desktop-proxy.sh`

### Windows runtime

- [Windows launcher](https://github.com/mr-destroyer/zim-claude/blob/main/windows/zim-claude.ps1): `windows/zim-claude.ps1`
- [Windows proxy manager](https://github.com/mr-destroyer/zim-claude/blob/main/windows/start-proxies.ps1): `windows/start-proxies.ps1`

### Other components

- **User**
- **Upstream model**
- **Claude Desktop**

## Connections

- User → zim-claude launcher: runs (evidence: `README.md`)
- zim-claude launcher → Claude Code: forwards arguments (evidence: `README.md`)
- zim-claude launcher → CLI proxy manager: starts on demand (evidence: `README.md`)
- Claude Code → LiteLLM CLI proxy: sends requests (evidence: `README.md`)
- CLI proxy manager → LiteLLM CLI proxy: manages (evidence: `README.md`)
- LiteLLM CLI proxy → Token Juice: routes requests (evidence: `README.md`)
- Token Juice → Upstream model: forwards requests (evidence: `README.md`)
- Claude Desktop → Desktop gateway: connects to (evidence: `README.md`)
- Desktop proxy starter → Desktop gateway: starts (evidence: `README.md`)
- Windows launcher → Claude Code: forwards arguments (evidence: `README.md`)
- Windows proxy manager → LiteLLM CLI proxy: starts CLI proxy (evidence: `README.md`)
- Windows proxy manager → Desktop gateway: starts gateway (evidence: `README.md`)
