WEBVTT

00:00:00.240 --> 00:00:16.395
So you build something good with your coding agent, you close the terminal, and the next day, it's like the two of you never met. That's the quiet frustration nobody warns you about when you start using AI agents in the terminal. The agent that knew your whole codebase yesterday,

00:00:16.395 --> 00:00:21.835
the one that finally understood your naming style and the weird workaround you needed for that one service,

00:00:21.915 --> 00:00:24.555
wakes up the next morning as a total stranger.

00:00:24.795 --> 00:00:31.250
It forgot the architecture. It forgot the bug you killed together. It forgot the thing you corrected it on four times.

00:00:31.490 --> 00:00:55.180
So you start over typing the same context back in, and every word of that re explaining is burning tokens just to get back to the starting line you were already at. Alright. So OpenCode is one of the best terminal agents out there right now. And that's exactly why this gap stings. It lives in your terminal, it's open source, and it isn't chained to one AI provider. So you can run Anthropic,

00:00:55.260 --> 00:00:56.060
OpenAI,

00:00:56.060 --> 00:00:59.100
Google, or even a local model through Alama.

00:00:59.180 --> 00:01:03.500
Millions of developers reach for it every month, and the numbers keep climbing.

00:01:03.740 --> 00:01:07.420
A lot of that growth got a strange boost back in January

00:01:07.420 --> 00:01:13.265
2026 when Anthropic blocked third party tools from using Claude through consumer subscriptions.

00:01:13.505 --> 00:01:23.345
Instead of slowing OpenCode down, that pushed even more people toward it, because being provider agnostic suddenly looked less like a nice to have and more like insurance.

00:01:23.790 --> 00:01:25.630
But for all that flexibility,

00:01:25.870 --> 00:01:30.830
OpenCode has the same hole every agent has. Each session starts cold.

00:01:31.070 --> 00:01:38.830
Your project history lives in your head, not in the tool. And once you close a session, whatever the agent learned basically evaporates.

00:01:39.345 --> 00:01:44.065
Claude MEM is what closes that gap, and it now plugs straight into OpenCode.

00:01:44.225 --> 00:01:48.625
The simple way to put it, it hands your agent a real long term memory.

00:01:48.785 --> 00:02:06.490
While you work, it quietly watches what the agent actually does. The files it opens, the edits it writes, the commands it runs, the calls it makes. Then it takes all of that and uses AI to compress it down into clean little summaries and saves them into a database that sits on your own machine.

00:02:07.135 --> 00:02:12.815
Next time you open OpenCode in that same project, it pulls the relevant pieces back in on its own.

00:02:13.215 --> 00:02:24.300
So the agent shows up to the new session already knowing the story so far, instead of asking you to retell it. What makes this more than a fancy notepad is how it stores and finds things.

00:02:24.780 --> 00:02:27.740
Everything goes into a local SQLite database,

00:02:27.820 --> 00:02:30.620
and on top of that, there's a vector search index,

00:02:30.860 --> 00:02:42.195
which means it isn't just matching exact words. You can ask about something in plain language, and it'll surface the right memory even if you describe it totally differently than how it got recorded the first time.

00:02:42.595 --> 00:02:55.020
There's also a search system the agent itself can reach for. So mid task, it can glance back through your project history and pull up the part that's actually relevant without dumping your entire past into the context window.

00:02:55.260 --> 00:03:02.735
That last point is the part I really want you to get because it's where the token savings live. The search runs in layers.

00:03:02.895 --> 00:03:10.175
First, it does a cheap lookup that returns a short index, basically just IDs and tiny summaries, costing almost nothing.

00:03:10.575 --> 00:03:17.150
Then if something looks worth a closer look, it can grab a timeline around that moment to see what else was happening at the time.

00:03:17.550 --> 00:03:21.870
And only then, for the specific items that matter, does it pull the full detail.

00:03:22.110 --> 00:03:37.495
The whole design is built to avoid loading everything at once. The makers say this layered approach saves roughly 10 times the tokens compared to grabbing full records up front. So your context budget stays open for the real work instead of getting eaten by old history.

00:03:38.260 --> 00:03:51.220
Under the hood, all of this is wired into the agent through life cycle hooks, little trigger points that fire when a session starts, when you send a prompt, when a tool runs, and when a session ends. That's how the capturing happens automatically

00:03:51.220 --> 00:03:52.580
without you lifting a finger.

00:03:53.335 --> 00:03:55.015
Installing it on OpenCode

00:03:55.015 --> 00:03:56.215
is genuinely

00:03:56.215 --> 00:03:57.095
one line.

00:03:57.415 --> 00:04:01.095
Open your terminal and run npx clod mem install

00:04:01.095 --> 00:04:04.215
dash dash I d e and then OpenCode.

00:04:04.375 --> 00:04:07.335
That flag points the installer straight at OpenCode.

00:04:07.750 --> 00:04:17.510
And here's a detail I really like. If you just run npx claud mem install with no flag, it actually scans your machine for coding agents you already have.

00:04:17.990 --> 00:04:22.955
So it'll pop up a list with options like Claude code, Gemini CLI,

00:04:22.955 --> 00:04:27.515
OpenCode, and a few others, and let you multi select which ones to wire up.

00:04:27.835 --> 00:04:55.495
For Claude code, you could even add it as a plug in from inside the tool. But since we're focused on OpenCode here, the command with the open code flag is the clean direct path, so use that one. The installer does the heavy lifting so you don't have to. It runs a quick runtime check, and if bun or u v are missing, it just installs them for you. Bun is the JavaScript runtime that runs the background worker. U v handles the Python side that powers the vector search.

00:04:55.815 --> 00:05:01.975
Before you run anything, make sure you've got Node version 20 or higher and OpenCode itself already installed.

00:05:02.420 --> 00:05:11.460
Everything else, the database, the runtimes, it sorts out during setup. Once it finishes, you'll see a message telling you the worker is running at a local address.

00:05:11.700 --> 00:05:23.335
That worker is the small background service that does all the capturing and compressing while you code. And that address is your web viewer. Open it in your browser, and you get a clean dashboard for your memory.

00:05:23.735 --> 00:05:32.055
Right after install, it'll just say no items to display because you haven't built up any memory yet, which is exactly what you should expect on a fresh setup.

00:05:32.550 --> 00:05:37.750
As you start working, that empty screen fills up with observations streaming in live.

00:05:37.990 --> 00:05:51.255
Now here's the part most demos skip, what actually changes after you install it. The first session won't feel different because the memory is still empty. The magic shows up on the second session and every one after.

00:05:51.575 --> 00:05:56.135
You open OpenCode the next day, and the agent already has the context loaded.

00:05:56.295 --> 00:06:13.710
It remembers you picked one database approach over another and why. So it stops pitching the option you already ruled out. It remembers a bug pattern you hit before. So when it shows up again, it goes straight to the fix instead of debugging from zero. It remembers your code style and your folder structure,

00:06:13.870 --> 00:06:19.070
so its edits land closer to what you actually want on the first try. The continuity compounds.

00:06:19.525 --> 00:06:28.245
The longer you run it on a project, the sharper it gets because it's slowly building a real picture of how that codebase works and how you like things done.

00:06:28.565 --> 00:06:32.885
A clean way to feel the difference yourself is to run the same prompt twice.

00:06:33.285 --> 00:06:47.260
Once on a fresh open code session with no memory and once with claud mem active on a project it's already seen. The cold one gives you something generic, missing your patterns, repeating default choices, needing a few rounds of correction.

00:06:47.500 --> 00:07:02.085
The one with memory comes out closer on the first try because it isn't guessing at your context, it already has it. ClaudeMem exposes its search through MCP tools so the agent talks to your memory through a clean, standard interface.

00:07:02.165 --> 00:07:06.085
And if you set those up, you get sharper results pulling from your project history.

00:07:06.630 --> 00:07:10.070
There's a privacy feature that matters more than people expect.

00:07:10.230 --> 00:07:14.710
You can wrap sensitive content like keys or secrets in private tags,

00:07:14.870 --> 00:07:17.430
and it'll skip storing that stuff entirely.

00:07:17.750 --> 00:07:23.785
Since the database lives on your own machine, your project history isn't getting shipped off to some server either,

00:07:24.025 --> 00:07:39.180
which is the right default. There's also a beta channel with experimental stuff, including something they call endless mode, built for keeping memory coherent across really long stretches of work, and you can flip between stable and beta right from that web viewer's settings.

00:07:39.500 --> 00:07:44.220
And if you live further out on the edge, there's even an OpenClaw gateway integration,

00:07:44.460 --> 00:07:51.645
which runs ClawdMem as a persistent memory layer on a gateway and can feed live observations out to places like Discord,

00:07:51.645 --> 00:07:53.165
Slack, or Telegram.

00:07:53.565 --> 00:07:59.965
So I want to be honest about the part that needs care because this isn't magic and you can trip yourself up.

00:08:00.205 --> 00:08:13.510
The memory is only as good as what goes into it. If the agent makes a wrong assumption during a session and that gets compressed and saved, it can carry that mistake forward. So on a serious production codebase, be deliberate.

00:08:13.750 --> 00:08:16.790
Pause it when you're doing something throwaway or experimental,

00:08:16.995 --> 00:08:21.875
and clean out memories that aren't pulling their weight. Treat it like a tool you steer,

00:08:22.035 --> 00:08:24.115
not one you set loose and forget.

00:08:24.355 --> 00:08:34.340
The bigger picture is that persistent memory is quietly becoming the line between an agent that's handy for a one off task and one you can actually build with over weeks.

00:08:34.580 --> 00:08:39.060
OpenCode already gave you the freedom to run any model you want in your terminal.

00:08:39.300 --> 00:08:46.815
Bolting a memory layer on top means it stops resetting on you every single morning. For anyone shipping real software,

00:08:46.975 --> 00:08:53.615
that's the difference between an assistant that helps in the moment and one that genuinely keeps pace with your project over time.

00:08:54.015 --> 00:09:11.360
And since it's open source and runs entirely on your own machine, there's almost nothing standing between you and trying it on whatever you're building today. Alright. So that's it from the video, and I hope you enjoyed it. If you did, please like this video and subscribe to the channel, and I'll see you in the next video.
