I gave my AI agent access to my second brain
This week: giving a Mastra AI agent a persistent file system and hybrid search, the grep-over-files pattern, a new doc-audit plugin, and Boris Cherny hidden Claude Code features.
This week's video
Last month I built a personal AI assistant with Mastra that researches people before meetings and posts prep briefs to Slack. It had memory and tools, and it worked well. But the research it produced landed in Slack threads and stayed there. The agent couldn't search its own past work, couldn't build on what it already knew, couldn't turn six months of meeting prep into a knowledge base.
This week I gave it a workspace. A persistent file system backed by my Obsidian vault, hybrid search combining BM25 keyword matching and vector similarity, and a composable skill that processes meeting notes into structured files. Mastra Workspaces handle the search natively, no external tooling to wire up. The agent writes things down, and next time it needs context, it searches. The library grows with every meeting.
Resources mentioned: - Mastra Workspaces docs - Part 1: Build a Personal AI Agent with Mastra
The grep-over-files pattern
The core pattern in this video comes from Thariq's thread on why every agent should use a file system. His argument: you don't need to remember everything, you just need to know how to find it.
Claude Code proved the principle. It doesn't load your codebase into context. It reads file trees, greps for what's relevant, and pulls in only what it needs. Write data to files, let the agent search selectively at query time.
Context windows are getting bigger, but stuffing 200k tokens of "just in case" context is wasteful and fragile. An agent that searches 2k tokens of exactly the right thing outperforms one drowning in everything. And it can search, read, search again. Multi-pass retrieval that context stuffing can't do.
If you're building agents that need persistent knowledge, start with files. They're inspectable, versionable, and debuggable. Your agent's knowledge isn't a black box embedding store. It's markdown on disk you can open in a text editor.
What I shipped this week
New plugin: doc-audit. This is the maintenance companion to agent-ready. Where agent-ready scaffolds your AGENTS.md, ARCHITECTURE.md, and docs/ structure, doc-audit keeps them accurate as your code evolves. It checks four dimensions: completeness (are expected docs present?), accuracy (do file paths, ports, and commands in docs match actual code?), freshness (have docs been updated alongside code changes?), and coherence (broken links, contradictions, duplication). Run /doc-audit for a read-only report, or /doc-audit fix to auto-fix safe issues like stale paths and incorrect counts. Documentation rot is one of the fastest ways to degrade agent performance, and this catches it before it compounds.
You can pair this with Claude Code scheduled tasks to run doc-audit automatically on a recurring basis, so your agent documentation stays accurate without you having to remember to check it.
Also in this release: /codebase-readiness now scores PHP and Rust codebases, and /agent-ready scaffolds domain knowledge documentation alongside the standard AGENTS.md structure.
claude-code-workflows on GitHub →
What I'm watching
Boris Cherny's hidden Claude Code features. Boris (Head of Claude Code at Anthropic) shared a thread of his favorite under-utilized features. The highlights: using Claude Code from your phone via the iOS app, moving sessions between mobile and terminal with /teleport and /remote-control, running /loop and /schedule for automated agents, and using hooks to inject context or route permissions to WhatsApp. If you've been using Claude Code for a while and feel like you've hit a ceiling, this thread will show you features you didn't know existed. Read the thread →
Claude Code auto-fix in the cloud. Web and mobile Claude Code sessions can now automatically follow your PRs, fixing CI failures and addressing review comments so your PR stays green. This happens remotely, so you can walk away and come back to a ready-to-merge PR. If you've been using Claude Code primarily from the terminal, this is a reason to look at the web/mobile experience. See the announcement →
Claire Vo on Lenny's Podcast. Claire went from AI skeptic to building her workflow around OpenClaw. Hearing someone who was genuinely skeptical talk about how a personal AI agent changed her daily work is a powerful lens on why this architecture matters. The best validation isn't technical benchmarks. It's someone saying "I can't go back to working without this." Watch the interview →
What's the most useful thing you've given an AI agent access to? A codebase, a knowledge base, a CRM? Reply and tell me. I'm genuinely curious what setups people are running.
If you're building agents and want help with the architecture, let's talk →
Damian


Add a comment: