OpenClaw for Developers: The Ultimate Guide
Meta description: Learn how to build, extend, and customize OpenClaw in 2026. This developer guide covers the CLI, skills creation, API reference, plugin architecture, and best practices.
OpenClaw for Developers: The Ultimate Guide
If you're a developer looking to go beyond basic setup, this guide is for you. OpenClaw isn't just an AI agent you install and forget — it's a fully extensible platform with a CLI, a skill authoring system, an API layer, and a plugin architecture that lets you bend it to your will. Whether you want to automate your own workflows, build skills for the community, or integrate OpenClaw into your existing toolchain, this article walks through everything you need.
This guide is for developers who want to unlock OpenClaw's full potential. Let's dive in.
What OpenClaw Offers for Developers
OpenClaw is built on a three-layer architecture that separates concerns cleanly:
- Gateway Layer — Handles routing, authentication, and session management across devices and protocols.
- Agent Layer — Runs the core AI reasoning loop (a 7-stage agentic cycle that: receives → plans → retrieves context → executes tools → validates → responds → learns).
- Skills Layer — Self-contained packages that extend OpenClaw's capabilities using a simple
SKILL.mdconvention.
That third layer is where developers spend most of their time, and it's the most powerful part of the system.
Getting Started with the OpenClaw CLI
The OpenClaw CLI is your primary interface for configuration, skill management, and debugging. Install it via npm:
npm install -g openclaw-cli
Core commands every developer should know:
openclaw gateway status # Check if the daemon is running
openclaw gateway start # Start the gateway
openclaw gateway stop # Stop the gateway
openclaw skills list # Show installed skills
openclaw skills install <id> # Install a skill from the registry
openclaw skills create # Scaffold a new skill
openclaw logs # Stream agent logs
The gateway runs as a background service on port 18789 by default. You can override this with environment variables:
GATEWAY_PORT=3000 openclaw gateway start
For remote access (e.g., connecting a mobile companion app), configure the public URL:
openclaw gateway config set gateway.remote.url https://your-public-url.com
Building Custom Skills: The SKILL.md Format
Skills are the fundamental unit of extensibility in OpenClaw. A skill is a directory with a SKILL.md file that declares:
- name — Unique identifier
- description — What the skill does
- triggers — Phrases or patterns that activate the skill
- instructions — What the agent should do when triggered
Here's a minimal skill structure:
my-custom-skill/
├── SKILL.md # Skill manifest
├── scripts/ # Optional helper scripts
└── references/ # Documentation or data files
Example SKILL.md:
---
name: daily-standup
description: Generate a daily standup report from your task list
triggers:
- "run standup"
- "daily summary"
- "what did I work on"
---
# Daily Standup Skill
When triggered, this skill:
1. Queries your task tracker (Jira, Linear, etc.)
2. Extracts tickets completed since last standup
3. Formats them into a standup report
4. Reads it aloud via TTS if requested
The agent reads SKILL.md at startup and uses the triggers array to match incoming messages. When a trigger matches, the skill's instructions guide the agent's behavior.
Publishing a Skill
Once your skill is working, you can publish it to ClawHub:
npx clawhub publish --skill ./my-custom-skill
This bundles the skill and uploads it to the registry, making it installable by other OpenClaw users with:
openclaw skills install <your-skill-id>
OpenClaw API Reference: Key Endpoints
OpenClaw exposes a REST API via its gateway. Here are the key endpoints developers should know:
Session Management
| Endpoint | Method | Description |
|---|---|---|
/api/sessions | GET | List all sessions |
/api/sessions/:id | GET | Get session details |
/api/sessions/:id/messages | POST | Send a message to a session |
Skills
| Endpoint | Method | Description |
|---|---|---|
/api/skills | GET | List installed skills |
/api/skills/:id | GET | Get skill details |
/api/skills/:id/config | PUT | Update skill configuration |
Gateway
| Endpoint | Method | Description |
|---|---|---|
/api/gateway/status | GET | Gateway health check |
/api/gateway/config | GET | Current gateway configuration |
Authenticate API requests using a bootstrap token found in your ~/.openclaw/config.json:
curl -H "Authorization: Bearer <your-token>" \
http://localhost:18789/api/gateway/status
Extending OpenClaw with Plugins
While skills define behavior (what the agent does), plugins define capabilities (what the agent can do). Plugins hook into the agent's runtime via lifecycle events.
Plugin Entry Point
// plugins/my-plugin/index.ts
export default {
name: 'my-plugin',
version: '1.0.0',
// Called when the agent starts
onInit(agent) {
agent.registerHandler('before_tool_call', async (ctx) => {
console.log('Tool call incoming:', ctx.tool);
});
},
// Called after each agent cycle
onCycleComplete(agent, cycle) {
console.log('Cycle completed in', cycle.durationMs, 'ms');
}
};
Plugin Configuration
Plugins are registered in ~/.openclaw/config.json:
{
"plugins": {
"entries": {
"my-plugin": {
"enabled": true,
"config": {
"optionA": "value"
}
}
}
}
}
Advanced: Building Multi-Agent Systems
OpenClaw supports spawning sub-agents for parallel or specialized work. This is covered in detail in the OpenClaw Automation Ideas article, but the core API looks like this:
const subAgent = await agent.spawn({
name: 'research-agent',
goal: 'Research competitor pricing for our category',
model: 'openrouter/anthropic/claude-3-5-sonnet',
maxSteps: 20
});
const result = await subAgent.run();
Sub-agents inherit your workspace context and can be used for parallel research, code generation, content creation pipelines, or any task that benefits from isolation.
Developer Best Practices
- Keep SKILL.md focused — One skill, one responsibility. If a skill is doing too much, split it.
- Use environment variables for secrets — Never hardcode API keys in skill files. Use
process.env.YOUR_KEYand document required env vars in the skill's README. - Test skills in isolation — Run
openclaw skills test <skill-id>to validate triggers and behavior without going through the full agent loop. - Log thoughtfully — The agent's log stream (
openclaw logs) is your primary debugging surface. Emit structured JSON for machine-readable logs. - Respect rate limits — When skills call external APIs, batch requests and respect
429responses. - Version your skills — Use semver in your
SKILL.mdmetadata and document breaking changes. - Read the source — OpenClaw is open-source. The codebase at github.com/openclaw/openclaw is well-documented and a great reference.
OpenClaw Developer FAQ
How do I debug a skill that's not triggering?
Run openclaw logs and watch for messages tagged with your skill name. Also verify the trigger phrases appear exactly in your SKILL.md — partial matches don't fire. You can add a test trigger like "DEBUG: test" during development.
Can I use OpenClaw as a backend for my own app? Yes. The gateway exposes a full REST API with session management, tool execution, and skill configuration. Authenticate with your bootstrap token.
What's the difference between a skill and a plugin? Skills define behavior patterns — what the agent should do when triggered. Plugins define runtime hooks — how to intercept and extend the agent's execution cycle. Most developers only need skills.
How do I contribute to OpenClaw core?
Check the OpenClaw GitHub for open issues tagged good-first-issue. The project welcomes contributions in docs, skills, plugins, and core bug fixes.
Does OpenClaw support custom models?
Yes. Configure model overrides in ~/.openclaw/config.json under agents.defaults. You can specify any OpenRouter model by its provider/model ID string.
Get Started Building with OpenClaw
OpenClaw's developer surface is deeper than most AI agent platforms. The CLI gives you operational control, the skill system gives you behavioral extensibility, the plugin architecture gives you runtime hooks, and the API gives you programmatic access to everything.
Start small: write one skill that automates a single task in your workflow. Then another. Before long, you'll have a personalized AI agent that's far more capable than anything off the shelf.
If you found this guide useful, check out the OpenClaw Getting Started Guide for initial setup, or browse the Best OpenClaw Plugins to see what's already built.
Last updated: 2026-04-12



