How AI Agents Search Their Memory
Memory retrieval, agent loops, and a Claude Code plugin that audits your setup.
This Week's Video
Part two of my memory series is live. Last week we covered how agents store memories. This week it's retrieval. How do agents actually find the right memory at the right moment?
It's a more interesting problem than it sounds. Storing is mostly solved. Retrieval is where systems quietly break. Surfacing stale data, missing context, returning the wrong thing with full confidence. I use OpenClaw throughout as the real working example.
One Thought: Why I Started Writing Companion Posts
Videos are great for learning something new. They're not great for referencing later.
After publishing last week's video someone replied asking if there was a written version they could come back to. It got me thinking. If you want to actually apply something you learned from a video, you're either re-watching it or searching for the specific moment you remember. Neither is great.
So I started writing companion posts. Not transcripts. Actual standalone pieces you can skim, Cmd+F, and bookmark. The first one is live: How AI Agents Remember Things
Moving forward I'm going to try to pair every video with a companion post. Same research, different format. One for watchers, one for readers.
Running Claude Code Agent Loops
I published a post this week on building a Linear-driven agent loop with Claude Code. If you've seen the Ralph Wiggum approach floating around, this is the evolution of that idea.
The problem with running loops inside a Claude Code session is context rot. The longer the session runs, the more degraded the results get. The fix is simple: move the loop to bash. Each iteration of the loop spawns a fresh Claude Code session with a clean context window.
My setup pulls the next issue from Linear, builds the feature, runs subagents for code review, and opens a pull request. Between sessions, a PROGRESS.md file acts as memory so each iteration knows what's already been done. The whole thing runs until the backlog is clear.
Read the full post if you want the implementation details, including the bin/pr_check script I use to surface PRs that need revision before picking up new work.
Quick Hits
- claudit is a Claude Code plugin that audits your setup. It spins up research agents to pull the latest Anthropic docs, then grades your config across 6 categories including over-engineering detection and context efficiency. Install with
/plugin install claudit@quickstop. - Anthropic announced Claude Sonnet 4.6. In Claude Code, users preferred it over Sonnet 4.5 70% of the time and even over Opus 4.5 59% of the time. Less overengineering, better instruction following, fewer hallucinations. Same price as 4.5.
CTA
Building agents with memory yourself? The hardest part for most people isn't storage. It's retrieval quality. Reply and tell me where you're getting stuck. I'm building out this series and your questions shape what comes next.
If you want to go deeper 1:1, I work with senior engineers and tech leads on AI-augmented workflows and architecture. Learn more.
– Damian

Add a comment: