# OpenHands - Deep Dive

> **TL;DR**: OpenHands (formerly OpenDevin) is an open-source platform for AI software development agents with 66,000+ stars. It lets you run autonomous AI agents that can write code, execute commands, browse the web, and complete development tasks - all controllable via CLI, GUI, or cloud. Think of it as an open-source Devin alternative that works with any LLM (Claude, GPT-4, Gemini, local models).

---

## What Is OpenHands?

**OpenHands** is a community-focused, open-source platform for building and running AI agents that autonomously handle software development tasks. Instead of relying on proprietary tools, you can:

- Run AI agents locally or at scale
- Use any LLM provider you prefer
- Customize agents for your workflows
- Deploy from laptop to enterprise Kubernetes

### The Core Philosophy

```
┌─────────────────────────────────────────────────────────────────────┐
│                    OPENHANDS PHILOSOPHY                              │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   "Code Less, Make More"                                            │
│                                                                     │
│   PROPRIETARY TOOLS                    OPENHANDS                    │
│   ├── Locked to one LLM                ├── Any LLM (Claude, GPT,   │
│   ├── Cloud-only                       │   Gemini, Ollama, etc.)   │
│   ├── Fixed pricing                    ├── Run anywhere            │
│   ├── Limited customization            ├── Pay only for LLM usage  │
│   └── Vendor lock-in                   ├── Fully customizable      │
│                                        └── MIT licensed             │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘
```

---

## Quick Stats

| Metric | Value |
|--------|-------|
| **GitHub Stars** | 66,100+ |
| **Forks** | 8,100+ |
| **Contributors** | 456 |
| **License** | MIT (core) |
| **Languages** | Python 77.7%, TypeScript 19.6% |
| **Default LLM** | Claude Opus 4.5 |
| **SWE-Bench Score** | 77.6% |

---

## Key Features

### 1. Multiple Interfaces

| Interface | Best For |
|-----------|----------|
| **CLI** | Quick tasks, terminal lovers |
| **Local GUI** | Visual interaction, desktop use |
| **Cloud Platform** | Team collaboration, no setup |
| **Python SDK** | Custom integrations, automation |

### 2. Full Development Capabilities

```
┌─────────────────────────────────────────────────────────────────────┐
│                    WHAT OPENHANDS CAN DO                             │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   CODE EXECUTION                                                    │
│   ├── Run bash commands                                             │
│   ├── Execute Python/IPython                                        │
│   ├── Run tests and builds                                          │
│   └── Background processes                                          │
│                                                                     │
│   FILE OPERATIONS                                                   │
│   ├── Create and edit files                                         │
│   ├── Navigate project structure                                    │
│   ├── String replacement editing                                    │
│   └── LLM-based intelligent editing                                 │
│                                                                     │
│   WEB INTERACTION                                                   │
│   ├── Browse documentation                                          │
│   ├── Search for information                                        │
│   ├── Visual web navigation                                         │
│   └── Read and analyze pages                                        │
│                                                                     │
│   PLANNING & REASONING                                              │
│   ├── Task decomposition                                            │
│   ├── Multi-step planning                                           │
│   ├── Progress tracking                                             │
│   └── Agent delegation                                              │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘
```

### 3. Multi-LLM Support

Works with any LLM via LiteLLM:

| Provider | Models |
|----------|--------|
| **Anthropic** | Claude Opus, Sonnet (default: Opus 4.5) |
| **OpenAI** | GPT-4, GPT-4 Turbo, GPT-3.5 |
| **Google** | Gemini Pro |
| **AWS** | Bedrock models |
| **Azure** | Azure OpenAI |
| **Local** | Ollama, any open-source model |

### 4. Secure Sandboxed Execution

```
┌─────────────────────────────────────────────────────────────────────┐
│                    RUNTIME SECURITY                                  │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   DOCKER RUNTIME (Default)                                          │
│   ├── Containerized isolation                                       │
│   ├── Dedicated container per session                               │
│   ├── Controlled environment access                                 │
│   └── Production-ready security                                     │
│                                                                     │
│   SECURITY ANALYZERS                                                │
│   ├── LLM Risk Analyzer - AI-based risk assessment                  │
│   ├── Invariant Analyzer - Secret/malicious command detection       │
│   └── Gray Swan API - Advanced external safety checks               │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘
```

---

## Agent Architecture

### EventStream-Based Design

```
┌─────────────────────────────────────────────────────────────────────┐
│                    OPENHANDS ARCHITECTURE                            │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   User Request                                                      │
│        ↓                                                            │
│   Agent Controller                                                  │
│        ↓                                                            │
│   Agent (CodeAct, Browsing, etc.)                                   │
│        ↓                                                            │
│   ┌─────────────────────────────────────────────────┐               │
│   │              EventStream                         │               │
│   │   (Central pub-sub messaging backbone)           │               │
│   └─────────────────────────────────────────────────┘               │
│        ↓                    ↓                    ↓                  │
│   LLM Broker           Runtime              State Manager          │
│   (LiteLLM)            (Docker/Local)       (History/Plans)        │
│        ↓                    ↓                    ↓                  │
│   Generate Action      Execute Action       Track Progress         │
│        ↓                    ↓                    ↓                  │
│   └─────────────── Observation ──────────────────┘                  │
│                          ↓                                          │
│                    Update State                                     │
│                          ↓                                          │
│                    Next Iteration                                   │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘
```

### Available Agents

| Agent | Purpose |
|-------|---------|
| **CodeAct** | Primary agent for all development tasks |
| **Browsing Agent** | Specialized for web navigation |
| **Visual Browsing** | Web interaction with visual context |
| **LOC Agent** | Code analysis and metrics |
| **Readonly Agent** | Safe inspection-only mode |

---

## Getting Started

### Option 1: OpenHands Cloud (Easiest)

```
1. Visit OpenHands Cloud
2. Sign in with GitHub
3. Get $10 free credit
4. Start using immediately
```

### Option 2: CLI

```bash
# Install
pip install openhands

# Configure (set your API key)
export OPENAI_API_KEY=your-key
# or
export ANTHROPIC_API_KEY=your-key

# Run
openhands
```

### Option 3: Docker

```bash
docker run -p 3000:3000 \
  -e LLM_API_KEY=your-key \
  openhands/openhands
```

### Option 4: Python SDK

```python
from openhands import OpenHands

# Initialize
agent = OpenHands(model="claude-opus-4-5-20251101")

# Run a task
result = agent.run("Create a Python function to parse JSON files")
```

---

## Use Cases

### 1. One-Off Development Tasks

```
"Generate documentation for this project"
"Create a REST API endpoint for user authentication"
"Write unit tests for the utils module"
```

### 2. Routine Maintenance

```
"Update all dependencies to latest versions"
"Fix the linting errors in src/"
"Refactor this function to be more efficient"
```

### 3. Complex Multi-Step Projects

```
"Implement a full CRUD API with database integration"
"Create a CLI tool with argument parsing and help text"
"Build a web scraper with rate limiting and error handling"
```

### 4. Code Execution & Verification

```
"Run the test suite and fix any failures"
"Build the project and resolve compilation errors"
"Profile this function and optimize the bottlenecks"
```

---

## Comparison with Alternatives

### vs. GitHub Copilot

| Aspect | OpenHands | Copilot |
|--------|-----------|---------|
| **Autonomy** | Full task completion | Code suggestions |
| **Execution** | Can run code | Suggestions only |
| **Interface** | CLI/GUI/API | IDE plugin |
| **Open Source** | Yes (MIT) | No |
| **Model Choice** | Any LLM | Fixed |

### vs. Cursor

| Aspect | OpenHands | Cursor |
|--------|-----------|--------|
| **Focus** | Autonomous tasks | Interactive coding |
| **Environment** | Sandboxed runtime | IDE |
| **Workflow** | Set and forget | Real-time collaboration |
| **Open Source** | Yes | No |

### vs. Devin

| Aspect | OpenHands | Devin |
|--------|-----------|-------|
| **Open Source** | Yes | No |
| **Self-Hosting** | Yes | No |
| **Model Choice** | Any LLM | Fixed |
| **Pricing** | Pay for LLM only | Subscription |
| **Customization** | Fully extensible | Limited |

---

## Cloud Platform Features

OpenHands Cloud adds:

| Feature | Description |
|---------|-------------|
| **$10 Free Credit** | Get started at no cost |
| **Integrations** | Slack, Jira, Linear, GitHub, GitLab |
| **Team Support** | Multi-user with RBAC |
| **Conversation Export** | Save and share sessions |
| **Public Sharing** | Share conversations publicly |

---

## Benchmarks

| Benchmark | Score |
|-----------|-------|
| **SWE-Bench** | 77.6% |
| **GAIA** | Multi-step reasoning |
| **Commit0** | Function implementation |
| **WebArena** | Web navigation |

---

## History: OpenDevin → OpenHands

The project was originally called **OpenDevin** and was renamed to **OpenHands** in August 2024 to establish its own identity as a community-driven project.

---

## How This Connects to Our Other Deep Dives

| Deep Dive | Connection |
|-----------|------------|
| **CCPM** | Both orchestrate AI agents for development |
| **Agentic Design Patterns** | OpenHands implements many of these patterns |
| **Context Engineering** | OpenHands uses context management for tasks |
| **MCP Servers** | Could integrate MCP for tool access |
| **Vibe Kanban** | Different approach to multi-agent orchestration |

---

## Key Links

| Resource | URL |
|----------|-----|
| GitHub | https://github.com/OpenHands/OpenHands |
| Cloud Platform | https://www.openhands.ai/ |
| Documentation | https://docs.openhands.ai/ |
| SDK | https://github.com/OpenHands/software-agent-sdk |

---

## Bottom Line

OpenHands represents the **open-source future of AI-assisted development**.

**Why it matters**:
- No vendor lock-in (use any LLM)
- Run anywhere (laptop to Kubernetes)
- Full autonomy (not just suggestions)
- Community-driven (66k+ stars, 456 contributors)

**The key insight**: AI coding assistants shouldn't be walled gardens. OpenHands proves that autonomous AI development can be open, customizable, and accessible to everyone.

For our repository focused on AI-assisted development, OpenHands is a cornerstone tool - it's what happens when you take the principles we've been exploring and build a complete, production-ready platform around them.

---

*Document created: January 2026*
*Sources: [GitHub - OpenHands](https://github.com/OpenHands/OpenHands), [OpenHands Documentation](https://docs.openhands.ai/), [OpenHands Cloud](https://www.openhands.ai/)*
