<?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: lh123aa</title>
    <description>The latest articles on DEV Community by lh123aa (@lh123aa).</description>
    <link>https://dev.to/lh123aa</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4194008%2F18084377-e0ee-40a3-b9d3-7fed95152ff2.png</url>
      <title>DEV Community: lh123aa</title>
      <link>https://dev.to/lh123aa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lh123aa"/>
    <language>en</language>
    <item>
      <title>My Claude Code kept forgetting the same decision, so I gave it a local index (33 MB Go binary, no cloud)</title>
      <dc:creator>lh123aa</dc:creator>
      <pubDate>Wed, 18 Nov 2026 21:11:05 +0000</pubDate>
      <link>https://dev.to/lh123aa/my-claude-code-kept-forgetting-the-same-decision-so-i-gave-it-a-local-index-33-mb-go-binary-no-mki</link>
      <guid>https://dev.to/lh123aa/my-claude-code-kept-forgetting-the-same-decision-so-i-gave-it-a-local-index-33-mb-go-binary-no-mki</guid>
      <description>&lt;p&gt;Every Wednesday I settle a design decision. Every Friday, a new session asks me what caching approach this project uses.&lt;/p&gt;

&lt;p&gt;I open about six sessions a day, and each one starts with roughly ten minutes of re-briefing. That's thirty hours a month spent teaching my agent things it already did.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I tried first, and why it failed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Stuffing &lt;code&gt;CLAUDE.md&lt;/code&gt;.&lt;/strong&gt; Works until roughly page eight. After that the instructions start fighting each other and the important constraint gets buried.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud memory services.&lt;/strong&gt; Great products, wrong shape for me. I work in cross-border trade; contracts, quotes and supplier docs live on my machine and are not going to a third party's vector store.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pasting context each time.&lt;/strong&gt; I paste 6,000 characters and the model reliably uses the first 2,000.&lt;/p&gt;

&lt;p&gt;The pattern: the problem was never that the model is weak. It's that I never gave it access to my own material.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;Cortex is a single Go binary that indexes local files and exposes itself as an MCP server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cortex index ~/notes ~/work/docs
cortex start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second command registers an MCP stdio server in Claude Code / Cursor / Trae, backing up the existing config instead of overwriting it.&lt;/p&gt;

&lt;p&gt;Design decisions worth explaining:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid retrieval, not vector-only.&lt;/strong&gt; Pure embeddings miss exact model numbers and proper nouns; pure BM25 misses paraphrase. Two recall paths, score normalisation, then fusion, then three layers of dedupe (chunk hash → semantic neighbour → rerank).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQLite + HNSW, in-process.&lt;/strong&gt; No vector database to operate, no Docker, no GPU. Default is pure BM25; vectors are opt-in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ed25519 offline licensing.&lt;/strong&gt; The public key is compiled into the binary; the license is verified locally. Nothing phones home, and if I disappear the version on your disk keeps running.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Numbers from my own corpus (not a benchmark)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Binary size&lt;/td&gt;
&lt;td&gt;33 MB, no runtime deps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Index 4,821 docs / 61,340 chunks&lt;/td&gt;
&lt;td&gt;1.2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single hybrid query&lt;/td&gt;
&lt;td&gt;75 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Test suites&lt;/td&gt;
&lt;td&gt;24/24 passing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Pricing, because someone always asks
&lt;/h2&gt;

&lt;p&gt;The core is Apache-2.0. The free tier is 5,000 documents / 1 GB with no feature gating and no card. Pro is $29 one-time for 500,000 documents / 100 GB plus rerank and auto-index. I deliberately did not build a subscription — charging monthly for a local binary never made sense to me.&lt;/p&gt;

&lt;p&gt;The docs page auto-switches between English and Chinese based on region, and the checkout currency follows (USD or CNY).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/lh123aa/cortex" rel="noopener noreferrer"&gt;https://github.com/lh123aa/cortex&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; &lt;a href="https://cortex.qataroasis.cc" rel="noopener noreferrer"&gt;https://cortex.qataroasis.cc&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually want from this post
&lt;/h2&gt;

&lt;p&gt;Not signups. I want the failure cases: where does chunking break on your corpus — monorepos, 200-page PDFs, Chinese notes, notebooks with output cells? I'll tune the splitter and publish the diff in a follow-up.&lt;/p&gt;

&lt;p&gt;If you try it, reply with your document count and one place recall missed. That's more useful to me than a star.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>go</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
