<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mike Dolan</title>
    <description>The latest articles on DEV Community by Mike Dolan (@mikeadolan).</description>
    <link>https://dev.to/mikeadolan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3857764%2Ff55967c9-7af4-42ea-a6bb-6998f33415de.jpeg</url>
      <title>DEV Community: Mike Dolan</title>
      <link>https://dev.to/mikeadolan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikeadolan"/>
    <language>en</language>
    <item>
      <title>I Wrote 500 Lines of Rules for Claude Code. Here's How I Made It Actually Follow Them.</title>
      <dc:creator>Mike Dolan</dc:creator>
      <pubDate>Tue, 07 Apr 2026 19:45:54 +0000</pubDate>
      <link>https://dev.to/mikeadolan/i-wrote-500-lines-of-rules-for-claude-code-heres-how-i-made-it-actually-follow-them-3c8</link>
      <guid>https://dev.to/mikeadolan/i-wrote-500-lines-of-rules-for-claude-code-heres-how-i-made-it-actually-follow-them-3c8</guid>
      <description>&lt;p&gt;CLAUDE.md is supposed to be the operating manual for Claude Code. You write your rules, preferences, project context, and workflow instructions. Claude reads it at session start and follows your instructions.&lt;/p&gt;

&lt;p&gt;Except it doesn't. Not reliably.&lt;/p&gt;

&lt;p&gt;If you have used Claude Code for more than a few sessions, you have seen it ignore your CLAUDE.md rules. Not maliciously. It just prioritizes answering your question over following a protocol. It skips steps, forgets constraints, and does things you explicitly told it not to do.&lt;/p&gt;

&lt;p&gt;I have 500+ lines of rules across CLAUDE.md, SESSION_PROTOCOLS.md, and MEMORY.md. After months of Claude ignoring them, I stopped writing more rules and started enforcing the ones I had. The fix was not better rules. It was hooks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Rules Without Enforcement
&lt;/h2&gt;

&lt;p&gt;Here is what happens with CLAUDE.md rules in practice:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude skips the session start protocol.&lt;/strong&gt; I have a 7-step checklist that Claude must complete before doing anything else: search the brain database, read the project tracker, review unfinished items, show me the last session's notes. Claude skipped this in sessions 35, 38, and 39. It jumped straight into whatever I asked and ignored the checklist entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude codes without permission.&lt;/strong&gt; I have a rule that says "NEVER write, edit, or modify code unless Mike says GO with a specific step or fix." Claude violated this in sessions 17, 19, 21, and 25. Each time it started coding before I approved the plan, creating complexity and wasted work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude forgets rules after compaction.&lt;/strong&gt; When the context window fills up and Claude Code auto-compacts, the CLAUDE.md gets re-read but the nuance is gone. Claude follows the broad rules but skips the specific ones buried deeper in the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude prioritizes helpfulness over compliance.&lt;/strong&gt; If you ask a question, Claude wants to answer it immediately. The idea of stopping to run a checklist first feels counterproductive to the AI, so it skips it. Your rules say "do this first." Claude's instinct says "answer the human."&lt;/p&gt;

&lt;p&gt;This is not a bug. It is a fundamental limitation of instruction-following. Rules in a text file are suggestions. The AI decides whether to follow them based on how important they seem relative to the current task. Your carefully written protocol loses to "the user asked me a question and I should answer it."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why More Rules Don't Help
&lt;/h2&gt;

&lt;p&gt;The instinct is to write more detailed rules. Add more context. Be more explicit. Bold the important parts. Add warnings about past violations.&lt;/p&gt;

&lt;p&gt;I tried all of this. My CLAUDE.md grew from 50 lines to 200 to 500+. I added violation history ("Violated in sessions 17, 19, 21, and 25. Each violation caused complexity and wasted time. ZERO tolerance."). I added bold warnings. I added all-caps headers.&lt;/p&gt;

&lt;p&gt;It helped marginally. Claude followed the rules more often. But "more often" is not "always." And for rules that matter, "usually" is not good enough. If "do not code without permission" works 90% of the time, the 10% where it fails costs hours of rework.&lt;/p&gt;

&lt;p&gt;The problem is not clarity. Claude understands the rules. It just doesn't always prioritize them over the immediate task. No amount of rewriting fixes that.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: Hooks That Enforce Rules Automatically
&lt;/h2&gt;

&lt;p&gt;Claude Code has a hook system that runs scripts at specific points in a session. These hooks fire automatically. Claude cannot skip them, ignore them, or decide they are not important enough to follow.&lt;/p&gt;

&lt;p&gt;This changes rule enforcement from "please follow this" to "this runs whether you follow it or not."&lt;/p&gt;

&lt;p&gt;Here is how I enforce my most important rules with hooks:&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule: Always Run the Session Start Protocol
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The rule in CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When a session starts, complete ALL steps and output the checklist table:
1. Search the brain
2. Read PROJECT_TRACKER.md
3. Review session-start hook output
4. Present unfinished items to user
5. Present next-session notes to user
6. Output verified checklist (every item must show DONE)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why CLAUDE.md alone fails:&lt;/strong&gt; Claude jumps straight into answering whatever the user types first. The checklist gets skipped because Claude prioritizes responsiveness over protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook enforcement:&lt;/strong&gt; The &lt;code&gt;session-start.py&lt;/code&gt; hook fires automatically before Claude sees your first message. It reads NEXT_SESSION.md, loads the last session's notes, flags unfinished items, and injects everything into Claude's context via &lt;code&gt;additionalContext&lt;/code&gt;. Claude receives the checklist requirements as part of its initial context, not as a rule it might skip. The hook also injects the verification checklist template so Claude knows exactly what format to output.&lt;/p&gt;

&lt;p&gt;The combination of hook injection plus CLAUDE.md instruction makes it reliable. The hook provides the data. CLAUDE.md provides the instruction to present it. Neither works as well alone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule: Search Memory Before Every Response
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The rule in CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Search the brain AND the web BEFORE you do ANYTHING substantive.
Before proposing a plan, before debugging, before recommending tools.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why CLAUDE.md alone fails:&lt;/strong&gt; Claude wants to answer immediately. Searching first feels like a delay, so it skips the search and goes straight to a response based on what it already knows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook enforcement:&lt;/strong&gt; The &lt;code&gt;user-prompt-submit.py&lt;/code&gt; hook fires on every single message before Claude processes it. It extracts keywords from your prompt, searches the full transcript database (69,000+ messages), and injects the top 5 relevant matches into Claude's context. Claude does not decide whether to search. The search happens automatically and the results appear in context alongside your message.&lt;/p&gt;

&lt;p&gt;This means Claude always has relevant history available, even when it would not have thought to search on its own. Past decisions, prior discussions, rejected approaches, all surfaced automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule: Do Not Code Without Permission
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The rule in CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEVER write, edit, or modify code unless Mike says "GO" 
with a specific step or fix.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why CLAUDE.md alone fails:&lt;/strong&gt; Claude sees a problem and wants to fix it. The impulse to be helpful overrides the instruction to wait. Four separate sessions violated this rule before I added enforcement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook enforcement:&lt;/strong&gt; The same &lt;code&gt;user-prompt-submit.py&lt;/code&gt; hook that searches memory also checks for the GO pattern. If the conversation contains words like "thoughts?" or "what do you think?" without an explicit "GO," the hook injects a reminder: "STOP. Present the plan and wait for GO before coding." Claude receives this reminder in context on every message, making it much harder to forget.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule: Never Lose Context to Compaction
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The rule in CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before compaction, save all context to the database.
After compaction, restore relevant context.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why CLAUDE.md alone fails:&lt;/strong&gt; Auto-compaction fires without warning. Claude cannot follow a rule to "save before compaction" because it does not know compaction is about to happen. By the time compaction fires, it is too late to save anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook enforcement:&lt;/strong&gt; &lt;code&gt;pre-compact.py&lt;/code&gt; fires automatically before compaction starts and captures the full conversation to a local SQLite database. &lt;code&gt;post-compact.py&lt;/code&gt; fires after compaction finishes and re-injects relevant context (project summary, recent decisions, last session notes). Claude does not need to follow a rule. The hooks handle it without Claude's involvement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rule: Stop and Reassess When Frustrated
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The rule in CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If the user is frustrated, stop iterating on the current approach.
Search the brain for what was discussed and reassess.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why CLAUDE.md alone fails:&lt;/strong&gt; Claude does not reliably detect frustration, and even when it does, it tends to apologize and continue the same approach rather than stopping to reassess.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hook enforcement:&lt;/strong&gt; The &lt;code&gt;user-prompt-submit.py&lt;/code&gt; hook detects frustration signals in your message (all caps, repeated punctuation, anger keywords). When triggered, it searches the brain for the current topic and injects a STOP directive plus relevant context from past sessions. Claude receives "STOP. Reassess. Here is what was discussed about this topic before." This breaks the loop of Claude continuing down a wrong path while the user gets increasingly frustrated.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pattern: If a Rule Matters, It Needs a Hook
&lt;/h2&gt;

&lt;p&gt;After months of running this system across 1,300+ sessions, the pattern is clear:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules that work in CLAUDE.md alone:&lt;/strong&gt; broad preferences, style guidelines, general instructions. Things where occasional non-compliance is acceptable. "Use lists and frameworks when starting a project." "Be precise and complete." These work fine as text because the cost of ignoring them once is low.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules that need hook enforcement:&lt;/strong&gt; anything where a single violation costs significant time or loses data. Session protocols, memory search, coding permission, compaction protection, frustration detection. These cannot rely on Claude choosing to follow them. They must run automatically.&lt;/p&gt;

&lt;p&gt;The progression I have seen repeatedly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the rule in CLAUDE.md&lt;/li&gt;
&lt;li&gt;Claude violates it&lt;/li&gt;
&lt;li&gt;Add bold warnings and violation history&lt;/li&gt;
&lt;li&gt;Claude violates it less often but still sometimes&lt;/li&gt;
&lt;li&gt;Build a hook that enforces it automatically&lt;/li&gt;
&lt;li&gt;Rule is never violated again&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you are at step 3 or 4 with any of your rules, skip straight to step 5. The hook is always the answer for rules that matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;Six Python hooks enforce my rules across the full session lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;      &lt;span class="n"&gt;injects&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s notes, unfinished items,
                      verification checklist. Claude cannot start
                      without context.

user-prompt-submit.py searches memory on every prompt, checks for GO
                      permission, detects frustration, injects relevant
                      history. Runs before Claude sees your message.

stop.py               captures every response to the database, triggers
                      backup if older than 12 hours. Runs after every
                      Claude response.

session-end.py        triggers sync and backup when the session closes.

pre-compact.py        captures the full conversation to SQLite before
                      compaction fires. Automatic, no Claude involvement.

post-compact.py       re-injects relevant context after compaction.
                      Claude picks up where it left off.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;None of these depend on Claude deciding to follow a rule. They run automatically at the right lifecycle point. Claude receives their output as injected context, not as an instruction it might skip.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Version (No Hooks Required)
&lt;/h2&gt;

&lt;p&gt;If you are not ready to set up hooks, you can still improve CLAUDE.md compliance with these patterns:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Front-load your rules.&lt;/strong&gt; Put the most important rules at the top of CLAUDE.md. Claude reads from top to bottom and gives more weight to what it sees first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use verification outputs.&lt;/strong&gt; Instead of "follow the checklist," write "output this checklist table with DONE or MISSING for each row." Making Claude produce a visible output forces it to actually check each item. If a row shows MISSING, you catch it immediately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference past violations.&lt;/strong&gt; "Violated in sessions 17, 19, 21, 25. Each caused hours of rework." This makes the rule feel consequential, not optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use NEXT_SESSION.md for session continuity.&lt;/strong&gt; At the end of every session, have Claude write a summary and your forward instructions to a file. At the start of the next session, have Claude read it first. This does not require hooks. It just requires adding "read NEXT_SESSION.md before doing anything else" to your CLAUDE.md.&lt;/p&gt;

&lt;p&gt;These help. But they do not guarantee compliance the way hooks do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Numbers
&lt;/h2&gt;

&lt;p&gt;This system has been running across 1,300+ sessions and 9 projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session start protocol skipped: 3 times before hook enforcement, 0 times after&lt;/li&gt;
&lt;li&gt;Coding without permission: 4 violations before enforcement, 0 after&lt;/li&gt;
&lt;li&gt;Context lost to compaction: dozens of times before hooks, 0 after&lt;/li&gt;
&lt;li&gt;Frustration loops (Claude repeating failed approaches): frequent before circuit breaker, rare after&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference is not better rules. It is automated enforcement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;The CLAUDE.md patterns (front-loading, verification outputs, violation history, NEXT_SESSION.md) work immediately with no install.&lt;/p&gt;

&lt;p&gt;For the full hook enforcement system with automated memory search, compaction protection, and frustration detection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/mikeadolan/claude-brain/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free, open source, works on macOS, Linux, and Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;github.com/mikeadolan/claude-brain&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Video:&lt;/strong&gt; &lt;a href="https://youtu.be/0kf-6VRi72M" rel="noopener noreferrer"&gt;claude-brain in 85 seconds&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 1:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/how-i-built-persistent-memory-for-claude-code-1dn7"&gt;How I Built Persistent Memory for Claude Code&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 2:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/why-i-use-claude-code-for-everything-2j84"&gt;Why I Use Claude Code for Everything&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 3:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/the-session-protocol-that-fixed-claude-codes-amnesia-problem-1gje"&gt;The Session Protocol That Fixed Claude Code's Amnesia Problem&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 4:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/claude-code-compaction-kept-destroying-my-work-i-built-hooks-that-fixed-it-2dgp"&gt;Claude Code Compaction Kept Destroying My Work. I Built Hooks That Fixed It.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>python</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Claude Code Compaction Kept Destroying My Work. I Built Hooks That Fixed It.</title>
      <dc:creator>Mike Dolan</dc:creator>
      <pubDate>Mon, 06 Apr 2026 13:36:53 +0000</pubDate>
      <link>https://dev.to/mikeadolan/claude-code-compaction-kept-destroying-my-work-i-built-hooks-that-fixed-it-2dgp</link>
      <guid>https://dev.to/mikeadolan/claude-code-compaction-kept-destroying-my-work-i-built-hooks-that-fixed-it-2dgp</guid>
      <description>&lt;p&gt;If you use Claude Code for long sessions, you have lost work to compaction. Maybe not today. But it has happened, and when it does, you lose hours of context with no warning and no way to get it back.&lt;/p&gt;

&lt;p&gt;Claude Code auto-compacts when the context window reaches roughly 95% of its 200K token limit. The agent summarizes everything into a compressed form, and the original conversation is gone. File paths, error messages, debugging chains, architectural decisions, multi-step reasoning. All of it gets compressed into a lossy summary that drops the details you actually need.&lt;/p&gt;

&lt;p&gt;I have been running Claude Code daily for months across 9 projects. 1,300+ sessions, 69,000+ messages. Compaction has hit me dozens of times. After losing a 3-hour debugging session to auto-compaction mid-conversation, I built hooks that solve the problem permanently.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Claude Code Compaction Actually Does
&lt;/h2&gt;

&lt;p&gt;When your context window fills up, Claude Code runs automatic compaction. Here is what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The agent detects that the context is at roughly 95% capacity&lt;/li&gt;
&lt;li&gt;It summarizes the entire conversation into a shorter form&lt;/li&gt;
&lt;li&gt;The original messages are discarded&lt;/li&gt;
&lt;li&gt;The session continues with only the summary&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem is that summaries are lossy. They capture the general topic but drop specifics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Error messages with stack traces get reduced to "there was an error"&lt;/li&gt;
&lt;li&gt;File paths and line numbers disappear&lt;/li&gt;
&lt;li&gt;Multi-step debugging chains lose the intermediate steps&lt;/li&gt;
&lt;li&gt;Architectural decisions lose their rationale&lt;/li&gt;
&lt;li&gt;Code snippets that were discussed get summarized away&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After compaction, Claude does not remember the exact error you spent 20 minutes diagnosing. It does not remember which files you modified. It does not remember the three approaches you tried and rejected. It has a vague summary that says you "worked on debugging" and nothing more.&lt;/p&gt;

&lt;p&gt;This is the single biggest productivity killer in Claude Code for long sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Manual Workarounds Fail
&lt;/h2&gt;

&lt;p&gt;The most common advice is to manually save your context before compaction hits. Run &lt;code&gt;/compact&lt;/code&gt; yourself at a convenient time. Copy important notes into CLAUDE.md. Save key decisions to a file.&lt;/p&gt;

&lt;p&gt;This does not work in practice for three reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You forget.&lt;/strong&gt; You are deep in a debugging session, focused on the problem. You are not watching the context percentage. Compaction happens automatically when you least expect it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You cannot predict when it will fire.&lt;/strong&gt; Auto-compaction triggers based on token count, which depends on message length, tool output size, and file contents. There is no reliable way to know when you are about to hit 95%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manual saving is incomplete.&lt;/strong&gt; Even when you do remember to save, you decide what to keep and what to skip. You are making deletion decisions with the least information about what will matter later. The thing you skip is often the thing you need after compaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: PreCompact and PostCompact Hooks
&lt;/h2&gt;

&lt;p&gt;Claude Code has a hook system that lets you run scripts at specific points in a session. Two of these hooks fire around compaction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PreCompact&lt;/strong&gt; fires right before compaction starts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostCompact&lt;/strong&gt; fires right after compaction finishes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the fix. Here is what they do in my system:&lt;/p&gt;

&lt;h3&gt;
  
  
  PreCompact: Capture Everything Before It Disappears
&lt;/h3&gt;

&lt;p&gt;When the PreCompact hook fires, a Python script reads the current session transcript and writes every message to a local SQLite database. Not a summary. Not selected highlights. Every word of every message, including tool calls, file contents, and error output.&lt;/p&gt;

&lt;p&gt;This happens automatically. No manual trigger. No decision about what to keep. The hook fires, the data is captured, and the session continues into compaction. Even if the summary is terrible, the full conversation is safe in the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Simplified version of what the PreCompact hook does
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;pre_compact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transcript_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Read the full JSONL transcript
&lt;/span&gt;    &lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;read_jsonl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transcript_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Write every message to SQLite
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
            INSERT OR IGNORE INTO transcripts 
            (session_id, role, content, timestamp)
            VALUES (?, ?, ?, ?)
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;timestamp&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;

    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PostCompact: Re-inject What Matters
&lt;/h3&gt;

&lt;p&gt;After compaction finishes, the context window is nearly empty. Claude has a lossy summary and nothing else. The PostCompact hook fixes this by searching the database for relevant context and injecting it back.&lt;/p&gt;

&lt;p&gt;It does not dump the entire pre-compaction conversation back in. That would just fill the context window again. Instead, it injects structured context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The current project summary (what this project is, what is in progress, what is blocked)&lt;/li&gt;
&lt;li&gt;The last session's notes (what was accomplished, what is next)&lt;/li&gt;
&lt;li&gt;Recent decisions that are still active&lt;/li&gt;
&lt;li&gt;The most relevant search results from the full conversation history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives Claude enough context to continue working without re-explaining everything, while leaving room in the context window for new work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Simplified version of what the PostCompact hook does
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;post_compact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="c1"&gt;# Get project summary
&lt;/span&gt;    &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT summary FROM project_registry WHERE prefix = ?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fetchone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;## Project Summary&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Get last session notes
&lt;/span&gt;    &lt;span class="n"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT notes FROM sys_sessions WHERE project = ? ORDER BY end_time DESC LIMIT 1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fetchone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;## Last Session&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;additionalContext&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What This Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Without hooks:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[3 hours of debugging WebSocket race condition]
[Auto-compaction fires at 95% context]
[Claude's summary: "We discussed WebSocket issues and debugging"]

You: "What was the root cause we found?"
Claude: "I don't have the specific details from our earlier 
        discussion. Could you remind me what we found?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With hooks:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[3 hours of debugging WebSocket race condition]
[PreCompact fires: full conversation saved to SQLite]
[Auto-compaction fires at 95% context]
[PostCompact fires: project summary + recent context re-injected]

You: "What was the root cause we found?"
Claude: [searches database, finds the exact exchange]
        "The root cause was a race condition in the connection 
         pool cleanup. When two clients disconnected within 
         50ms, the cleanup handler fired twice on the same 
         socket."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is that nothing is lost. Compaction still happens. The context window still gets cleared. But the full conversation exists in the database, searchable on demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Full Hook Lifecycle
&lt;/h2&gt;

&lt;p&gt;PreCompact and PostCompact are two of six hooks that work together to give Claude Code persistent memory across sessions and compaction events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;session-start      loads last session's notes, project context,&lt;/span&gt;
                   &lt;span class="s"&gt;unfinished items&lt;/span&gt;
&lt;span class="s"&gt;user-prompt-submit searches the database on every message, injects&lt;/span&gt;
                   &lt;span class="s"&gt;relevant matches from past conversations&lt;/span&gt;  
&lt;span class="s"&gt;stop               captures new messages to the database after&lt;/span&gt;
                   &lt;span class="s"&gt;every Claude response&lt;/span&gt;
&lt;span class="s"&gt;session-end        triggers backup and sync&lt;/span&gt;
&lt;span class="s"&gt;pre-compact        saves the FULL conversation before compaction&lt;/span&gt;
&lt;span class="s"&gt;post-compact       re-injects relevant context after compaction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pre-compact and post-compact hooks handle within-session continuity. The session-start and stop hooks handle between-session continuity. Together, they give Claude Code a persistent memory layer that survives both compaction and session restarts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Version (No Database Required)
&lt;/h2&gt;

&lt;p&gt;You do not need a full database setup to protect yourself from compaction. Here is a minimal approach using just CLAUDE.md:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add this to your CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Compaction Protocol&lt;/span&gt;

Before any compaction event, save the following to a file 
called SESSION_STATE.md in the project root:
&lt;span class="p"&gt;
1.&lt;/span&gt; Current task and progress
&lt;span class="p"&gt;2.&lt;/span&gt; Key decisions made and their rationale
&lt;span class="p"&gt;3.&lt;/span&gt; Files modified and why
&lt;span class="p"&gt;4.&lt;/span&gt; Errors encountered and their solutions
&lt;span class="p"&gt;5.&lt;/span&gt; Next steps

After compaction, read SESSION_STATE.md and use it to 
restore context.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not automated. Claude has to follow the instruction, and it will not always do so before auto-compaction. But it costs nothing to set up and catches some of the cases.&lt;/p&gt;

&lt;p&gt;For reliable protection, you need hooks. Hooks fire automatically. They do not depend on Claude remembering to follow an instruction.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Hooks Do Not Fix
&lt;/h2&gt;

&lt;p&gt;The hooks solve the data loss problem. They do not solve these:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compaction still happens.&lt;/strong&gt; The hooks do not prevent compaction. They capture the data before it fires and restore context after. The context window still gets cleared.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The summary is still lossy.&lt;/strong&gt; Claude's internal summary after compaction is still a compressed version. The hooks compensate by injecting real data alongside the summary, but the summary itself is unchanged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token limits are real.&lt;/strong&gt; The PostCompact hook cannot inject the entire pre-compaction conversation back. It injects the most relevant context and leaves room for new work. For full retrieval of specific details, Claude searches the database on demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Numbers
&lt;/h2&gt;

&lt;p&gt;This system has been running across 1,300+ sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero messages lost to compaction since deploying the hooks&lt;/li&gt;
&lt;li&gt;Full conversation history searchable with keyword, semantic, and fuzzy search&lt;/li&gt;
&lt;li&gt;69,000+ messages in the database across 9 projects&lt;/li&gt;
&lt;li&gt;Average post-compaction context restoration takes under 2 seconds&lt;/li&gt;
&lt;li&gt;Database size: roughly 1GB for 1,300 sessions (SQLite, fully local)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;The CLAUDE.md approach takes 2 minutes and costs nothing. Start there.&lt;/p&gt;

&lt;p&gt;For the full automated system with hooks, database, search, and MCP tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/mikeadolan/claude-brain/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free, open source, works on macOS, Linux, and Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;github.com/mikeadolan/claude-brain&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Video:&lt;/strong&gt; &lt;a href="https://youtu.be/0kf-6VRi72M" rel="noopener noreferrer"&gt;claude-brain in 85 seconds&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 1:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/how-i-built-persistent-memory-for-claude-code-1dn7"&gt;How I Built Persistent Memory for Claude Code&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 2:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/why-i-use-claude-code-for-everything-2j84"&gt;Why I Use Claude Code for Everything&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 3:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/the-session-protocol-that-fixed-claude-codes-amnesia-problem-1gje"&gt;The Session Protocol That Fixed Claude Code's Amnesia Problem&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>claude</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>The Session Protocol That Fixed Claude Code's Amnesia Problem</title>
      <dc:creator>Mike Dolan</dc:creator>
      <pubDate>Sat, 04 Apr 2026 20:23:32 +0000</pubDate>
      <link>https://dev.to/mikeadolan/the-session-protocol-that-fixed-claude-codes-amnesia-problem-1gje</link>
      <guid>https://dev.to/mikeadolan/the-session-protocol-that-fixed-claude-codes-amnesia-problem-1gje</guid>
      <description>&lt;p&gt;Claude Code forgets everything when you close the terminal. Every session starts from zero. No memory of what was decided, what failed, what to do next. You re-explain the same context every single time.&lt;/p&gt;

&lt;p&gt;I have been running Claude Code daily for months across 9 projects. 1,300+ sessions, 69,000+ messages. At that scale, re-explaining context is not a minor annoyance. It is a productivity killer.&lt;/p&gt;

&lt;p&gt;MEMORY.md does not solve this. It is a flat file with a 200-line cap and a 25KB size limit where the AI decides what to remember. There is no handoff protocol. No structured way to end one session and start the next one with full context. So I built one.&lt;/p&gt;

&lt;p&gt;This article is about the session protocol I use to give Claude Code continuity across sessions. It is part of &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;claude-brain&lt;/a&gt;, my open source persistent memory system. But the protocol pattern works even if you never install the brain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: No Handoff
&lt;/h2&gt;

&lt;p&gt;Here is what happens without a protocol:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You work with Claude for 3 hours on a complex feature&lt;/li&gt;
&lt;li&gt;Context window fills up or you close the terminal&lt;/li&gt;
&lt;li&gt;You open a new session&lt;/li&gt;
&lt;li&gt;Claude has no idea what happened&lt;/li&gt;
&lt;li&gt;You spend 15 minutes re-explaining where you left off&lt;/li&gt;
&lt;li&gt;Claude makes the same wrong suggestions you already rejected last session&lt;/li&gt;
&lt;li&gt;Repeat&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The core issue is that there is no structured handoff between sessions. No checklist. No verification. No continuity. Every session is an island.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: Start and End Protocols
&lt;/h2&gt;

&lt;p&gt;I built two protocols that run at the beginning and end of every session. They live in three places that work together:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CLAUDE.md&lt;/strong&gt; is a project-level instruction file that Claude reads automatically when it opens a session. This is where the protocol rules are defined. Claude follows these instructions the same way a new employee follows an onboarding document. The start checklist, end checklist, verification steps, and "no coding without GO" rules are all in here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SESSION_PROTOCOLS.md&lt;/strong&gt; is a human-readable reference copy of the same protocols. It exists so I can review and update the rules without digging through CLAUDE.md's other project instructions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Six Python hook scripts&lt;/strong&gt; in the &lt;code&gt;hooks/&lt;/code&gt; folder handle the automation. Claude Code has a hook system that fires scripts at specific points in a session. These are real Python scripts that run automatically, not manual steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session-start.py      reads NEXT_SESSION.md + injects last session's notes,
                      unfinished items, and the verification checklist
user-prompt-submit.py searches the brain database on every prompt,
                      injects relevant matches into context
stop.py               captures the conversation to the database
                      on every Claude response
session-end.py        triggers sync and backup when the session closes
pre-compact.py        saves full context before the context window resets
post-compact.py       re-injects brain context after compaction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hooks enforce the protocol even when I forget to ask for it. The session-start hook injects the checklist requirements automatically. Claude cannot skip them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NEXT_SESSION.md&lt;/strong&gt; is the bridge file. At the end of every session, Claude writes a summary and my forward instructions into this file. At the start of the next session, &lt;code&gt;session-start.py&lt;/code&gt; reads it and injects the contents into context. This is how past-me communicates with future-Claude.&lt;/p&gt;

&lt;h3&gt;
  
  
  End-Session Protocol: Capture Everything Before Closing
&lt;/h3&gt;

&lt;p&gt;When I say "end session" (or "wrap up" or "done for today"), Claude must complete all of these steps and show me the checklist:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Write session notes to the database.&lt;/strong&gt;&lt;br&gt;
A structured summary: what was done, what decisions were made, what files were changed, what is unfinished. These notes are written directly to a local SQLite database using a script. They include tags for categorization (coding, debugging, research, etc.).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Update the project summary.&lt;/strong&gt;&lt;br&gt;
Not a patch. A full rewrite of the project's current state. This summary powers the next session's context injection and also feeds into daily email digests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Update MEMORY.md as a backup.&lt;/strong&gt;&lt;br&gt;
The "last session" section gets overwritten with the current session's summary. This is a fallback in case the database is unavailable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Update governance files.&lt;/strong&gt;&lt;br&gt;
The project tracker, feature plan, and any other files that track progress. If a step was completed, it gets marked done. If a new decision was made, it gets logged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Ask me one question: "Anything you want Claude to know next session?"&lt;/strong&gt;&lt;br&gt;
This is the most important step. Whatever I answer gets written into a file called NEXT_SESSION.md. The session-start hook reads this file automatically and injects it into the next session's context. This is how I pass instructions forward to a future Claude that has no memory of the current conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Write NEXT_SESSION.md.&lt;/strong&gt;&lt;br&gt;
The full session summary plus my answer from step 5. This file is the bridge between sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Git commit and push.&lt;/strong&gt;&lt;br&gt;
All changes are committed. Nothing is left in a dirty state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Output the verified checklist.&lt;/strong&gt;&lt;br&gt;
Every step must show DONE:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-----------------------------+----------+
| End-Session Checklist       | Status   |
+-----------------------------+----------+
| Session notes + tags written | DONE     |
+-----------------------------+----------+
| Project summary updated     | DONE     |
+-----------------------------+----------+
| MEMORY.md updated           | DONE     |
+-----------------------------+----------+
| Governance files updated    | DONE     |
+-----------------------------+----------+
| NEXT_SESSION.md written     | DONE     |
+-----------------------------+----------+
| Git committed + pushed      | DONE     |
+-----------------------------+----------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If any row shows MISSING, we stop and fix it before closing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start-Session Protocol: Verify Before Acting
&lt;/h3&gt;

&lt;p&gt;When a new session starts, Claude must complete all of these steps before doing anything else. Before answering questions. Before writing code. Before proposing a plan. The checklist comes first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Search the brain.&lt;/strong&gt;&lt;br&gt;
The brain is a local database of every conversation I have ever had with Claude. On session start, Claude searches it for recent context: what was discussed, what is unfinished, what decisions are locked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Read the project tracker.&lt;/strong&gt;&lt;br&gt;
This is the source of truth for where things stand. What steps are done, what is in progress, what is next. Claude reads this so it does not suggest work that is already completed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Review the session-start hook output.&lt;/strong&gt;&lt;br&gt;
The hook automatically injects: last session's notes, flagged unfinished items, a verification checklist, and recent session topics. Claude must actually review this, not just acknowledge it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Verify before acting.&lt;/strong&gt;&lt;br&gt;
If picking up unfinished work, Claude must verify the premise independently. Do not trust the notes blindly. Re-read the file. Check the current state. Confirm the problem still exists. This rule exists because prior sessions sometimes left notes with wrong assumptions that led to hours of wasted work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Present unfinished items and next-session notes to me.&lt;/strong&gt;&lt;br&gt;
This is critical. I need to SEE the unfinished items and the notes I left for this session. Not a checkmark. Not "I reviewed them." The actual content, presented prominently so I can react to it. Sometimes what I said at the end of a long session at midnight is not what I want to work on the next morning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Output the verified checklist.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-------------------------------------+----------+
| Start-Session Checklist             | Status   |
+-------------------------------------+----------+
| Brain searched                      | DONE     |
+-------------------------------------+----------+
| PROJECT_TRACKER.md read             | DONE     |
+-------------------------------------+----------+
| Session-start hook output reviewed  | DONE     |
+-------------------------------------+----------+
| Unfinished items SHOWN to user      | DONE     |
+-------------------------------------+----------+
| Next-session notes SHOWN to user    | DONE     |
+-------------------------------------+----------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. Confirm ready.&lt;/strong&gt;&lt;br&gt;
Claude states what it knows: "Brain searched. Last session: [summary]. Tracker read. Current step: [step]. Ready."&lt;/p&gt;

&lt;p&gt;Only then do we start working.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Checklists Matter
&lt;/h2&gt;

&lt;p&gt;AI will skip steps. Not maliciously. It just prioritizes answering your question over following a protocol. Without a checklist, Claude will jump straight into whatever you asked and skip the context loading. This happened to me in sessions 35, 38, and 39 before I enforced the checklist.&lt;/p&gt;

&lt;p&gt;The checklist is not optional. The hooks inject the requirements automatically. CLAUDE.md reinforces them as explicit rules. The combination makes it reliable. Not perfect, but close enough that I catch failures immediately when they happen.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Bridge: NEXT_SESSION.md
&lt;/h2&gt;

&lt;p&gt;This file is the single most valuable piece of the protocol. Here is why.&lt;/p&gt;

&lt;p&gt;At the end of every session, I tell Claude what the next session should know. Real examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Priority tomorrow is pushing dev to main. Do not start anything else."&lt;/li&gt;
&lt;li&gt;"The authentication bug is NOT in the middleware. Do not go down that path again. Check the token validation."&lt;/li&gt;
&lt;li&gt;"I changed my mind on the database schema. Ignore everything from session 42 about the users table."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are instructions from past-me to future-Claude. They prevent re-litigating decisions, repeating mistakes, and going down paths I already rejected.&lt;/p&gt;

&lt;p&gt;The session-start hook reads NEXT_SESSION.md and injects it into context. But the protocol also requires Claude to SHOW me the contents so I can override them. Sometimes what I said last night is not what I want today.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Safety Net: Frustration Circuit Breaker
&lt;/h2&gt;

&lt;p&gt;One more thing the protocol handles. When my message indicates frustration (all caps, repeated punctuation, anger keywords), the user-prompt-submit hook automatically searches the brain for the current topic and injects a STOP directive. This forces Claude to reassess instead of continuing down a wrong path.&lt;/p&gt;

&lt;p&gt;This exists because the worst sessions happen when Claude keeps iterating on a broken approach while I get increasingly frustrated. The circuit breaker catches that pattern and breaks the loop.&lt;/p&gt;
&lt;h2&gt;
  
  
  What This Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;End of Monday's session:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Me: "end session"

Claude: [writes notes, updates tracker, updates summaries]
Claude: "Anything you want Claude to know next session?"

Me: "The FTS5 bug is fixed. Do not touch fuzzy search again.
      Priority is pushing dev to main and outreach."

Claude: [writes NEXT_SESSION.md, commits, shows checklist, all DONE]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Start of Tuesday's session:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Claude: [searches brain, reads tracker, reads hook output]
Claude: "Session 48 summary: FTS5 fuzzy bug fixed, hook improvements
         on dev, outreach across 5 platforms.

         Your notes for this session:
         - FTS5 bug is fixed. Do not touch fuzzy search.
         - Priority: push dev to main and outreach.

         Unfinished: dev branch 3 commits ahead of main.
         Tracker: step 51/52 complete.

         [checklist table, all DONE]

         Ready."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No re-explaining. No context loss. Claude knows exactly where we left off and what I want to do today.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pattern Without claude-brain
&lt;/h2&gt;

&lt;p&gt;You do not need the full brain system to use this pattern. Here is the minimum viable version:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a NEXT_SESSION.md in your project root.&lt;/strong&gt;&lt;br&gt;
At the end of every session, tell Claude to write a summary and your next-session instructions to this file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Add this to your CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When starting a session, read NEXT_SESSION.md first.
Show me the contents before doing anything else.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Add an end-session instruction to CLAUDE.md:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When I say "end session", write a summary of what was done,
what is unfinished, and ask me what the next session should know.
Save to NEXT_SESSION.md.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is it. Three steps. You get 80% of the value with zero infrastructure.&lt;/p&gt;

&lt;p&gt;The full brain system adds automated hooks (so you cannot forget), database-backed search (so Claude can find anything from any session), and enforcement mechanisms (so the protocol actually runs every time). But the core idea is just structured handoffs between sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Numbers
&lt;/h2&gt;

&lt;p&gt;This protocol has been running across 1,300+ sessions and 9 projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero sessions where Claude started without context (since enforcing the checklist)&lt;/li&gt;
&lt;li&gt;Average re-explanation time dropped from 15 minutes to under 1 minute&lt;/li&gt;
&lt;li&gt;Session quality scores improved because Claude stops repeating rejected approaches&lt;/li&gt;
&lt;li&gt;NEXT_SESSION.md has caught 4 cases where the prior session left wrong assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;The minimum version (NEXT_SESSION.md + CLAUDE.md instructions) takes 2 minutes to set up. Start there.&lt;/p&gt;

&lt;p&gt;If you want the full system with automated hooks, database, search, email digests, and MCP tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/mikeadolan/claude-brain/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free, open source, works on macOS, Linux, and Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;github.com/mikeadolan/claude-brain&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Video:&lt;/strong&gt; &lt;a href="https://youtu.be/0kf-6VRi72M" rel="noopener noreferrer"&gt;claude-brain in 85 seconds&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 1:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/how-i-built-persistent-memory-for-claude-code-1dn7"&gt;How I Built Persistent Memory for Claude Code&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Article 2:&lt;/strong&gt; &lt;a href="https://dev.to/mikeadolan/why-i-use-claude-code-for-everything-2j84"&gt;Why I Use Claude Code for Everything&lt;/a&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>productivity</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Why I Use Claude Code for Everything</title>
      <dc:creator>Mike Dolan</dc:creator>
      <pubDate>Fri, 03 Apr 2026 20:23:04 +0000</pubDate>
      <link>https://dev.to/mikeadolan/why-i-use-claude-code-for-everything-2j84</link>
      <guid>https://dev.to/mikeadolan/why-i-use-claude-code-for-everything-2j84</guid>
      <description>&lt;p&gt;Most Claude users split their work across three products. Chat for conversations and questions. Code for development. Cowork for task management and desktop automation. Three interfaces, three separate memory systems, three places where your context gets fragmented.&lt;/p&gt;

&lt;p&gt;I stopped doing that. I run everything through Claude Code. One interface, one memory system, full control. Here is how and why.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With Splitting Your Work
&lt;/h2&gt;

&lt;p&gt;When you use Chat for a planning conversation, then switch to Code for implementation, then use Cowork to manage tasks, each one starts from zero. Chat does not know what you discussed in Code. Code does not know what you planned in Chat. You re-explain context every time you switch.&lt;/p&gt;

&lt;p&gt;Even within each product, memory is limited. Chat has built-in memory but it is selective. Code has MEMORY.md with a 200-line cap where the AI decides what to keep. Cowork has project context but it is scoped to that workspace.&lt;/p&gt;

&lt;p&gt;The result: you are managing the AI's memory instead of doing your work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Setup: Claude Code + claude-brain + Telegram
&lt;/h2&gt;

&lt;p&gt;Here is what I run instead:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; handles everything. Coding, planning, research, writing, file management, system administration, project management. It is not just a coding tool. It is a full AI assistant with shell access, file access, and tool use. It runs on macOS, Linux (Ubuntu, Fedora, Arch), and Windows. Terminal or IDE (VS Code, Zed, JetBrains). Works anywhere Claude Code runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;claude-brain&lt;/strong&gt; captures every word of every conversation automatically to a local SQLite database. Six hooks handle the full session lifecycle. No manual saving. Every session, every project, fully searchable with keyword, semantic, and fuzzy search. When I start a new session, the brain injects my last session's notes and project context so Claude knows where I left off. On every prompt, a hook searches the database for relevant matches and injects them into context. For deeper searches, I ask Claude directly and it uses the MCP tools or slash commands to search across everything. Tested on macOS, Ubuntu, Windows (automated CI), and Fedora. One command install on any platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Telegram&lt;/strong&gt; gives me Claude Code on my phone. I send a message from Telegram, it goes to a running Claude Code instance. Claude responds, the response comes back to Telegram. I can assign tasks, check progress, and get notified when things finish. All from my phone without opening the laptop. Works on any phone, any OS, anywhere you have signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Replaces
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Instead of Chat:&lt;/strong&gt; I ask Claude Code questions, have planning conversations, discuss strategy. The brain captures everything. Next session, it remembers the entire discussion. Chat cannot do this across sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of Cowork:&lt;/strong&gt; I manage tasks and projects directly through Claude Code. The brain tracks decisions, project facts, and session history. I get email digests every morning with per-project status, blockers, and next steps. No separate task management tool needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of switching between products:&lt;/strong&gt; Everything happens in one place. One conversation history. One memory system. One search across everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus: your existing AI history comes with you.&lt;/strong&gt; claude-brain imports your full conversation history from ChatGPT, Gemini, and Claude.ai. Export your data from OpenAI, Google Takeout, or the Claude.ai Chrome extension, run the import, and everything is searchable in one database alongside your Claude Code sessions. No other tool does this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Multiple Projects at Once
&lt;/h2&gt;

&lt;p&gt;Each project gets its own folder with a CLAUDE.md file. I also have a general project where anything that is not broken out into its own project lives. That is where I ask Claude questions, do research, brainstorm, or work on anything that does not have a dedicated home yet. It all gets captured the same way.&lt;/p&gt;

&lt;p&gt;I can have multiple Claude Code sessions running simultaneously in different projects, each with full access to the shared brain. Cross-project search means decisions made in one project are visible from any other. If I discussed a deployment approach in one project three weeks ago, the brain finds it when I am working on a different project today.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Phone Workflow
&lt;/h2&gt;

&lt;p&gt;This is the part most people have not seen. With Telegram connected to Claude Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I am away from my desk&lt;/li&gt;
&lt;li&gt;I send a message from my phone: "Search the brain for what we decided about the database schema"&lt;/li&gt;
&lt;li&gt;Claude Code searches, finds the decision, sends the answer back to Telegram&lt;/li&gt;
&lt;li&gt;I reply with follow-up questions or assign new tasks&lt;/li&gt;
&lt;li&gt;When I get back to my desk, everything is captured in the brain&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also set up voice message transcription so I can send a voice note from Telegram and Claude processes it as text. When I am away from my desk or just thinking out loud, I talk instead of type. It keeps things moving without needing the laptop open.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Lose
&lt;/h2&gt;

&lt;p&gt;Honestly, not much:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chat's web interface:&lt;/strong&gt; You lose the browser-based UI. Claude Code is terminal-based (or IDE-integrated via VS Code/Zed). If you strongly prefer a web UI, this is not for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cowork's desktop automation:&lt;/strong&gt; Cowork can control desktop apps directly (click buttons, fill forms). Claude Code does not do this natively, though with MCP tools like browser automation you can get close.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chat's built-in memory import:&lt;/strong&gt; Chat imports from ChatGPT, Gemini, and Grok natively. But claude-brain also imports from ChatGPT, Gemini, and Claude.ai, so you actually get the same coverage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What You Gain
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lossless memory.&lt;/strong&gt; Every word captured. Nothing summarized away. Nothing silently dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-session search.&lt;/strong&gt; Find anything you discussed, decided, or worked on across all sessions and all projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-project intelligence.&lt;/strong&gt; No silos. Search your entire history from any project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compaction survival.&lt;/strong&gt; Pre-compact and post-compact hooks capture context before the context window resets and re-inject it after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email digests.&lt;/strong&gt; No other AI product does this. Three built-in templates: daily standup (per-project "Pick Up Here" with blockers and next steps), weekly digest (executive summary with week-over-week trends and dormant project alerts), and project deep dive (full status report for one project). Schedule them via cron and forget. Your inbox becomes your project dashboard without opening any app. And because the brain has full lossless context of every conversation, what you build on top of it is unlimited. Custom reports, cross-project analysis, pattern detection, decision audit trails, accountability digests you forward to a collaborator. The complete history is there. How you use it is up to you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone access.&lt;/strong&gt; Full Claude Code interaction from Telegram on your phone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session quality tracking.&lt;/strong&gt; Every session scored from -3 to +3 with tags like completions, decisions, debugging, rework, frustrated. Ask "show me my worst sessions and what went wrong" and the brain finds patterns across your entire history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full control.&lt;/strong&gt; You own your data. Local SQLite on your machine. No cloud, no API keys. Works on macOS, Linux, and Windows. You decide what gets remembered, not the AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the Daily Email Looks Like
&lt;/h2&gt;

&lt;p&gt;Here is a real example of the daily standup that hits your inbox every morning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Subject: [brain] Daily: 3 sessions, 892 msgs | Mar 12

Daily Standup - Wednesday, Mar 12

3 sessions across 2 projects yesterday (myapp, api-service) with 892 messages.

[ON TRACK] myapp
  Pick Up Here: Implement rate limiting on /api/upload endpoint
  In Progress: Auth refactor (80%), rate limiting (not started)
  Yesterday (2 sessions): Auth middleware refactor, API endpoint tests

[AT RISK] api-service
  Pick Up Here: Fix flaky CI tests blocking deploy
  Blockers: CI pipeline fails intermittently on integration tests
  Yesterday (1 session): Investigated CI timeout issue

No Activity Yesterday:
  docs - last session Mar 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You open your laptop, check your email, and you know exactly where every project stands before you type a single prompt. Forward the weekly digest to a manager or collaborator and they have a full status report without asking you for one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code (Anthropic Max subscription)&lt;/li&gt;
&lt;li&gt;claude-brain (free, open source): &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;https://github.com/mikeadolan/claude-brain&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Telegram bot for mobile access&lt;/li&gt;
&lt;li&gt;Zed or VS Code for IDE integration (optional)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is This For Everyone?
&lt;/h2&gt;

&lt;p&gt;No. If you write code occasionally and just need quick answers, Chat is fine. If you need desktop automation, Cowork makes sense.&lt;/p&gt;

&lt;p&gt;But if you use Claude daily across multiple projects, if you are tired of re-explaining context, if you want one place where everything is captured and searchable, this setup is worth the 5 minutes it takes to install.&lt;/p&gt;

&lt;p&gt;I have been running it for months. 67,000+ messages across multiple projects. It works.&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How I Built Persistent Memory for Claude Code</title>
      <dc:creator>Mike Dolan</dc:creator>
      <pubDate>Thu, 02 Apr 2026 14:41:41 +0000</pubDate>
      <link>https://dev.to/mikeadolan/how-i-built-persistent-memory-for-claude-code-1dn7</link>
      <guid>https://dev.to/mikeadolan/how-i-built-persistent-memory-for-claude-code-1dn7</guid>
      <description>&lt;p&gt;Every Claude Code session starts from zero. Close the terminal and everything is gone. Decisions you locked last week, context from three projects, that debugging session where you finally figured out the root cause. All lost. You re-explain yourself every single time.&lt;/p&gt;

&lt;p&gt;MEMORY.md is supposed to help. It is a flat file with a 200-line and 25KB cap, no search, and no structure. Worse, the AI decides what gets remembered and what gets thrown away. You have no control over what it keeps, what it summarizes, and what it silently drops. That is the core problem. claude-brain puts you in control of your data. Every word of every chat of every conversation across every project is auto-captured. Nothing is lost. You decide what matters.&lt;/p&gt;

&lt;p&gt;I spent weeks building a real solution. It is called claude-brain. It is free, open source, and running right now on 1,321 sessions, 67,000+ messages, and 9 projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Claude Knows With the Brain
&lt;/h2&gt;

&lt;p&gt;Without it, Claude starts every session as a stranger. With it, Claude knows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Who you are&lt;/strong&gt; - name, preferences, working style, career goals&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you have discussed&lt;/strong&gt; - every conversation, searchable by keyword, meaning, or fuzzy match&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you have decided&lt;/strong&gt; - numbered, locked decisions that Claude will not re-ask&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What is true about your projects&lt;/strong&gt; - features, architecture, timelines, status&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What happened recently&lt;/strong&gt; - session summaries, project health, next steps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What connects your projects&lt;/strong&gt; - cross-project search finds related work, shared patterns, decisions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you should do today&lt;/strong&gt; - proactive email briefings with per-project next steps and blockers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;p&gt;The system has three layers: capture, storage, and retrieval.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capture: Six Hooks
&lt;/h3&gt;

&lt;p&gt;Claude Code has a hook system that lets you run scripts at specific points in a session lifecycle. claude-brain uses all six:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session-start      → loads recent session notes, project context
user-prompt-submit → searches your full history, injects relevant matches
stop               → captures the conversation to the database
session-end        → triggers sync and backup
pre-compact        → saves all context before the context window resets
post-compact       → re-injects brain context after compaction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pre-compact and post-compact hooks are critical. During long sessions, Claude Code compacts your conversation to fit the context window. Without these hooks, everything before compaction is gone. With them, the brain captures the full conversation before compaction and re-injects the most relevant context after. Nothing is lost.&lt;/p&gt;

&lt;p&gt;You never manually save anything. The hooks handle everything automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Happens When You Start a Session
&lt;/h3&gt;

&lt;p&gt;You navigate to a project folder and type &lt;code&gt;claude&lt;/code&gt;. Four things happen behind the scenes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CLAUDE.md loads&lt;/strong&gt; - your project folder has a CLAUDE.md with project-specific instructions. Claude reads this automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session-start hook fires&lt;/strong&gt; - loads your last session's notes, flags unfinished items, injects everything into Claude's context so it knows where you left off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory search hook activates&lt;/strong&gt; - on every message you send, a script searches your brain database for relevant past conversations and injects them into Claude's context. You do not see this happening, but Claude does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP tools become available&lt;/strong&gt; - Claude can search transcripts, look up decisions, check project facts, and query your profile on its own.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You do not configure anything per session. It just works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Storage: Local SQLite
&lt;/h3&gt;

&lt;p&gt;Everything goes into a single SQLite database on your machine. No cloud, no API keys, no external services. The database stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every message from every conversation (lossless, no summarization)&lt;/li&gt;
&lt;li&gt;Session metadata (timestamps, project, message counts)&lt;/li&gt;
&lt;li&gt;Session notes (structured summaries written at end of each session)&lt;/li&gt;
&lt;li&gt;Numbered decisions with rationale&lt;/li&gt;
&lt;li&gt;Project-specific facts&lt;/li&gt;
&lt;li&gt;Personal preferences and profile data&lt;/li&gt;
&lt;li&gt;Session quality scores and tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One database, all projects, fully local. Your data never leaves your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Retrieval: Three Search Modes
&lt;/h3&gt;

&lt;p&gt;Having a database full of conversations is useless if you cannot find what you need. claude-brain has three search modes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keyword search (FTS5):&lt;/strong&gt; SQLite's full-text search engine with tokenization and ranking. Fast and precise. Search for "payment API" and it finds every message containing those words across all projects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Under the hood: FTS5 query with recency bias
&lt;/span&gt;&lt;span class="n"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt;
&lt;span class="n"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;transcripts_fts&lt;/span&gt;
&lt;span class="n"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;transcripts_fts&lt;/span&gt; &lt;span class="n"&gt;MATCH&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;payment API&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;ORDER&lt;/span&gt; &lt;span class="n"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;rank&lt;/span&gt;
&lt;span class="n"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Semantic search:&lt;/strong&gt; Sentence-transformer embeddings (27,000+ indexed) with cosine similarity. Search by meaning, not just words. "How users pay" finds payment discussions even when those exact words never appear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fuzzy search:&lt;/strong&gt; Typo-tolerant matching. "sesion" auto-corrects to "session" before the query runs. Useful when you cannot remember the exact term.&lt;/p&gt;

&lt;p&gt;All three work cross-project. No silos. Search your entire history from any session.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Can Actually Ask
&lt;/h2&gt;

&lt;p&gt;The brain is not a passive archive. Here are real things you can type in Claude Code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple searches:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="s2"&gt;"Search the brain for authentication"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="s2"&gt;"Find sessions about Docker"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="s2"&gt;"Look up the payment API"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Complex queries:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"What did we work on two days ago around 2pm?"
"Show me every decision we made about the database"
"Find conversations where I was frustrated - what went wrong?"
"Compare my most productive sessions to my worst ones"
"What's the full history of this project from the beginning?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Meaning-based searches&lt;/strong&gt; (finds related content even when words do not match):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"How do users pay for things?" → finds payment API discussions
"Sessions about server problems" → finds deployment errors, timeouts, Docker issues
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Cross-project intelligence:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Search all projects for anything about Docker"
"What decisions have we made about APIs across every project?"
"What patterns show up in my worst sessions across all projects?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post-mortem and lessons learned:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Look at my worst-rated sessions and tell me what went wrong"
"What mistakes keep repeating across my projects?"
"Compare my best and worst sessions - what patterns do you see?"
"Find every time I had to redo something - what caused it?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Makes It Different
&lt;/h2&gt;

&lt;p&gt;I looked at every memory tool out there before building this. Here is what I found and why I went a different direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lossless Capture
&lt;/h3&gt;

&lt;p&gt;Most memory tools extract "memories" from your conversations and throw away the raw transcript. They decide what matters and discard the rest. The problem is they are wrong often enough that it matters. When you need the exact thing you said three weeks ago, a summarized memory does not help.&lt;/p&gt;

&lt;p&gt;claude-brain keeps every word. The raw conversation is the database. Search finds it. Nothing is summarized away, nothing is lost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-Platform Imports
&lt;/h3&gt;

&lt;p&gt;No other memory tool does this. claude-brain imports your full conversation history from ChatGPT and Gemini into the same database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ChatGPT:&lt;/strong&gt; Export your data from OpenAI, run &lt;code&gt;/brain-import&lt;/code&gt;, done&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini:&lt;/strong&gt; Google Takeout export, run &lt;code&gt;/brain-import&lt;/code&gt;, done&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude.ai:&lt;/strong&gt; Chrome extension export, run &lt;code&gt;/brain-import&lt;/code&gt;, done&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One database. Every AI conversation you have ever had. Fully searchable with all three search modes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Email Digests
&lt;/h3&gt;

&lt;p&gt;The brain reaches out to you. Schedule via cron and forget. Three built-in templates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Daily standup:&lt;/strong&gt; Per-project status with "Pick Up Here" notes, blockers, accomplishments&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekly digest:&lt;/strong&gt; Executive summary, week-over-week trends, health portfolio, dormant project alerts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project deep dive:&lt;/strong&gt; Full status for a single project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is what the daily standup looks like in your inbox:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight email"&gt;&lt;code&gt;&lt;span class="nt"&gt;Subject&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="na"&gt; [brain] Daily: 3 sessions, 892 msgs | Mar 12&lt;/span&gt;

Daily Standup - Wednesday, Mar 12

3 sessions across 2 projects yesterday (myapp, api-service) with 892 messages.

[ON TRACK] myapp
  Pick Up Here: Implement rate limiting on /api/upload endpoint
  In Progress: Auth refactor (80%), rate limiting (not started)
  Yesterday (2 sessions): Auth middleware refactor, API endpoint tests

[AT RISK] api-service
  Pick Up Here: Fix flaky CI tests blocking deploy
  Blockers: CI pipeline fails intermittently on integration tests
  Yesterday (1 session): Investigated CI timeout issue

No Activity Yesterday:
  docs - last session Mar 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are just starting points. Because the brain has full lossless context of every conversation across every project, what you can build on top of it is unlimited. Custom reports, cross-project analysis, pattern detection, decision audit trails. The complete history is there. How you use it is up to you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Session Quality Scoring
&lt;/h3&gt;

&lt;p&gt;Every session is automatically scored from -3 (worst) to +3 (best) based on content patterns, and tagged with labels like &lt;code&gt;completions&lt;/code&gt;, &lt;code&gt;decisions&lt;/code&gt;, &lt;code&gt;debugging&lt;/code&gt;, &lt;code&gt;corrections&lt;/code&gt;, &lt;code&gt;rework&lt;/code&gt;, and &lt;code&gt;frustrated&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This lets you do things no other tool supports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Show me sessions with the lowest quality scores"
"Which sessions had the most rework?"
"Compare my best and worst sessions - what patterns do you see?"
"What tags are most common in project A vs project B?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The best sessions often have both positive and negative tags. "Frustrated + completions + decisions" means hard productive work. "Frustrated + rework + corrections" with no completions means a bad session. The brain tracks this automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Human vs. Project Memory
&lt;/h3&gt;

&lt;p&gt;Personal preferences (how you think, how you like to work, communication style) are stored globally and follow you across every project. Project-specific facts (this repo uses pytest, deploys through ArgoCD) are scoped to that project. You do not have to teach Claude who you are every time you switch repos.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tags and Topic Discovery
&lt;/h3&gt;

&lt;p&gt;Sessions are auto-tagged by topic during import (coding, finance, family, research, etc.). Browse your sessions by topic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/brain-topics              &lt;span class="c"&gt;# Show all tags with counts&lt;/span&gt;
/brain-topics finance      &lt;span class="c"&gt;# Show all sessions tagged 'finance'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit tags anytime. Tell Claude "tag this session as finance, coding" and it updates directly. For bulk tagging, &lt;code&gt;/brain-tag-review&lt;/code&gt; generates a spreadsheet you can edit and reimport.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Project Workflow
&lt;/h2&gt;

&lt;p&gt;claude-brain works across multiple projects from a single database. Each project gets its own folder with a CLAUDE.md file. You can run multiple Claude Code sessions simultaneously in different projects, each with full brain access.&lt;/p&gt;

&lt;p&gt;All sessions share the same database. If you make a decision in one project, Claude in the other project can find it via cross-project search.&lt;/p&gt;

&lt;p&gt;To add a new project after initial setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/path/to/claude-brain
python3 scripts/add-project.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script creates the folder, CLAUDE.md, config entry, database registration, and MCP registration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Machine Sync
&lt;/h2&gt;

&lt;p&gt;claude-brain supports syncing between machines via Dropbox, OneDrive, Google Drive, or iCloud. Project files (scripts, hooks, config) sync via your cloud provider. The database stays on local disk (SQLite + cloud sync = corruption risk). Backups sync automatically. JSONL reconciliation at startup catches exchanges from other machines.&lt;/p&gt;

&lt;p&gt;The setup script asks whether you want synced or local mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  The MCP Server
&lt;/h2&gt;

&lt;p&gt;claude-brain registers an MCP server with 11 read-only tools. Claude can query the brain directly mid-conversation without you doing anything:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;search_transcripts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Keyword search across all conversations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;search_semantic&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Meaning-based search using embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_profile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your complete profile and preferences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_project_state&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Recent decisions and facts for a project&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lookup_decision&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search locked decisions by keyword&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lookup_fact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project-specific facts by category&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_session&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full transcript of a specific session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_recent_summaries&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Recent session recaps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Database health check&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  14 Slash Commands
&lt;/h2&gt;

&lt;p&gt;When you want direct control, type these in any Claude Code session:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-question&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Natural language question across the brain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-search&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Raw transcript search with timestamps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-history&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Session timeline, one line per session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-recap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Progress report for a time range&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-decide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Decision lookup by number or keyword&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-health&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full 9-point diagnostic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Quick stats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-import&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Import conversations (Claude.ai, ChatGPT, Gemini)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-export&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Export brain data to text files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-topics&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Browse sessions by tag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-tag-review&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Batch tag review via spreadsheet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-questionnaire&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fill out or update your profile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-setup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Re-run setup to add projects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/brain-consistency&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Automated consistency check&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Auto-Update Notifications
&lt;/h2&gt;

&lt;p&gt;The brain checks for updates automatically on every session start. When an update is available, you see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Brain Update Available
To update: &lt;span class="nb"&gt;cd&lt;/span&gt; /your/install/path &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git pull &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip3 &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Updates never happen automatically. You decide when to pull.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Numbers
&lt;/h2&gt;

&lt;p&gt;This is not a prototype. It has been my primary development environment for over a month:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1,321 sessions&lt;/li&gt;
&lt;li&gt;67,000+ messages&lt;/li&gt;
&lt;li&gt;27,000+ semantic embeddings&lt;/li&gt;
&lt;li&gt;9 projects&lt;/li&gt;
&lt;li&gt;4 data sources (Claude Code, Claude.ai, ChatGPT, Gemini)&lt;/li&gt;
&lt;li&gt;6 hooks, 11 MCP tools, 14 slash commands&lt;/li&gt;
&lt;li&gt;CI green on macOS, Ubuntu, and Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Known Limitations
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Limitation&lt;/th&gt;
&lt;th&gt;Detail&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single-user&lt;/td&gt;
&lt;td&gt;One person, one database. No multi-user support.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No auto-capture from claude.ai&lt;/td&gt;
&lt;td&gt;Manual export + &lt;code&gt;/brain-import&lt;/code&gt; required.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Semantic search cold-start&lt;/td&gt;
&lt;td&gt;First query takes 4-5 seconds to load the model. Fast after that.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No cross-machine real-time DB sync&lt;/td&gt;
&lt;td&gt;DB is local. Project files sync; database does not.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;One command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/mikeadolan/claude-brain/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The setup script walks you through everything: projects, database, hooks, MCP, email, health check.&lt;/p&gt;

&lt;p&gt;Requirements: Python 3.10+, Claude Code 2.0+, pip3.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I have built websites, launched a venture-backed startup, and managed complex systems throughout my career. I was using Claude Code daily across multiple projects and the memory problem kept getting worse. Every session started from scratch. I was re-explaining the same context over and over. So I built the brain out of necessity.&lt;/p&gt;

&lt;p&gt;It has been running for months. 67,000+ messages, every word from every conversation, every project, all in one local database. Been working great.&lt;/p&gt;

&lt;p&gt;On this project I was the architect, project manager, code reviewer, and QA. Claude Code was my development partner. This is what building software looks like now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mikeadolan/claude-brain" rel="noopener noreferrer"&gt;github.com/mikeadolan/claude-brain&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video walkthrough:&lt;/strong&gt; &lt;a href="https://youtu.be/0kf-6VRi72M" rel="noopener noreferrer"&gt;claude-brain in 85 seconds&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roadmap:&lt;/strong&gt; &lt;a href="https://github.com/mikeadolan/claude-brain/discussions/1" rel="noopener noreferrer"&gt;What's Next&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you use Claude Code daily, I would love feedback. Issues and PRs welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
