# terryspov/claudeclaw-plus architecture

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

- Interactive diagram: https://gitdiagram.com/terryspov/claudeclaw-plus
- Repository: https://github.com/terryspov/claudeclaw-plus

## Overview

ClaudeClaw+ is a multi-channel Claude daemon that routes inbound work through an event bus to isolated agents, then returns replies to their origin. Its documented product layers include policy and human approval, governance and model routing, resumable orchestration, persistent memory, MCP sharing, operator UI, and skill tuning. The excerpts and source index establish several module relationships; other branches and detailed dispatch paths are represented only where the README explicitly documents them.

Main entry points: [`src/bus/session-agent-process.ts`](https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/session-agent-process.ts) (Agent processes), [`src/bus/core.ts`](https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/core.ts) (Typed event bus), [`src/gateway/index.ts`](https://github.com/terryspov/claudeclaw-plus/blob/main/src/gateway/index.ts) (Event gateway), [`src/adapters`](https://github.com/terryspov/claudeclaw-plus/tree/main/src/adapters) (Channel adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime &amp; agents"]
  node_bus["Typed event bus<br/>[core.ts]"]
  node_gateway["Event gateway<br/>[index.ts]"]
  node_sessionmgr["Agent sessions<br/>[session-manager.ts]"]
  node_agentproc["Agent processes"]
  node_config["Runtime settings<br/>[config.ts]"]
end

subgraph group_channels["Channels &amp; UI"]
  node_channels["Channel adapters"]
  node_webui["Web UI<br/>[index.ts]"]
  node_ui["Operator dashboard<br/>[server.ts]"]
end

subgraph group_controls["Governance &amp; policy"]
  node_policy["Policy engine<br/>[engine.ts]"]
  node_approval["Approval queue<br/>[approval-queue.ts]"]
  node_governance["Budget controls<br/>[budget-engine.ts]"]
  node_modelroute["Model routing<br/>[model-router.ts]"]
  node_escalation["Human escalation"]
end

subgraph group_capabilities["Jobs &amp; integrations"]
  node_orchestrator["Workflow DAGs<br/>[task-graph.ts]"]
  node_mcp["MCP multiplexer<br/>[http-handler.ts]"]
  node_plugins["Plugin system<br/>[plugins.ts]"]
end

subgraph group_improvement["Memory &amp; tuning"]
  node_memory[("Persistent memory<br/>[memory.ts]")]
  node_tuner["Skill tuner<br/>[engine.ts]"]
  node_wisecron["Wisecron tuner"]
end

node_operator(("Operator"))
node_claude["Claude runtime"]
node_mcpservers["Shared MCP servers"]

node_channels -->|"publish events"| node_bus
node_webui -->|"publish events"| node_bus
node_bus -->|"dispatches events"| node_agentproc
node_sessionmgr -->|"spawns and supervises"| node_agentproc
node_agentproc -->|"runs agent process"| node_claude
node_agentproc -->|"publishes replies"| node_bus
node_bus -->|"routes replies"| node_channels
node_channels -->|"normalizes inbound events"| node_gateway
node_gateway -->|"checks policy"| node_policy
node_gateway -->|"handles denials"| node_escalation
node_operator -->|"reviews requests"| node_approval
node_policy -->|"gates privileged calls"| node_approval
node_agentproc -->|"uses shared tools"| node_mcp
node_mcp -->|"fronts servers"| node_mcpservers
node_governance -->|"enforces budgets"| node_modelroute
node_ui -->|"fires jobs"| node_orchestrator
node_agentproc -->|"uses cross-session memory"| node_memory
node_operator -->|"manages daemon"| node_ui
node_config -->|"configures runtime"| node_bus
node_tuner -.->|"supports tuning workflow"| node_wisecron

click node_channels "https://github.com/terryspov/claudeclaw-plus/tree/main/src/adapters"
click node_webui "https://github.com/terryspov/claudeclaw-plus/blob/main/src/adapters/webui/index.ts"
click node_bus "https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/core.ts"
click node_gateway "https://github.com/terryspov/claudeclaw-plus/blob/main/src/gateway/index.ts"
click node_sessionmgr "https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/session-manager.ts"
click node_agentproc "https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/session-agent-process.ts"
click node_policy "https://github.com/terryspov/claudeclaw-plus/blob/main/src/policy/engine.ts"
click node_approval "https://github.com/terryspov/claudeclaw-plus/blob/main/src/policy/approval-queue.ts"
click node_governance "https://github.com/terryspov/claudeclaw-plus/blob/main/src/governance/budget-engine.ts"
click node_modelroute "https://github.com/terryspov/claudeclaw-plus/blob/main/src/governance/model-router.ts"
click node_escalation "https://github.com/terryspov/claudeclaw-plus/tree/main/src/escalation"
click node_orchestrator "https://github.com/terryspov/claudeclaw-plus/blob/main/src/orchestrator/task-graph.ts"
click node_memory "https://github.com/terryspov/claudeclaw-plus/blob/main/src/memory.ts"
click node_mcp "https://github.com/terryspov/claudeclaw-plus/blob/main/src/plugins/mcp-multiplexer/http-handler.ts"
click node_plugins "https://github.com/terryspov/claudeclaw-plus/blob/main/src/plugins.ts"
click node_ui "https://github.com/terryspov/claudeclaw-plus/blob/main/src/ui/server.ts"
click node_tuner "https://github.com/terryspov/claudeclaw-plus/blob/main/src/skills-tuner/core/engine.ts"
click node_wisecron "https://github.com/terryspov/claudeclaw-plus/tree/main/src/tuner/wisecron"
click node_config "https://github.com/terryspov/claudeclaw-plus/blob/main/src/config.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_bus,node_gateway,node_sessionmgr,node_agentproc,node_config toneBlue
class node_channels,node_webui,node_ui toneAmber
class node_policy,node_approval,node_governance,node_modelroute,node_escalation,node_mcpservers toneMint
class node_orchestrator,node_mcp,node_plugins toneRose
class node_memory,node_tuner,node_wisecron,node_operator,node_claude toneIndigo
```

## Components

### Runtime & agents

- [Typed event bus](https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/core.ts): `src/bus/core.ts`
- [Event gateway](https://github.com/terryspov/claudeclaw-plus/blob/main/src/gateway/index.ts): `src/gateway/index.ts`
- [Agent sessions](https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/session-manager.ts): `src/bus/session-manager.ts`
- [Agent processes](https://github.com/terryspov/claudeclaw-plus/blob/main/src/bus/session-agent-process.ts): `src/bus/session-agent-process.ts`
- [Runtime settings](https://github.com/terryspov/claudeclaw-plus/blob/main/src/config.ts): `src/config.ts`

### Channels & UI

- [Channel adapters](https://github.com/terryspov/claudeclaw-plus/tree/main/src/adapters): `src/adapters`
- [Web UI](https://github.com/terryspov/claudeclaw-plus/blob/main/src/adapters/webui/index.ts): `src/adapters/webui/index.ts`
- [Operator dashboard](https://github.com/terryspov/claudeclaw-plus/blob/main/src/ui/server.ts): `src/ui/server.ts`

### Governance & policy

- [Policy engine](https://github.com/terryspov/claudeclaw-plus/blob/main/src/policy/engine.ts): `src/policy/engine.ts`
- [Approval queue](https://github.com/terryspov/claudeclaw-plus/blob/main/src/policy/approval-queue.ts): `src/policy/approval-queue.ts`
- [Budget controls](https://github.com/terryspov/claudeclaw-plus/blob/main/src/governance/budget-engine.ts): `src/governance/budget-engine.ts`
- [Model routing](https://github.com/terryspov/claudeclaw-plus/blob/main/src/governance/model-router.ts): `src/governance/model-router.ts`
- [Human escalation](https://github.com/terryspov/claudeclaw-plus/tree/main/src/escalation): `src/escalation`

### Jobs & integrations

- [Workflow DAGs](https://github.com/terryspov/claudeclaw-plus/blob/main/src/orchestrator/task-graph.ts): `src/orchestrator/task-graph.ts`
- [MCP multiplexer](https://github.com/terryspov/claudeclaw-plus/blob/main/src/plugins/mcp-multiplexer/http-handler.ts): `src/plugins/mcp-multiplexer/http-handler.ts`
- [Plugin system](https://github.com/terryspov/claudeclaw-plus/blob/main/src/plugins.ts): `src/plugins.ts`

### Memory & tuning

- [Persistent memory](https://github.com/terryspov/claudeclaw-plus/blob/main/src/memory.ts): `src/memory.ts`
- [Skill tuner](https://github.com/terryspov/claudeclaw-plus/blob/main/src/skills-tuner/core/engine.ts): `src/skills-tuner/core/engine.ts`
- [Wisecron tuner](https://github.com/terryspov/claudeclaw-plus/tree/main/src/tuner/wisecron): `src/tuner/wisecron`

### Other components

- **Operator**
- **Claude runtime**
- **Shared MCP servers**

## Connections

- Channel adapters → Typed event bus: publish events
- Web UI → Typed event bus: publish events
- Typed event bus → Agent processes: dispatches events
- Agent sessions → Agent processes: spawns and supervises (evidence: `src/bus/session-manager.ts`)
- Agent processes → Claude runtime: runs agent process
- Agent processes → Typed event bus: publishes replies
- Typed event bus → Channel adapters: routes replies
- Channel adapters → Event gateway: normalizes inbound events (evidence: `src/gateway/index.ts`)
- Event gateway → Policy engine: checks policy (evidence: `src/gateway/index.ts`)
- Event gateway → Human escalation: handles denials (evidence: `src/gateway/index.ts`)
- Operator → Approval queue: reviews requests
- Policy engine → Approval queue: gates privileged calls
- Agent processes → MCP multiplexer: uses shared tools
- MCP multiplexer → Shared MCP servers: fronts servers
- Budget controls → Model routing: enforces budgets (evidence: `src/governance/model-router.ts`)
- Operator dashboard → Workflow DAGs: fires jobs (evidence: `src/ui/server.ts`)
- Agent processes → Persistent memory: uses cross-session memory
- Operator → Operator dashboard: manages daemon
- Runtime settings → Typed event bus: configures runtime
- Skill tuner → Wisecron tuner: supports tuning workflow
