<?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: Kavish Dua</title>
    <description>The latest articles on DEV Community by Kavish Dua (@catfish1234).</description>
    <link>https://dev.to/catfish1234</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%2F3981966%2F19da5ef7-2c44-480c-b8cb-f9c6435a8c73.png</url>
      <title>DEV Community: Kavish Dua</title>
      <link>https://dev.to/catfish1234</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/catfish1234"/>
    <language>en</language>
    <item>
      <title>I built an MCP server that gives AI coding assistants persistent memory (85.6% token reduction)</title>
      <dc:creator>Kavish Dua</dc:creator>
      <pubDate>Fri, 12 Jun 2026 22:21:59 +0000</pubDate>
      <link>https://dev.to/catfish1234/i-built-an-mcp-server-that-gives-ai-coding-assistants-persistent-memory-856-token-reduction-9bl</link>
      <guid>https://dev.to/catfish1234/i-built-an-mcp-server-that-gives-ai-coding-assistants-persistent-memory-856-token-reduction-9bl</guid>
      <description>&lt;p&gt;Every time you start a new Claude Code session, your AI has zero context about what you were working on. Same with Cursor, Cline, Windsurf. You spend the first few minutes re-explaining the codebase, the decisions you made, where you left off. It's annoying.&lt;/p&gt;

&lt;p&gt;I got tired of it and built something to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;sessionmem is a local-first MCP server that watches your coding sessions and auto-injects a compact summary at the start of each new one. Your AI instantly knows what you were working on, what decisions were made, and what's next.&lt;/p&gt;

&lt;p&gt;The compression is aggressive. Instead of feeding the full conversation history into context (expensive, often impossible due to token limits), sessionmem distills sessions down to just the key facts. In testing we're seeing &lt;strong&gt;85.6% token reduction&lt;/strong&gt; compared to keeping full history.&lt;/p&gt;

&lt;p&gt;Everything is stored in SQLite at &lt;code&gt;~/.sessionmem/memories.db&lt;/code&gt;. No cloud, no account, no API keys, no config files to mess with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Works with everything MCP-compatible
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;Cline&lt;/li&gt;
&lt;li&gt;Windsurf&lt;/li&gt;
&lt;li&gt;Any other MCP host&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;Install in 30 seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx sessionmem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add to your MCP config:&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sessionmem"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sessionmem"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. sessionmem starts watching your sessions immediately and builds up memory over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why local-first
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Your code is sensitive.&lt;/strong&gt; Your thought process, architecture decisions, and in-progress work shouldn't be sent to a third-party service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQLite is fast and zero-dependency.&lt;/strong&gt; Works offline, no daemon to manage, no Docker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You own your data.&lt;/strong&gt; The database file is right there at &lt;code&gt;~/.sessionmem/memories.db&lt;/code&gt; - readable, deletable, no lock-in.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the memory works
&lt;/h2&gt;

&lt;p&gt;After each session, sessionmem generates a compact summary capturing: what you were building, key decisions made, files touched, and what's left to do. Next time you start a session, this gets injected automatically before you type anything.&lt;/p&gt;

&lt;p&gt;The summaries get better at capturing what matters in your specific workflow over time.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/catfish-1234/sessionmem" rel="noopener noreferrer"&gt;https://github.com/catfish-1234/sessionmem&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/sessionmem" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/sessionmem&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Would love feedback if you try it out - especially on whether the right context is being captured in the summaries.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
