Agent skill

Openhands SDK

by OpenHands in OpenHands/extensions

Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software.

MITAuto-check passedAI & LLM Engineering

Install Openhands SDK

skills CLI
$ npx skills add OpenHands/extensions --skill openhands-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenHands/extensions openhands-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenHands/extensions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/openhands-sdk .claude/skills/openhands-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openhands-sdk
GitHub stars
157
Token cost
~6.9k tokens
SKILL.md length
1,120 words
Files
6
Skills in repo
78
Repo updated
First seen
Licence
MIT

At a glance

Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software.

  • You need to build agents with the SDK
  • SKILL.md covers Quick reference, Core classes (openhands.sdk), API reference and Guides, plus 1 more section
  • Calls pip; needs LLM_API_KEY
  • Create custom tools

What it does

Openhands SDK is an agent skill from OpenHands/extensions. Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software. Use when you need to build agents with the SDK, create custom tools, configure LLMs, manage conversations, delegate to sub-agents, or deploy agents locally or remotely.

Its SKILL.md is about 6.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files (for example `.plugin/plugin.json`, `README.md` and `commands/sdk.md`).

It sits in AI & LLM Engineering, covering Building AI agents and Subagents. It works with Python. The repository describes itself as: Public registry for OpenHands extensions. The licence is MIT.

When your agent uses it

  • You need to build agents with the SDK
  • Create custom tools
  • Manage conversations
  • Delegate to sub-agents

Example prompts

  • “/openhands-sdk”

Requirements

  • Python 3
  • Docker
  • A credential in LLM_API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit d008b81. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • docs.openhands.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LLM_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Openhands SDK loads about 6.9k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 1,120 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~6.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OpenHands/extensions at commit d008b81, republished under its MIT licence (© OpenHands). 1,120 words, ~6,888 tokens.

Download SKILL.mdSave it as .claude/skills/openhands-sdk/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
openhands-sdk
description
Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software. Use when you need to build agents with the SDK, create custom tools, configure LLMs, manage conversations, delegate to sub-agents, or deploy agents locally or remotely.
triggers
openhands-sdk, openhands sdk, software-agent-sdk, agent-sdk, /sdk

OpenHands Software Agent SDK

All SDK documentation lives at https://docs.openhands.dev/sdk.

For the full topic index, fetch https://docs.openhands.dev/llms.txt and read the "OpenHands Software Agent SDK" section.

Quick reference

Install: pip install openhands-sdk openhands-tools

python
import os

from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool


llm = LLM(
    model=os.getenv("LLM_MODEL", "gpt-5.5"),
    api_key=os.getenv("LLM_API_KEY"),
    base_url=os.getenv("LLM_BASE_URL", None),
)

agent = Agent(
    llm=llm,
    tools=[
        Tool(name=TerminalTool.name),
        Tool(name=FileEditorTool.name),
        Tool(name=TaskTrackerTool.name),
    ],
)

cwd = os.getcwd()
conversation = Conversation(agent=agent, workspace=cwd)

conversation.send_message("Write 3 facts about the current project into FACTS.txt.")
conversation.run()
print("All done!")

Core classes (openhands.sdk)

ClassPurpose
AgentReasoning-action loop
CondenserConversation history compression system
ConversationConversation orchestration system
EventTyped event framework
LLMProvider-agnostic language model interface
SecurityAnalyzerAction security analysis and validation
SkillReusable prompt system
Tool / ToolDefinitionAction-observation tool framework
WorkspaceExecution environment abstraction

API reference

openhands.sdk.agent, openhands.sdk.conversation, openhands.sdk.event, openhands.sdk.llm, openhands.sdk.security, openhands.sdk.tool, openhands.sdk.utils, openhands.sdk.workspace

Guides

  • ACP Agent: Delegate to an ACP-compatible server (Claude Code, Gemini CLI, etc.) instead of calling an LLM directly.
  • Agent Settings: Configure, serialize, and recreate agents from structured settings.
  • Agent Skills & Context: Skills add specialized behaviors, domain knowledge, and context-aware triggers to your agent through structured prompts.
  • API-based Sandbox: Connect to hosted API-based agent server for fully managed infrastructure.
  • Apptainer Sandbox: Run agent server in rootless Apptainer containers for HPC and shared computing environments.
  • Ask Agent Questions: Get sidebar replies from the agent during conversation execution without interrupting the main flow.
  • Ask Oracle: Let an agent consult a saved Oracle LLM profile for stateless second-opinion advice.
  • Assign Reviews: Automate PR management with intelligent reviewer assignment and workflow notifications using OpenHands Agent
  • Browser Session Recording: Record and replay your agent's browser sessions using rrweb.
  • Browser Use: Enable web browsing and interaction capabilities for your agent.
  • Context Condenser: Manage agent memory by condensing conversation history to save tokens.
  • Conversation Goals: Add a resumable goal strategy to a normal agent-server conversation.
  • Conversation with Async: Use async/await for concurrent agent operations and non-blocking execution.
  • Creating Custom Agent: Learn how to design specialized agents with custom tool sets
  • Critic (Experimental): Real-time evaluation of agent actions using an LLM-based critic model, with built-in iterative refinement.
  • Custom Tools: Tools define what agents can do. The SDK includes built-in tools for common operations and supports creating custom tools for specialized needs.
  • Custom Tools with Remote Agent Server: Learn how to use custom tools with a remote agent server by building a custom base image that includes your tool implementations.
  • Custom Visualizer: Customize conversation visualization by creating custom visualizers or configuring the default visualizer.
  • Deferred Init (Warm-Pool): Pre-warm agent-server pods before a user is matched, then activate them at runtime with POST /api/init.
  • Docker Sandbox: Run agent server in isolated Docker containers for security and reproducibility.
  • Exception Handling: Provider‑agnostic exceptions raised by the SDK and recommended patterns for handling them.
  • FAQ: Frequently asked questions about the OpenHands SDK
  • File-Based Agents: Define specialized sub-agents as simple Markdown files with YAML frontmatter — no Python code required.
  • Fork a Conversation: Branch off an existing conversation for follow-up exploration without contaminating the original.
  • Getting Started: Install the OpenHands SDK and build AI agents that write software.
  • Goal Completion Loop: Drive a conversation toward a verifiable objective with a judge-driven, self-continuing completion loop.
  • GPT-5 Preset (ApplyPatchTool): Use the GPT-5 preset to build an agent that swaps the standard FileEditorTool for ApplyPatchTool.
  • Hello World: The simplest possible OpenHands agent - configure an LLM, create an agent, and complete a task.
  • Hooks: Use lifecycle hooks to observe, log, and customize agent execution.
  • Image Input: Send images to multimodal agents for vision-based tasks and analysis.
  • Interactive Terminal: Enable agents to interact with terminal applications like ipython, python REPL, and other interactive CLI tools.
  • Iterative Refinement: Implement iterative refinement workflows where agents refine their work based on critique feedback until quality thresholds are met.
  • LLM Fallback Strategy: Automatically try alternate LLMs when the primary model fails with a transient error.
  • LLM Profile Store: Save, load, and manage reusable LLM configurations so you never repeat setup code again.
  • LLM Registry: Dynamically select and configure language models using the LLM registry.
  • LLM Streaming: Stream LLM responses token-by-token for real-time display and interactive user experiences.
  • LLM Subscriptions: Use your ChatGPT Plus/Pro subscription to access Codex models without consuming API credits.
  • Local Agent Server: Install and run an OpenHands Agent Server on your machine, then connect to it from the SDK.
  • Metrics Tracking: Track token usage, costs, and latency metrics for your agents.
  • Model Context Protocol: Model Context Protocol (MCP) enables dynamic tool integration from external servers. Agents can discover and use MCP-provided tools automatically.
  • Model Routing: Route agent's LLM requests to different models.
  • Observability & Tracing: Enable OpenTelemetry tracing to monitor and debug your agent's execution with tools like Laminar, MLflow, Honeycomb, or any OTLP-compatible backend.
  • OpenAI-Compatible Endpoint: Call an OpenHands agent-server through the OpenAI Chat Completions or Responses protocol.
  • OpenHands Cloud Workspace: Connect to OpenHands Cloud for fully managed sandbox environments with optional SaaS credential inheritance.
  • Overview: Run agents on remote servers with isolated workspaces for production deployments.
  • Parallel Tool Execution: Execute multiple tools concurrently within a single LLM response to improve throughput for independent operations.
  • Pause and Resume: Pause agent execution, perform operations, and resume without losing state.
  • Persistence: Save and restore conversation state for multi-session workflows.
  • Persistent Memory: Give agents opt-in, two-tier memory that survives across conversations.
  • Plugins: Plugins bundle skills, hooks, MCP servers, agents, and commands into reusable packages that extend agent capabilities.
  • PR Review: Use OpenHands Agent to generate meaningful pull request review
  • Reasoning: Access model reasoning traces from Anthropic extended thinking and OpenAI responses API.
  • Secret Registry: Provide environment variables and secrets to agent workspace securely.
  • Security & Action Confirmation: Control agent action execution through confirmation policy and security analyzer.
  • Send Message While Running: Interrupt running agents to provide additional context or corrections.
  • Software Agent SDK: Build AI agents that write software. A clean, modular SDK with production-ready tools.
  • Structured Output: Attach a schema to any tool so the LLM returns typed, validated fields alongside the tool's own arguments.
  • Stuck Detector: Detect and handle stuck agents automatically with timeout mechanisms.
  • Task Tool Set: Delegate complex work to specialized sub-agents that run synchronously and return results to the parent agent.
  • Task-Based Model Routing: Let the agent pick the best saved LLM profile for the task at hand with the built-in route_task_to_model tool.
  • Theory of Mind (TOM) Agent: Enable your agent to understand user intent and preferences through Theory of Mind capabilities, providing personalized guidance based on user modeling.
  • TODO Management: Implement TODOs using OpenHands Agent
Show full SKILL.md (97 more words)Show less

Examples

Source: examples/

01_standalone_sdk/
02_remote_agent_server/
03_github_workflows/
04_llm_specific_tools/
05_skills_and_plugins/

© OpenHands, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in skills/openhands-sdk of OpenHands/extensions.

  • SKILL.md
  • .claude-plugin
  • .codex-plugin
  • .plugin/plugin.json
  • README.md
  • commands/sdk.md

Open the folder on GitHubat commit d008b81

Compare with similar skills

Openhands SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openhands SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openhands SDK this skillOpenHands/extensions157—~6.9kAutomated safety check: PassMIT
Pydantic AI Harnesspydantic/pydantic-ai20k—~4.9kAutomated safety check: PassMIT
Agent BuildershareAI-lab/lab-skills314—~1.4kAutomated safety check: PassApache-2.0
Agent Harness BuilderFareedKhan-dev/claude-code-from-scratch298—~1.1kAutomated safety check: PassMIT
Deep Agents Corelangchain-ai/langchain-skills1.3k1 repos~3.1kAutomated safety check: PassMIT
Agent BuildershareAI-lab/learn-claude-code78k6 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Pydantic AI Harness

    pydantic/pydantic-ai

    Official

    Adds optional capabilities to Pydantic AI agents from pydantic-ai-harness, led by Code Mode, which runs many tool calls as one sandboxed Python script.

    20k GitHub stars~4.9k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Agent Builder

    shareAI-lab/lab-skills

    Helps design and build AI agents for any domain around a minimal loop of capabilities, knowledge and context, adding planning or subagents only when needed.

    314 GitHub stars~1.4k tokensUpdated 21 days ago
    AI & LLM EngineeringAuto-check passed
  • Agent Harness Builder

    FareedKhan-dev/claude-code-from-scratch

    Gives patterns, a tool design checklist and an architecture decision tree for building agent harnesses, tools and multi-agent setups around a model.

    298 GitHub stars~1.1k tokensUpdated 6 mo ago
    AI & LLM EngineeringAuto-check passed
  • Deep Agents Core

    langchain-ai/langchain-skills

    Official

    Explains how to build agents with the Deep Agents framework: create_deep_agent, the built-in middleware, the harness, SKILL.md format and configuration options.

    1.3k GitHub starsUsed in 1 repo~3.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 6 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    AI & LLM EngineeringAuto-check passed

More from OpenHands/extensions

All 78 skills in this repo
  • Agent Readiness Report

    OpenHands/extensions

    Evaluate how well a codebase supports autonomous AI-assisted development.

    157 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Discord

    OpenHands/extensions

    Build and automate Discord integrations (bots, webhooks, slash commands, and REST API workflows).

    157 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • GitHub

    OpenHands/extensions

    Interact with GitHub repositories, pull requests, issues, and workflows using the GITHUBTOKEN environment variable and GitHub CLI.

    157 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • GitHub Issue To PR

    OpenHands/extensions

    Create an automation that implements GitHub issues when a configurable trigger label is applied.

    157 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • GitHub Repo Monitor

    OpenHands/extensions

    This skill should be used when the user asks to "monitor a GitHub repository", "watch GitHub for issues or PRs", "respond to @OpenHands mentions on GitHub", "set up an OpenHands GitHub integration"…

    157 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • GitLab Issue To Mr

    OpenHands/extensions

    Create an automation that implements GitLab issues when a configurable trigger label is applied.

    157 GitHub stars~4.9k tokensUpdated today
    Auto-check passed

Works with

Questions about Openhands SDK

What does Openhands SDK do?

Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software. Openhands SDK is an agent skill from OpenHands/extensions. Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software.

When should I use Openhands SDK?

Openhands SDK fits situations like: you need to build agents with the SDK; create custom tools; manage conversations; delegate to sub-agents.

How do I install Openhands SDK in Claude Code?

Run `npx skills add OpenHands/extensions --skill openhands-sdk -a claude-code`. Or copy the skill folder (skills/openhands-sdk in OpenHands/extensions) into .claude/skills/openhands-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Openhands SDK in Codex?

Run `npx skills add OpenHands/extensions --skill openhands-sdk -a codex`. Or copy the skill folder (skills/openhands-sdk in OpenHands/extensions) into .agents/skills/openhands-sdk in your project. Codex loads it when a task matches its description.

Can I use Openhands SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenHands/extensions --skill openhands-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openhands-sdk, .gemini/skills/openhands-sdk, .github/skills/openhands-sdk and .opencode/skills/openhands-sdk in your project.

What does Openhands SDK need to run?

Going by SKILL.md and its folder, Openhands SDK needs the command-line tools its instructions call (pip) and credentials named LLM_API_KEY. Our summary lists: Python 3; Docker; A credential in LLM_API_KEY.

Does Openhands SDK access the network?

SKILL.md names 2 domains. As links in the text: github.com and docs.openhands.dev. This is read from the text; nothing was executed.

Is Openhands SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Openhands SDK use?

Openhands SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openhands SDK use?

About 6.9k tokens (SKILL.md is roughly 28k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Openhands SDK?

Skills that share tags, products or a category with Openhands SDK: Pydantic AI Harness (pydantic/pydantic-ai, 20k stars), Agent Builder (shareAI-lab/lab-skills, 314 stars), Agent Harness Builder (FareedKhan-dev/claude-code-from-scratch, 298 stars) and Deep Agents Core (langchain-ai/langchain-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openhands SDK?

OpenHands (a GitHub organization) maintains it in OpenHands/extensions, which has 157 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 6, 2026.

Source: OpenHands/extensions on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.