<?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: Alen Issac Sam</title>
    <description>The latest articles on DEV Community by Alen Issac Sam (@alenissacsam).</description>
    <link>https://dev.to/alenissacsam</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%2F3699054%2F0e60ec41-8d4d-42ad-a834-5434880245d1.png</url>
      <title>DEV Community: Alen Issac Sam</title>
      <link>https://dev.to/alenissacsam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alenissacsam"/>
    <language>en</language>
    <item>
      <title>My PC hid ten bugs from me. Here is how I found them.</title>
      <dc:creator>Alen Issac Sam</dc:creator>
      <pubDate>Fri, 27 Nov 2026 17:45:03 +0000</pubDate>
      <link>https://dev.to/alenissacsam/my-pc-hid-ten-bugs-from-me-here-is-how-i-found-them-1lln</link>
      <guid>https://dev.to/alenissacsam/my-pc-hid-ten-bugs-from-me-here-is-how-i-found-them-1lln</guid>
      <description>&lt;p&gt;Keepfold is a local memory for AI apps: a folder of Markdown notes, a small MCP server and a desktop app, written in Python. Its test suite has about 4,800 tests and passed on my PC every time. Then I ran it somewhere else, and things started to break.&lt;/p&gt;

&lt;p&gt;My PC is a poor test machine for one reason: it is mine. My username and computer name are plain ASCII. My editor saves UTF-8. My locale is English. Something on it has raised the Windows timer rate, so &lt;code&gt;time.time()&lt;/code&gt; moves every millisecond. And it runs Windows, whose file system ignores letter case. A user's PC can differ on every one of those points.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the bugs came from
&lt;/h2&gt;

&lt;p&gt;Three things found them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CI on three systems.&lt;/strong&gt; GitHub's Windows runner is a clean VM with the default 15.6 ms clock tick, and that found a lock bug I &lt;a href="https://dev.to/alenissacsam/a-156-ms-clock-tick-let-two-writers-into-my-vault-17cb"&gt;wrote up separately&lt;/a&gt;. The Ubuntu and macOS runners mostly found assumptions in the tests themselves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The full suite on Ubuntu in WSL,&lt;/strong&gt; with a throwaway home folder. That found the real Linux bugs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A read-through of the code for environment assumptions,&lt;/strong&gt; each candidate backed by a small probe script run with a fake home folder before it counted.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The ones that would have hurt most
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A title in Hindi could not be saved.&lt;/strong&gt; Page ids come from titles through a slug function that keeps &lt;code&gt;a-z0-9&lt;/code&gt;. For &lt;code&gt;गणित परीक्षा&lt;/code&gt;, &lt;code&gt;微积分&lt;/code&gt; or &lt;code&gt;മലയാളം&lt;/code&gt; that leaves an empty string, and the tool refused with "The title needs at least one letter or digit". &lt;code&gt;Лекция 3&lt;/code&gt; was worse: its slug is &lt;code&gt;3&lt;/code&gt;, so two Russian titles with the same number would collide. The fix keeps every existing id exactly as it was and only adds a fallback:&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;page_slug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;slugify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;unicodedata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;normalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"NFC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&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="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;casefold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&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;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"[a-z]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nb"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isalnum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isascii&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"t-{hashlib.blake2s(t.encode(), digest_size=4).hexdigest()}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same title always gives the same id, so duplicate checks still work. I did not change &lt;code&gt;slugify&lt;/code&gt; itself: imported chats take their ids from it, and a new id would import them twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One page saved by Notepad broke every chat.&lt;/strong&gt; The profile pages in &lt;code&gt;me/&lt;/code&gt; were read with &lt;code&gt;.decode("utf-8")&lt;/code&gt; and no fallback. Save one of them as "ANSI" in Notepad, or write it with PowerShell 5.1's &lt;code&gt;Set-Content&lt;/code&gt;, and every AI app's first Keepfold call raised &lt;code&gt;UnicodeDecodeError&lt;/code&gt;. The app's Home page returned a 500 error too. The rest of the vault already skipped unreadable notes; these pages now do the same.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some computer names meant no saves at all.&lt;/strong&gt; The vault lock file holds the computer name, and it was written with &lt;code&gt;os.fdopen(fd, "w")&lt;/code&gt;. On Windows that uses the locale's code page, so a name the code page cannot encode (a Chinese name on a PC set to English, say) raised before the lock was taken. One argument fixed it: &lt;code&gt;encoding="utf-8"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On a Mac, a private file could be read by changing letter case.&lt;/strong&gt; Private sources are hidden from AI apps. The check compared paths with &lt;code&gt;==&lt;/code&gt;, which on Windows ignores case and on macOS does not, while macOS's file system does. So &lt;code&gt;raw/PAPER.md&lt;/code&gt; matched no private source and served the text of &lt;code&gt;raw/paper.md&lt;/code&gt;. The check now asks whether the two paths are the same file (&lt;code&gt;os.path.samefile&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two threads parsed the same log at once.&lt;/strong&gt; The event log has a parse cache that grows as new lines arrive. The desktop app serves several requests at a time, and two of them could extend the same cache entry together, so the newest results were counted twice until a restart. A probe reproduced it 289 times in 300. A lock around the cache fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Smaller ones
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On Ubuntu 24.04's Python 3.12.3, &lt;code&gt;::ffff:127.0.0.1&lt;/code&gt; is not &lt;code&gt;is_loopback&lt;/code&gt;, so a local model server at that address was refused. Newer Pythons say yes; the fix checks the mapped IPv4 address.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;os.listdir&lt;/code&gt; order differs between file systems, and one importer depended on it.&lt;/li&gt;
&lt;li&gt;A vault on a network share broke backups, because SQLite URIs for UNC paths need an empty authority (&lt;code&gt;file:////server/share/...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;On FAT32 and some other disks, file times have coarse resolution, so a note rewritten twice in one second at the same size looked unchanged. The cache key now includes the inode.&lt;/li&gt;
&lt;li&gt;After the clock is set back (a dual-boot PC that syncs its time after login), a running process's lock could look like it belonged to a reused process id. Lock tokens now carry the holder's start time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I would tell myself a month ago
&lt;/h2&gt;

&lt;p&gt;Run the tests on a machine that is not yours before anyone else does. A free CI matrix with Windows, Ubuntu and macOS costs a YAML file. Then go through the code once, asking for every line what it assumes about the machine: the clock, the encoding, the letter case, the user's name and language, the number of threads. Most of these fixes were one line. Finding them was the work.&lt;/p&gt;

&lt;p&gt;All of these fixes are in Keepfold 0.6.4. It is free and open source (MIT): &lt;a href="https://github.com/alenissacsam-2/keepfold" rel="noopener noreferrer"&gt;https://github.com/alenissacsam-2/keepfold&lt;/a&gt;. Windows has an installer; on macOS and Linux it is one command, &lt;code&gt;uv tool install keepfold&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>windows</category>
      <category>testing</category>
      <category>i18n</category>
    </item>
    <item>
      <title>A 15.6 ms clock tick let two writers into my vault</title>
      <dc:creator>Alen Issac Sam</dc:creator>
      <pubDate>Fri, 27 Nov 2026 09:38:37 +0000</pubDate>
      <link>https://dev.to/alenissacsam/a-156-ms-clock-tick-let-two-writers-into-my-vault-17cb</link>
      <guid>https://dev.to/alenissacsam/a-156-ms-clock-tick-let-two-writers-into-my-vault-17cb</guid>
      <description>&lt;p&gt;Keepfold keeps one Markdown memory that several AI apps write to through one local server. Every write takes a vault lock first: a file created with &lt;code&gt;O_EXCL&lt;/code&gt; that holds &lt;code&gt;pid timestamp host&lt;/code&gt;. The lock code had shipped, and its tests passed on my PC every time. On the project's first CI run on GitHub's Windows runner, three lock tests failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the lock tells its own leftovers from a live holder
&lt;/h2&gt;

&lt;p&gt;On Windows a delete can fail while another process (an indexer, an antivirus) has the file open. So a process can leave its own lock file behind. The next take sees a lock with its own pid, and it must decide: is this a leftover I can take back, or is another thread of mine holding it right now?&lt;/p&gt;

&lt;p&gt;The code keeps a set of tokens this process holds at the moment. A lock file with our pid whose token is in that set is live; any other token with our pid is a leftover.&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{os.getpid()} {time.time():.3f} {socket.gethostname()}"&lt;/span&gt;
&lt;span class="n"&gt;_HELD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;fd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;O_CREAT&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;O_EXCL&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;O_WRONLY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileExistsError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;PermissionError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_HELD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;discard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_steal_if_stale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# our pid, token not held: a leftover&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The bug
&lt;/h2&gt;

&lt;p&gt;The token is the pid plus &lt;code&gt;time.time()&lt;/code&gt; rounded to the millisecond. On Windows before Python 3.13, &lt;code&gt;time.time()&lt;/code&gt; reads &lt;code&gt;GetSystemTimeAsFileTime()&lt;/code&gt;, which on a default system moves in steps of about 15.6 ms. Python 3.13 switched to &lt;code&gt;GetSystemTimePreciseAsFileTime()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So two threads that try the lock inside one tick build the same token string. The second one adds it to the set (a no-op, it is already there), fails to create the file, and discards it. That removes the holder's mark. On its next look the file says "our pid, token not held", and the live lock is taken as a leftover. Two writers are now in the vault.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why my PC never showed it
&lt;/h2&gt;

&lt;p&gt;On my PC &lt;code&gt;time.time()&lt;/code&gt; moves every 1 ms, not every 15.6 ms. Some program had raised the system timer rate, which browsers and media apps often do. At that rate two takes in practice never landed in the same millisecond. The GitHub runner is a clean VM with the default tick, and there the tokens matched.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Three digits from a per-process counter go after the milliseconds:&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{os.getpid()} {time.time():.3f}{next(_SEQ) % 1000:03d} "&lt;/span&gt;
         &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{socket.gethostname()}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The timestamp still parses as a float, so older versions that read the lock keep working, and the age it gives is off by under a millisecond. A regression test freezes &lt;code&gt;time.time()&lt;/code&gt; to one value, holds the lock in one &lt;code&gt;Vault&lt;/code&gt; object and checks that a second one waits instead of stealing it. It fails on the old code and passes on the new. The fix is commit &lt;a href="https://github.com/alenissacsam-2/keepfold/commit/3e77fd6" rel="noopener noreferrer"&gt;3e77fd6&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A value that must be unique should not depend on how fine a clock is.&lt;/li&gt;
&lt;li&gt;A clean CI machine finds what a busy dev machine hides. The same run also caught tests that assumed my time zone, a terminal without colour, and a desktop with animations on.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;time.get_clock_info("time")&lt;/code&gt; tells you which clock you are on and its nominal resolution. Measuring the real step takes five lines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keepfold is free and open source (MIT): &lt;a href="https://github.com/alenissacsam-2/keepfold" rel="noopener noreferrer"&gt;https://github.com/alenissacsam-2/keepfold&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>windows</category>
      <category>testing</category>
      <category>concurrency</category>
    </item>
    <item>
      <title>How I gave Claude, Cursor and Codex one shared memory in plain Markdown</title>
      <dc:creator>Alen Issac Sam</dc:creator>
      <pubDate>Thu, 26 Nov 2026 21:35:11 +0000</pubDate>
      <link>https://dev.to/alenissacsam/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown-541k</link>
      <guid>https://dev.to/alenissacsam/how-i-gave-claude-cursor-and-codex-one-shared-memory-in-plain-markdown-541k</guid>
      <description>&lt;p&gt;Every AI chat I opened started from zero, and every app started from zero again. I'm a student, I use several AI apps every day, and I kept re-explaining my projects, my stack and my decisions to each of them.&lt;/p&gt;

&lt;p&gt;So I built Keepfold: one memory folder on my own PC that all of them read from and add to, through MCP. This post is how it works, what broke while shipping it alone, and where other tools are the better choice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fla3y7c6qcf85lfy7o1li.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fla3y7c6qcf85lfy7o1li.gif" alt="A 15-second demo: tell one AI app once, Keepfold keeps it in plain files on your PC, and the other apps already know it" width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;You install it, pick a folder and connect your AI apps (one click each for Claude Desktop, Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code, Windsurf, Antigravity and LM Studio). From then on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What you work on, decide and prefer is saved as plain Markdown notes in that folder.&lt;/li&gt;
&lt;li&gt;A new chat in any connected app starts with the parts that matter for your message.&lt;/li&gt;
&lt;li&gt;Everything stays on your computer. No account, no telemetry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is what an AI app actually gets. In the sample vault, a made-up student types "Add a save command to my text adventure game". Before the model answers, Keepfold adds this (shortened):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Related
- [[text-adventure]] — A small terminal game: rooms in a dict, one function per command.
- [[functions]] — Functions
- [[loops]] — Loops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the model starts out knowing how the game is built. With your own vault, the lines you pinned ("Python 3.12, type hints, uv only") and the preferences that fit the message come first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design in one picture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Claude Code, Codex, Gemini CLI ── hook ──┐
Claude Desktop, Cursor, VS Code ── MCP ──┤
                                         ▼
                          keepfold (stdio MCP server)
                                         │
                                         ▼
              vault: one folder, in git, opens in Obsidian
              Markdown notes + JSONL events = source of truth
                                         │
                  ┌──────────────────────┴───────────────┐
                  ▼                                      ▼
     search: SQLite FTS5                levels, plan, dashboard:
     + local embeddings                 derived, rebuilt on demand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few choices that shaped everything else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The vault is the source of truth.&lt;/strong&gt; Notes are Markdown with YAML front matter. Events (what was asked, graded, saved) are append-only JSONL. Everything else, like the search index, the vector cache and the dashboard, is derived. Delete it and Keepfold rebuilds it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every write goes through one module.&lt;/strong&gt; It takes a lock, writes a temp file, swaps it in with an atomic replace and refuses text that looks like a secret. With git on, each chat's changes become one commit, so &lt;code&gt;keepfold undo &amp;lt;session&amp;gt;&lt;/code&gt; can revert a chat that saved something wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search is local.&lt;/strong&gt; SQLite full-text search plus a small embedding model (about 150 MB, downloaded once). Without the model, keyword search still works.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context arrives before the first tool call.&lt;/strong&gt; Waiting for the model to decide to call a memory tool is unreliable, so Claude Code, Codex CLI and Gemini CLI get context through a hook on the first real message of each chat. Cursor, VS Code and Codex also get your pinned lines in their rules file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each app sees only what its profile allows.&lt;/strong&gt; By default a coding app gets your pinned lines, coding preferences, setup and projects, never your journal or people pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why plain files
&lt;/h2&gt;

&lt;p&gt;I wanted to be able to read my memory, fix it by hand, grep it, back it up and delete it, without asking a service. A folder of Markdown gives all of that for free. Obsidian opens it as a vault. Git gives it history. If Keepfold disappeared tomorrow, the notes would still be readable.&lt;/p&gt;

&lt;p&gt;There is one rule that keeps this honest: numbers are never stored in notes. Study levels and spaced-repetition states (FSRS) are worked out from the event log every time. If a grade was wrong, cancelling it makes everything recompute, and nothing goes stale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your notes are untrusted input
&lt;/h2&gt;

&lt;p&gt;A memory that AI apps read is also a place where someone can plant instructions. A web page you saved, an imported chat or a note could contain "ignore your previous instructions".&lt;/p&gt;

&lt;p&gt;So note text never reaches a model as plain text. Over MCP it is wrapped in &lt;code&gt;&amp;lt;untrusted_note&amp;gt;&lt;/code&gt; tags, so the model can tell your notes from instructions. In the app and the dashboard it is escaped and stripped of links and images, and the dashboard runs under a &lt;code&gt;default-src 'none'&lt;/code&gt; content security policy. Lines about you that try to drop an AI's rules, give it a persona or open with a role label are refused when they are written.&lt;/p&gt;

&lt;p&gt;None of this makes prompt injection impossible. It makes the easy versions fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  What broke while shipping a Windows app alone
&lt;/h2&gt;

&lt;p&gt;Keepfold had 15 releases in its first ten days on GitHub. Most of the fixes were not about memory at all:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usernames with spaces.&lt;/strong&gt; The installer failed when the install folder's path had a space in it, which is every &lt;code&gt;C:\Users\First Last&lt;/code&gt;. Fixed in 0.6.1, along with making sure every PC gets x64 Python.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Campus networks.&lt;/strong&gt; The one-time model download failed behind a proxy and its own certificates. Keepfold now uses the system proxy and the OS certificate store, and says in a plain sentence what went wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SmartScreen.&lt;/strong&gt; The installer is not code-signed yet, so Windows warns that it "protected your PC". The README says so up front, explains More info then Run anyway, and every release lists the installer's SHA-256.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Renaming the project.&lt;/strong&gt; It was called Cortex until 0.6.2. The rename moves settings, the vault and every AI-app connection over by itself on first run. But the older versions' updater could not find releases in the renamed repo, so people on 0.6.1 have to download the installer once by hand. If you might rename, plan the updater for it first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The test suite (about 4,800 tests) runs only on made-up data in temp folders. The real vault never goes near it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keepfold next to other AI memories
&lt;/h2&gt;

&lt;p&gt;Each of these is a good tool built for a different job. This is only what their own docs say, as of November 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Keepfold&lt;/th&gt;
&lt;th&gt;ChatGPT memory&lt;/th&gt;
&lt;th&gt;Claude's memory&lt;/th&gt;
&lt;th&gt;Basic Memory&lt;/th&gt;
&lt;th&gt;mem0 / OpenMemory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Works across several AI apps&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No, ChatGPT only&lt;/td&gt;
&lt;td&gt;No, Claude apps only&lt;/td&gt;
&lt;td&gt;Yes, any MCP app&lt;/td&gt;
&lt;td&gt;Yes, any MCP app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain files on your PC&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No (you can export it)&lt;/td&gt;
&lt;td&gt;Yes, Markdown&lt;/td&gt;
&lt;td&gt;No, a vector database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free and open source&lt;/td&gt;
&lt;td&gt;Yes, MIT&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes, AGPL-3.0&lt;/td&gt;
&lt;td&gt;Yes, Apache-2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-click Windows installer&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;td&gt;No, uv or Homebrew&lt;/td&gt;
&lt;td&gt;No, Docker&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When the other tool is the better choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ChatGPT's or Claude's own memory&lt;/strong&gt; if you live in one app and don't want to install anything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/basicmachines-co/basic-memory" rel="noopener noreferrer"&gt;Basic Memory&lt;/a&gt;&lt;/strong&gt; if you're on macOS or Linux and want a Markdown memory for MCP apps that installs with uv or Homebrew.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/mem0ai/mem0" rel="noopener noreferrer"&gt;mem0&lt;/a&gt;&lt;/strong&gt; if you're building memory into your own app or agents and already run Docker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/thedotmack/claude-mem" rel="noopener noreferrer"&gt;claude-mem&lt;/a&gt;&lt;/strong&gt; if you only use Claude Code and want its tool activity recorded for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The installer is Windows 10 and 11 only. On macOS and Linux it runs from source with uv, and it is tested most on Windows.&lt;/li&gt;
&lt;li&gt;The installer is not code-signed yet.&lt;/li&gt;
&lt;li&gt;It's a beta until 1.0. I use it every day, but expect rough edges.&lt;/li&gt;
&lt;li&gt;The optional local Chat with a small model (2B) can get a detail wrong. It cites the notes it used, so check them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Keepfold is free and MIT: &lt;a href="https://github.com/alenissacsam-2/keepfold" rel="noopener noreferrer"&gt;github.com/alenissacsam-2/keepfold&lt;/a&gt;. Issues and Discussions are open, and bug reports are the most useful thing you can send me.&lt;/p&gt;

&lt;p&gt;If you'd rather watch than read, here is the 43-second film:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/kehQjTcOUqs" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;One question for you: what would you want your AI apps to remember about you, and what should they never be allowed to save?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Claude (AI) from Keepfold's docs and commit history, and published at my request.&lt;/em&gt;&lt;/p&gt;

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