This is a submission for the OpenClaw Writing Challenge
The creator of OpenClaw, Peter Steinberger, shared an “aha” moment he had with the agent. In the early days, OpenClaw only supported text input, but one day he sent a voice note without thinking. The agent wasn’t supposed to understand audio, yet it replied.
His reaction was simple: “How the f*ck did it do that?”
The agent explained that it received a file it didn’t recognize, inspected the file header, and discovered it was an Opus audio file. It then used ffmpeg to convert it to WAV, found Peter’s OpenAI API key, and sent the audio to Whisper using curl to transcribe it.
Peter had not built any transcription capability into the system. The agent figured it out.
This is what a self-improving system looks like. An AI agent that can extend its own capabilities without being explicitly programmed to do so. In this article, we’ll take that idea further by building a self-improving plugin for OpenClaw.
The Idea Behind Self-Improving Agents
The holy grail of software engineering is simple: software that can improve itself. If a user wants a new feature, the software adds it. If there’s a bug, it fixes it. If there’s a security vulnerability, it finds and patches it.
This is the idea behind self-improvement, also known as Recursive Self-Improvement (RSI).
What could make this possible is AI agents. Today, developers already use agents to write code, debug systems, and automate workflows. The next step is obvious: embedding these agents inside software systems so they can improve themselves autonomously.
This is the philosophy behind OpenClaw. OpenClaw has access to its own source code, its documentation, and the environment it runs in. In many ways, it has the context needed to reason about itself.
That means, in theory, it can modify and extend its own capabilities based on user interactions.
Plugins as a Path to Self-Improvement
The idea of OpenClaw improving itself is compelling. But anyone familiar with the current state of AI agents knows that letting an agent directly modify its own source code is a risky move.
So we take a different approach.
Instead of having the agent update its core codebase, we let it operate through plugins.
OpenClaw is built around a plugin architecture, where new features can be added as extensions. Rather than rewriting itself, the agent can create a plugin and iteratively improve it over time, updating the plugin’s code based on user requests.
Building a Plugin
Before we demonstrate self-improvement, let’s first build a simple plugin manually. Our plugin will live inside the agent’s workspace, located at ~/.openclaw/workspace.
Start by creating a directory for the plugin:
cd ~/.openclaw/workspace
mkdir self_improve_plugin
cd self_improve_plugin
Initialize it as a Node.js project:
npm init -y
Install the required dependencies:
npm install typescript ts-node --save-dev
npm install openclaw @sinclair/typebox
Initialize the TypeScript configuration:
npx tsc --init
Next, update your package.json. Set the project to use ES modules and add the OpenClaw configuration:
{
"name": "self_improve_plugin",
"version": "1.0.0",
"type": "module",
"devDependencies": {
"ts-node": "^10.9.2",
"typescript": "^6.0.3"
},
"dependencies": {
"@sinclair/typebox": "^0.34.49",
"openclaw": "^2026.4.24"
},
"openclaw": {
"extensions": ["./index.ts"],
"compat": {
"pluginApi": ">=2026.3.24-beta.2",
"minGatewayVersion": "2026.3.24-beta.2"
},
"build": {
"openclawVersion": "2026.3.24-beta.2",
"pluginSdkVersion": "2026.3.24-beta.2"
}
}
}
Now define the plugin manifest in openclaw.plugin.json:
{
"id": "self_improve_plugin",
"name": "Self Improve Plugin",
"description": "A plugin that the OpenClaw agent can use to improve itself.",
"configSchema": {
"type": "object",
"additionalProperties": false
}
}
Next, implement the plugin logic in index.ts:
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { Type } from "@sinclair/typebox";
export default definePluginEntry({
id: "self_improve_plugin",
name: "Self Improve Plugin",
description: "A plugin that the OpenClaw agent can use to improve itself.",
register(api) {
api.registerTool({
name: "reverse_text",
description: "Reverse a text string.",
parameters: Type.Object({ text: Type.String() }),
async execute(_id, params) {
const reversed = params.text.split("").reverse().join("");
return { content: [{ type: "text", text: reversed }] };
},
});
},
});
We’ve created a simple plugin that registers a tool called reverse_text, which reverses a string.
Install the plugin:
openclaw plugins install .
Then restart the gateway:
openclaw gateway
OpenClaw installs plugins into ~/.openclaw/extensions.
Improving the Plugin with OpenClaw
Now let’s see how the agent can improve this plugin.
First, we ask the agent to locate the plugin in the workspace:
It successfully finds the source code. Next, we test the reverse_text tool to confirm it works:
Now we push it further.
We ask the agent to add a new tool that counts how many times a character appears in a string:
The agent updates the plugin:
api.registerTool({
name: "count_character",
description: "Count how many times a character appears in a string.",
parameters: Type.Object({
text: Type.String(),
character: Type.String({ minLength: 1, maxLength: 1 }),
}),
async execute(_id, params) {
const count = [...params.text].filter(
(char) => char === params.character
).length;
return { content: [{ type: "text", text: String(count) }] };
},
});
Next, we instruct the agent to install the updated plugin:
Even when a mistake is made in the command, the agent inspects the terminal output, identifies the issue, and suggests the correct command.
The installation fails again because the plugin already exists in ~/.openclaw/extensions.
We then instruct the agent to remove the existing version:
After that, we ask it to install the updated version and restart the gateway:
Once everything is up, we can instruct the agent to use the new tool.
At this point, we’ve demonstrated a self-improving plugin. The agent can iteratively extend it by adding new tools, refining existing ones, or even introducing more advanced capabilities like model providers, hooks, or new interaction channels.
The key idea is this: the agent isn’t modifying its core system. It’s evolving through a controlled extension point.
That constraint is what makes this approach powerful without breaking the system.
Let’s Make This a Skill
So far, everything we’ve done has been manual. We created the plugin, installed it, and updated it step by step, but this entire workflow is repeatable. That means we can take it one step further by turning it into a skill, where we encode these steps once and let the agent handle the rest.
With this skill, the agent can set up everything for us, starting from generating the boilerplate in the workspace to installing and updating the plugin whenever needed.
You can find the skill here.
We then create a directory for the skill:
mkdir -p ~/.openclaw/workspace/skills/self-improving-plugin-skill
Within this directory, we add the SKILL.md file, and after restarting the gateway, the agent will have access to the skill and can execute the entire workflow on its own.
Conclusion
The idea of self-improving software has always sounded powerful but difficult to control, especially if it involves directly modifying a system’s core code. What this approach shows is that self-improvement does not have to be risky to be useful. By constraining the agent to operate through plugins, we give it a safe and structured way to evolve, and by packaging the entire workflow into a skill, we make that evolution repeatable.
At that point, the interaction changes from manually building features to simply describing what you want. The agent handles the implementation, installation, and iteration behind the scenes, turning OpenClaw into a system that doesn’t just respond to requests but actively builds and improves itself based on them.
This article was originally published by DEV Community and written by Youdiowei Eteimorde.
Read original article on DEV Community




