Introduction
Relevant source files
The following files were used as context for generating this wiki page:
Open Claude Cowork is an open-source desktop chat application built with Electron.js that facilitates end-to-end automation across work applications. It integrates the Claude Agent SDK and the Opencode SDK to provide advanced agentic capabilities, supported by the Composio Tool Router for accessing over 500 external tools such as Gmail, Slack, and GitHub. The system is designed to maintain persistent chat sessions and provides real-time tool call visualization and progress tracking.
Sources: README.md:1-25, package.json:1-20
System Architecture
The application follows a decoupled architecture consisting of a frontend Electron desktop application and a backend Node.js Express server. Communication between the frontend and backend is handled via standard HTTP requests and Server-Sent Events (SSE) for real-time response streaming.
Core Components
| Component | Responsibility |
|---|---|
| Electron Main Process | Manages the native window and system-level operations. |
| Renderer Process | Handles the UI, markdown rendering, and user interactions. |
| Express Server | Routes requests to AI providers and manages tool configurations. |
| AI Providers | Interfaces with Claude Agent SDK and Opencode SDK. |
| Composio Integration | Provides the Model Context Protocol (MCP) bridge to external tools. |
Sources: README.md:58-74, server/server.js:1-30
High-Level Data Flow
The following diagram illustrates the flow of a user message from the interface through the backend to the AI provider and back.
Sources: README.md:143-162, server/server.js:65-155
Backend Infrastructure
The backend, located in the server/ directory, acts as an intermediary between the user interface and the Large Language Model (LLM) providers. It is responsible for session management, tool configuration, and streaming data normalization.
Server Initialization and MCP Configuration
Upon startup, the server initializes a Composio session and automatically generates a Model Context Protocol (MCP) configuration. This configuration is written to server/opencode.json to enable tool access for the Opencode provider.
Sources: server/server.js:31-60, README.md:211-235
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/chat | POST | Primary endpoint for sending messages and receiving streamed responses. |
/api/abort | POST | Terminates an active streaming request for a specific chatId. |
/api/providers | GET | Returns a list of available AI providers. |
/api/health | GET | Backend status and provider availability check. |
Sources: server/server.js:65-195
AI Provider System
The application uses a pluggable provider system to support multiple SDKs. Each provider implements a standard interface for querying and aborting requests.
Claude Provider
The Claude Provider utilizes the @anthropic-ai/claude-agent-sdk. It supports specialized "Agent Skills" which are markdown-based instructions stored in .claude/skills/.
- Session Management: Uses built-in SDK session tracking via
resumeoptions. - Allowed Tools: Defaults include
Read,Write,Edit,Bash,WebSearch, andTodoWrite. - Setting Sources: Loads skills from both
userandprojectdirectories.
Sources: server/providers/claude-provider.js:10-100, README.md:164-210
Opencode Provider
The Opencode Provider routes to multiple LLM providers (e.g., GPT-5, Grok, GLM) through a single SDK. It supports extended thinking (reasoning parts) and event-based streaming.
Sources: README.md:175-188, renderer/renderer.js:45-60
Frontend and User Experience
The frontend is a vanilla JavaScript application rendered within Electron. It manages multi-chat state, file attachments, and real-time visualization of agent activity.
Interactive Tool Visualization
As the agent executes tools, the frontend displays "Inline Tool Calls" within the message stream and updates a "Progress" sidebar with a todo list generated by the TodoWrite tool.
State Management
Chat history and session preferences (selected provider/model) are persisted in localStorage. The application supports creating, switching, and deleting multiple chat sessions, each maintaining its own unique chatId.
Sources: renderer/renderer.js:80-150, renderer/renderer.js:230-260
Getting Started
A setup.sh script is provided to automate the installation of dependencies, configuration of API keys (Anthropic, Opencode, Composio), and initialization of the .env file.
Sources: setup.sh:1-110, README.md:88-105
Conclusion
Open Claude Cowork provides a robust framework for building and interacting with AI agents. By combining the Claude Agent SDK's reasoning capabilities with Composio's extensive toolset, it allows developers to automate complex workflows across a variety of desktop and web-based applications within a unified Electron environment.