▶️YouTube

I Built a Safer OpenClaw Alternative Using Claude Code

Cole Medin·youtube.com·14 min read·Mar 28

Select text to create a clip

Transcript — click timestamp to jump, select text to highlight

171 segments
have never seen a project blow up as much as OpenClaw. It is the personal AI assistant right
now, and people are loving it because it feels like the first agent that truly gets you. And
over time, it builds up a memory of what you're working on and your preferences. And it is a
fully open source tool. And so this is the GitHub repository. They exploded up to 185,000 stars. I
have not seen a repository on GitHub with this many stars. It even beats out N8N now, which is
just crazy to me. But it's no secret that there are a lot of security issues with OpenClaw,
both because of how much control we're giving to the underlying agent and because of some issues
with the code base itself. So that plus wanting to build something more custom to me has inspired me
to basically build my own version of OpenClaw. And that's what I want to talk to you about today,
because it's easier than you would think to take the ideas that really make OpenClaw feel magical
and build it for yourself. I was able to replicate everything that's powerful about OpenClaw in just
a couple of days, just took me a couple thousand lines of Python code and a markdown. And so I'll
talk about how I did it. You can do this yourself pretty easily. And honestly, I encourage you to do
that. I think the balance we should strike here is we should learn from these powerful open source
assistants that are out in the wild, but build something ourself. So we truly understand and control the
solution and we can customize it to our liking. Now there are already some open source solutions
that are a lightweight and secure version of OpenClaw like NanoClaw, but this just didn't
check all the boxes that I want for my own personal assistant slash second brain. That's why I'm building
my own. Now I don't have a repo to share with you like OpenClaw, but it would kind of defeat the purpose
of this video anyway. I'm trying to make a point here that you should build your own, take inspiration
from these other tools like OpenClaw. That's what I want to show you how to do right now. Now I have
already shared some of the skills that I have for my second brain. So there's a video I did on my
channel that I'll link to right here. If you want to check that out, I will be sharing a lot more on
my channel in the coming months as I continue to build out my assistant as well. So definitely stay
tuned for that. So anyway, I want to really quickly cover some of these security issues with OpenClaw.
Then we'll get into what are the beautiful parts of the tool? How can we take it for ourselves to build
our own second brain? And so there are two primary lanes of security issues with OpenClaw. I'm going
to focus first on some of the architecture issues with the code base. Recently, there was a one-click
remote code execution vulnerability that allows attackers to steal all of your data and keys from
your OpenClaw instance. All they have to do is get you to click on a single malicious link, which
it's pretty easy to get a lot of different people to click on malicious links. And then once they do that,
then it's going to send an auth token. Their OpenClaw will send an auth token back to the
attacker. They can use that to log into the victim's OpenClaw. And because all the credentials
are just stored in plain text, they will now have access to all of the API keys and tokens for
your platform adapters and other things that you've given your personal assistant access to.
And then we also have the issue with ClawHub. This is a marketplace that is publicly available
where people are publishing skills that promise to extend the capabilities of OpenClaw. But
research found that there are hundreds of malicious packages. And so it's this beautiful
concept that people can share these ways to make OpenClaw more powerful. But in reality,
it falls apart because there are a ton out there where really they're just stealing your API keys,
wallet, private keys, SSH credentials, the list goes on. Because again, everything is just stored
in plain text where you're hosting OpenClaw. And also, I've been doing a lot of research. So I'll
have links to all this in the description, by the way. But there was a researcher where it took him
fewer than two hours to hijack an OpenClaw instance, get access to everything inside.
Now, the one thing that I will say is that the creator of OpenClaw, Peter, he really is doing a
good job keeping up with the security issues, adding new features to OpenClaw. And so I do have hope
that there is a good future for the tool. But even if you address all of these architecture
problems, like I'm speaking to, I do think that OpenClaw will still be a security nightmare,
as Cisco puts it. And that's because of that second lane of security problems that I am talking about.
There is this massive code base. OpenClaw is pretty big. We don't understand it. And we're just running
it and trusting it, but it's giving so much power to our agents. And that I think is just so dangerous.
Most people are not ready for their agent to wield all the power that OpenClaw gives it. So that's
why I'm a proponent of building your own solution, because then you truly understand and control what
your agent is doing. And you can customize it to the exact level of control that you need for your
agent. And so don't get me wrong, like Cisco says here, from a capability perspective, OpenClaw is
groundbreaking. That's why I want to use it as a reference point for building the memory system and
proactive part of the agent. It's everything that personal AI system developers have wanted to achieve
for literally years at this point. But it's just way too risky for me. And so that's why I want to
take the good components from it and just use it as a resource. So that's what I want to cover with
you right now. There are four components that make OpenClaw feel so magical. And these are the things
that I've replicated for myself. And I want to stay pretty high level here because I encourage you
to go through this process yourself. And it is so, so easy. And so within OpenClaw, we have the memory
system, the heartbeat, that's the proactive nature of the agent. We have the channel adapters and the
skills registry. These are the four core components that work so incredibly well. And the best part about
the memory system is it's elegant, but also extremely simple. The entire thing is markdown driven.
We have the sole.md where the agent evolves its identity over time. It kind of evolves the identity
of you in the user.md. The core memories are stored and maintained in the memory.md. We can also define
the agent's behavior in an agents.md. This is kind of like the global rules for your coding agents. And
then we're keeping track of session logs every single day. And for better search over all of this,
there's also a SQLite database with a very light implementation of RAG built in as well. So again,
super elegant, but super simple. And then we have our heartbeat. So we're leveraging this heartbeat.md.
This is a markdown document that tells OpenClaw, whenever it runs autonomously on a scheduled basis,
it should look there to see what can I do for Cole right now that he would appreciate. So it does things
for us without having to ask for it explicitly. And this is not a new concept. There are a lot
of agents that have implemented this in the past, but OpenClaw for the first time feels like this
agent that can do things for us that we truly appreciate. It's not just wasted work. And so
you'll wake up in the morning and OpenClaw will give you this report like, okay, I drafted this email
and I created this pull request in your GitHub repository. And time and time again, people are like,
oh, wow, that's like really good. It legitimately did things that I would want it to do. And then
next we have the channel adapters. This is what allows us to talk to OpenClaw in any platform that
we want. WhatsApp, Telegram, Slack, Discord. The beauty of this is pretty much anything that we'd want
to use is available out of the box. And we support threads with a lot of these platforms. And so we can
have multiple conversations going with our OpenClaw instance at the exact same time. And then last but not
least we have the skills registry. So I know there are the security issues with it that I covered
earlier. But the beauty of this is even with just a single file, we can add a new capability to OpenClaw.
Like here's how I want to build the front ends, a guide for that. Here's how it can help me generate
PowerPoints. And then we can use that for ourselves very easily, but then also share it with other
people. And so all of this together is what gives us this magical experience of feeling like we finally have an
ultra personalized AI agent, it is able to remember our decisions, preferences and context, it can check
our services do things for us before we even ask, we can talk to it from anywhere. And we can add any
capability with a single file. So it can act on our behalf, anticipate our needs, and it knows us better
every single day. And that's what I wanted to build for myself. And so I'll show you here how each of these
features, I have built it into my own second brain starting with the memory system. And take a look at
this, the memory files that I have for my system is very similar to what is built into OpenClaw.
And that is on purpose. Because what I did is I clone the repo locally, I took my coding agent,
which is Claude code, I pointed it there. And I said, look at how they built their memory system.
And I want you to build it for me, adapted to my tech stack for my second brain. And it thrived on this
example. Let me tell you, coding agents work really well when you give them good examples. So if we're
working on top of something that is simple and elegant, and just works really well,
that is the ultimate brain food for the context for the coding agent. And so it one shot at this
whole thing for me, and even adapted it to my code base, it has the same rag strategy with SQLite,
markdown is the database. And I also added obsidian for sinking because something that I want to make a
video on on my channel soon. And let me know in the comments if you're interested in this is I took my
second brain, I deployed it to a VPS, but I still want to have quick local searching when I'm using
the Claude code CLI locally. And so I'm syncing my memory system, all these markdown documents,
I'm storing it in obsidian. And so my tech stack is obsidian for storage, markdown obviously for the
memory system SQLite for the database, I'm using Postgres when I deploy it remotely. And then I'm using the
Claude agent SDK for the proactive part of the agent that I'll talk about in a little bit. And so that's
my way to run Claude code from my Python scripts. And then obviously Claude code is my primary driver,
I want to use this, because then I can use my Anthropic subscription. So I'm not paying hundreds
and thousands of dollars for API credits, which if you didn't know, people have been getting their
Anthropic subscriptions banned when they're using it with OpenClaw. It's against the Anthropic terms of
service. But if we're using Claude code in the Claude agent SDK, ourself directly, and we're doing it
just in our own environment, then it's totally allowed, even if you deploy it to a VPS. And so
it's very cost effective to build your own second brain as well. And then for the heartbeat follows
a very similar pattern. All right, Claude, look at how the heartbeat was implemented in OpenClaw.
Let's build it ourself with our own integrations. And so I'm using the Claude agent SDK. It's a scheduled
job that runs every 30 minutes for me right now. And we send a prompt into the Claude agent SDK.
So I'm using Claude code directly from my Python script. And I'm telling it to look at my memory,
look at recent emails I've gotten, things that are scheduled on my calendar, my tasks in Asana,
and then give me notifications for anything that need my attention. And then something I'm still
working on is more of the proactive piece where it will even build things for me or draft emails on my
behalf. And so we can take this as far as we want, because we have all of Claude code, which is wrapped
up in a script that we're invoking every 30 minutes. So it makes it feel like the agent is constantly
alive, thinking about how it can do stuff for us. And then for my adapters, I have a very simple
version of what OpenClaw has built. One of the things that I don't like about OpenClaw is it's really
cool how many adapters we have. But most of the time, you're just going to find one that works for
you. And that's all you really need. And that's what I found for myself. I really like talking to
my second brain in Slack, I'll even show you. I have that pulled up right now. I mean, it looks
a little silly, because I got deleted messages and things. I'm still working on testing my whole
second brain, but I can talk to it in Slack from anywhere. It's super cool. And that's really all
I need. I don't really need discord and telegram. I just have the one platform that works for me.
So I have this as my adapter, and then the terminal for when I'm using Claude code on my desktop or
laptop, that is all I need for my adapters. But I still did have it copy the architecture of OpenClaw.
So it's really easy to just with Claude code or whatever coding agent, I can just one shot another
adapter if I ever wanted to use something like discord or Microsoft teams. And then finally,
for the skills here, since I'm using the Claude agents SDK and Claude code, they both have the idea
of skills just built right in. So whenever I want to give more instructions kind of like the skills
registry for how to do something for me, like generate the Excalibur diagram, like literally
the one you're looking at right here was built by my second brain, or ideate for content, help me
create YouTube scripts, I just need to create a skill. And so one of the skills I have in my second
brain is a skill on how to create more skills. And so it's very easy for me to evolve the capabilities
of my second brain, just by having a conversation with it. And yeah, there's no public registry here.
So I'm not able to share my skills, at least yet, I'm working on that. But it's a lot more secure,
because then I'm not downloading potentially malicious skills, I'm just building everything
myself. And it's really easy to do so. And so I'm getting the ultra personalized agent using OpenClaw
to build things very, very quickly. And if there's ever an update to OpenClaw, where it adds this new
thing, that's absolutely incredible. Well, then I'm just going to pull the changes from the repository,
point my cloud code to it again and say, hey, they just added this thing, let's go ahead and
build it ourselves. Now, of course, you don't have to copy my exact tech stack, but it is working
really, really well for me. And I do plan on putting out some more content soon, covering
more in detail how I built this out and sharing some resources for you. But just overall, you have
to follow this super simple process. So just as a quick review, you clone the OpenClaw repo locally,
and it's MIT licensed, you can do anything you want with the code, then you point your coding agent
at it, say, hey, explain how the memory system works. Now build that into my own system, you can
specify any customizations that you want as well to make it even better than OpenClaw for you
specifically. And then you just repeat that for every part of the platform that you want for yourself.
It is that easy. I mean, it kind of feels like I'm just saying something really obvious here. But I
really haven't seen people do this. And it just works so well for me that I have to share it with
you because this is making a real difference for me. I like OpenClaw. I did some experimentation
hosting it for myself when it first came out, but I'm really, really getting a lot out of what
I'm building for myself. And I feel like it's just going to get better and better for me over time.
Not because I'm engineering something better than Peter with OpenClaw, but because I know exactly what
I want and I can build for that. And I think that will resonate with you as well. So again, I will have
a lot more content on my channel for my second brain coming up soon. And I'm doing a lot of
workshops in the Dynamis community as well, going a lot deeper into this stuff. So I'll have a link in
the description to Dynamis if you want to check it out. It's my community where I do weekly workshops.
I have courses on building agents and using AI coding assistance, and I've got a lot of resources
coming for building your own second brain. And so if you appreciate this video and you're looking
forward to more things on second brain content and agentic engineering, I would really appreciate a like and
a subscribe. And with that, I will see you in the next video.

Clips

No clips yet

Select text above to create your first clip

Loading connections...

Reflect

How might you apply this idea in your own life or work?

Press Cmd+Enter to submit