Get your free personalized podcast brief

We scan new podcasts and send you the top 5 insights daily.

Brooke Lacey runs a personal operating system with memory lanes and status MD files. When Claude misbehaves, she tells it to reread the session hook, find what it missed, and update the main operating-system spine so the fix applies globally rather than just in that session.

Related Insights

The all-caps `clod` file, created via the `init` command, stores project structure and user-defined rules. Unlike temporary in-chat instructions that get lost or degraded as the conversation continues, this file is referenced in every session, ensuring consistent behavior and enforcing project-wide guardrails.

The leaked architecture shows a sophisticated memory system with pointers to information, topic-specific data shards, and a self-healing search mechanism. This multi-layered approach prevents the common agent failure mode where performance degrades as more context is added over time.

When an AI agent like Claude Code nears its context limit where automatic compaction might fail, a useful hack is instructing it to "write a markdown file of your process and your progress and what you have left to do." This creates a manual state transfer mechanism for starting a new session.

For stubborn bugs, use an advanced prompting technique: instruct the AI to 'spin up specialized sub-agents,' such as a QA tester and a senior engineer. This forces the model to analyze the problem from multiple perspectives, leading to a more comprehensive diagnosis and solution.

While `claude.md` files can guide AI behavior, they aren't always adhered to. Use Claude Code's "session start hooks" instead. They guarantee that critical context like goals, tasks, and past mistakes is injected into every new chat, making the AI more reliable.

Agents don't automatically remember preferences across sessions. To fix this, create a `memory.md` file and instruct the agent's system prompt to record corrections and new information there. This manually builds a persistent, compounding memory, making the agent smarter over time.

The easiest way to teach Claude Code is to instruct it: "Don't make this mistake again; add this to `claude.md`." Since this file is always included in the prompt context, it acts as a permanent, evolving set of instructions and guardrails for the AI.

Long-running AI agents don't fail because the model is unintelligent. They fail because default memory management, like unmonitored append-only context windows, corrupts their state. This is a software engineering problem that requires an architectural solution, not better prompting or model tuning.

When a coding agent loses context, don't just start over. A power-user technique is to begin a new session and instruct the agent to read the locally stored conversation logs from the previous, failed session to regain context and continue the task.

When an agent fails, treat it like an intern. Scrutinize its log of actions to find the specific step where it went wrong (e.g., used the wrong link), then provide a targeted correction. This is far more effective than giving a generic, frustrated re-prompt.

Recover Claude failures with a memory-lane prompt system | RiffOn