# epiccoleman/claude-automator architecture

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

- Interactive diagram: https://gitdiagram.com/epiccoleman/claude-automator
- Repository: https://github.com/epiccoleman/claude-automator

## Overview

This small automation library attaches to a running Claude Desktop session over CDP, sends a message through the chat UI, and returns detected response text. Its main workflow is exposed by ClaudeDesktopAutomation; connection management and chat-page interactions are internal responsibilities in the same source file. The README also documents starting a new conversation and querying page status. The graph reflects the sampled implementation; it does not model the separate example, debug, or test scripts.

Main entry points: [`claude-automation.js`](https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js) (Automation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("API caller"))
node_automation["Automation API"]
node_cdp["Playwright CDP"]
node_desktop["Claude Desktop"]
node_chat_ui["Chat UI actions"]
node_response["Response detection"]

node_user -->|"calls API"| node_automation
node_automation -->|"connects via CDP"| node_cdp
node_cdp -->|"attaches to"| node_desktop
node_automation -->|"sends message"| node_chat_ui
node_chat_ui -->|"waits for reply"| node_response
node_response -->|"returns text"| node_automation
node_automation -->|"starts conversation"| node_chat_ui

click node_automation "https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js"
click node_chat_ui "https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js"
click node_response "https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js"

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_user,node_automation toneMint
class node_cdp,node_desktop toneIndigo
class node_chat_ui toneBlue
class node_response toneTeal
```

## Components

### Other components

- **API caller**
- [Automation API](https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js): `claude-automation.js`
- **Playwright CDP**
- **Claude Desktop**
- [Chat UI actions](https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js): `claude-automation.js`
- [Response detection](https://github.com/epiccoleman/claude-automator/blob/main/claude-automation.js): `claude-automation.js`

## Connections

- API caller → Automation API: calls API (evidence: `README.md`)
- Automation API → Playwright CDP: connects via CDP (evidence: `claude-automation.js`)
- Playwright CDP → Claude Desktop: attaches to (evidence: `README.md`)
- Automation API → Chat UI actions: sends message (evidence: `claude-automation.js`)
- Chat UI actions → Response detection: waits for reply (evidence: `claude-automation.js`)
- Response detection → Automation API: returns text (evidence: `claude-automation.js`)
- Automation API → Chat UI actions: starts conversation (evidence: `claude-automation.js`)
