Project Structure
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Open Claude Cowork project is a desktop-based chat application designed to provide agentic AI capabilities through a native interface. The architecture is split into a frontend desktop client built with Electron.js and a backend Node.js server that manages AI providers, sessions, and tool integrations. The system is designed to be modular, supporting multiple AI SDKs (Claude Agent SDK and Opencode SDK) and external tool orchestration via the Composio Tool Router.
The project emphasizes real-time interaction through Server-Sent Events (SSE) and persistent session management, allowing users to maintain context across multiple chat instances while leveraging over 500 external tools for task automation.
Sources: README.md:1-50, package.json:1-20
High-Level Architecture
The application follows a decoupled client-server model. The Electron-based frontend handles the user interface, markdown rendering, and local state management, while the backend server manages the complex logic of communicating with LLM providers and executing tool calls.
The diagram illustrates the separation between the Electron frontend processes and the Node.js backend services.
Sources: README.md:130-155, server/server.js:1-50
Frontend Structure (Electron)
The frontend is built using Electron, utilizing a multi-process architecture consisting of a Main process and a Renderer process bridged by a secure Preload script.
1. Main Process (main.js)
The entry point of the application, responsible for window management and native system interactions.
Sources: package.json:4
2. Preload Bridge (preload.js)
This script acts as a security layer, exposing specific backend communication functions to the renderer process via contextBridge. It handles:
- Client-side Abort: Cancelling ongoing HTTP requests using
AbortController. - API Communication: Wrapping fetch calls to the
/api/chatand/api/abortendpoints. - Stream Reading: Providing a custom reader interface for processing SSE chunks.
Sources: preload.js:1-100
3. Renderer Process (renderer/)
The renderer manages the UI logic and real-time display updates. Key components include:
index.html: Defines the UI structure, including sidebars for chat history and task progress.renderer.js: Orchestrates UI state, handles file attachments, and implements the streaming handler for AI responses.style.css: Provides a modern, dark-themed interface inspired by Claude.ai.
Sources: renderer/index.html:1-200, renderer/renderer.js:1-100, renderer/style.css:1-50
Backend Structure (Node.js)
The backend is a standalone Express server located in the server/ directory. It acts as a gateway between the frontend and various AI services.
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/chat | POST | Main streaming endpoint for chat messages and tool execution. |
/api/abort | POST | Cancels an active AI query for a specific chatId. |
/api/providers | GET | Returns a list of configured and available AI providers. |
/api/health | GET | Returns the server status and provider health. |
Sources: server/server.js:63-200
Provider System
The backend utilizes a pluggable provider architecture to support different SDKs:
- Claude Provider: Implements the
@anthropic-ai/claude-agent-sdkfor agentic capabilities and session management. - Opencode Provider: Uses the
@opencode-ai/sdkto route to multiple LLM providers (GPT, Grok, etc.).
Sources: server/providers/claude-provider.js:1-50, server/providers/opencode-provider.js:1-50
Data Flow: Chat and Tool Execution
The system uses a complex streaming flow to ensure the UI remains responsive while the AI processes multi-turn conversations and tool calls.
Sequence of events during a standard chat request involving tool execution.
Sources: renderer/renderer.js:640-750, server/server.js:90-150, server/providers/claude-provider.js:60-120
Project File Map
The physical layout of the repository separates concerns between configuration, frontend, and backend environments.
| Path | Purpose |
|---|---|
main.js | Electron main process configuration. |
preload.js | IPC security bridge and API wrapper. |
renderer/ | Frontend assets (HTML, JS, CSS). |
server/ | Node.js Express backend and AI provider logic. |
server/providers/ | Pluggable AI SDK implementations. |
.claude/skills/ | Markdown-based skill definitions for the AI agent. |
setup.sh | Automation script for dependency installation and API configuration. |
Sources: README.md:214-239, setup.sh:1-120
Summary
The Open Claude Cowork project structure is designed for extensibility and performance. By separating the AI provider logic into a dedicated backend server, the application can support various SDKs while maintaining a consistent user experience in the Electron frontend. The integration of Composio as a tool router through MCP (Model Context Protocol) further enables the AI to interact with external environments, all managed through a robust streaming and session persistence layer.
Sources: README.md:130-140, server/server.js:20-40