<?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: Mohak Bajaj</title>
    <description>The latest articles on DEV Community by Mohak Bajaj (@mohakbajaj).</description>
    <link>https://dev.to/mohakbajaj</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%2F655309%2F3e48a327-08f8-4809-9671-fe35fae1f73b.png</url>
      <title>DEV Community: Mohak Bajaj</title>
      <link>https://dev.to/mohakbajaj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohakbajaj"/>
    <language>en</language>
    <item>
      <title>My notes app has no database, just a folder of Markdown and an MCP server</title>
      <dc:creator>Mohak Bajaj</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:56:08 +0000</pubDate>
      <link>https://dev.to/mohakbajaj/my-notes-app-has-no-database-just-a-folder-of-markdown-and-an-mcp-server-2323</link>
      <guid>https://dev.to/mohakbajaj/my-notes-app-has-no-database-just-a-folder-of-markdown-and-an-mcp-server-2323</guid>
      <description>&lt;p&gt;I make a small Mac app called Jot. You select text anywhere, tap Shift twice, and it saves a note. When I started, I thought about SQLite, a sync server and an account system. I shipped none of them. All of Jot's storage is a folder: &lt;code&gt;~/Documents/Jot&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This post covers how that folder works, what broke, and why AI agents turned out to be the best reason for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  One note is one file
&lt;/h2&gt;

&lt;p&gt;Every note is a Markdown file with YAML front matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Documents/Jot/
  2026-11-09-6tjhzv.md
  2026-11-09-gnump0.md
  INDEX.md
  SKILL.md
  attachments/6tjhzv/
  .trash/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="na"&gt;archived&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="na"&gt;created&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2026-11-09T09:12:04.511Z&lt;/span&gt;
&lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;6tjhzv&lt;/span&gt;
&lt;span class="na"&gt;images&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="na"&gt;pin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="na"&gt;section&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;
&lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Safari&lt;/span&gt;
&lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://example.com/article&lt;/span&gt;
&lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;reading&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;updated&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2026-11-09T09:12:04.511Z&lt;/span&gt;
&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="s"&gt;A line I selected and wanted to keep.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The filename is &lt;code&gt;YYYY-MM-DD-&amp;lt;id&amp;gt;.md&lt;/code&gt;. The id is 6 random characters from &lt;code&gt;[0-9a-z]&lt;/code&gt;. The date at the front makes &lt;code&gt;ls&lt;/code&gt; sort by day for free. If a file loses its &lt;code&gt;created&lt;/code&gt; field, Jot falls back to the date in the name, so the order stays stable.&lt;/p&gt;

&lt;p&gt;Images and audio go in &lt;code&gt;attachments/&amp;lt;id&amp;gt;/&lt;/code&gt;. A deleted note moves to &lt;code&gt;.trash/&amp;lt;id&amp;gt;/&lt;/code&gt;, so undo is a rename back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problems a database would have solved
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Half-written files.&lt;/strong&gt; If the app crashes in the middle of a write, the note is gone. So every write goes to a temp file next to the real one (&lt;code&gt;.name.&amp;lt;16 hex&amp;gt;.tmp&lt;/code&gt;), and then a rename puts it in place. A rename is atomic on one filesystem. The rename lives in the folder entry, so Jot also syncs the folder, or a power cut can undo it. When Jot opens the vault, it deletes temp files left by a crash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reading every file, every time.&lt;/strong&gt; Each operation lists the folder again. Parsing hundreds of files with YAML on each keypress is slow. Jot keeps a cache keyed by inode, mtime and size. An atomic write gives the file a new inode, so any change misses the cache, and a file that did not change is not parsed again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A file someone else broke.&lt;/strong&gt; You can edit these files in Vim, Obsidian or a script. If the front matter stops parsing, Jot leaves that one file out of the list, logs why once, and keeps going. It does not crash, and it does not "fix" your file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changes from outside.&lt;/strong&gt; Jot watches the folder. If another program adds or edits a file, the inbox updates by itself.&lt;/p&gt;

&lt;p&gt;That is the whole storage layer, in about 600 lines of TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then agents showed up
&lt;/h2&gt;

&lt;p&gt;I added a CLI first (&lt;code&gt;jot list&lt;/code&gt;, &lt;code&gt;jot search&lt;/code&gt;, &lt;code&gt;jot add&lt;/code&gt;, &lt;code&gt;jot tag&lt;/code&gt;, &lt;code&gt;jot done&lt;/code&gt;, &lt;code&gt;jot archive&lt;/code&gt;). Then &lt;code&gt;jot mcp&lt;/code&gt; started an MCP server on stdio, so Claude Code, Codex and Cursor can use the same vault.&lt;/p&gt;

&lt;p&gt;The MCP server has seven tools:&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;list_jots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List by status, section or tag, newest first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;search_jots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Case-insensitive match on body, tags, source app and URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The whole file, plus absolute paths to its images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;add_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a note; the first line is its title&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tag_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add tags; existing tags stay&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set_done&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mark done, or open again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;archive_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Hide from the inbox; the file stays&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There is no delete tool, on purpose. An agent can add, tag, finish and archive. It cannot remove anything. The worst an agent can do is leave a mess you can see in Finder.&lt;/p&gt;

&lt;p&gt;The server also does very little. It reads the files, changes the front matter, and writes them back with the same atomic write. The app sees the change through the folder watcher. There is no IPC between the server and the app, and the app does not need to be running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Files help agents even without MCP
&lt;/h2&gt;

&lt;p&gt;Two generated files are for agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;INDEX.md&lt;/code&gt; lists every note as a Markdown link with its title. An agent reads one file and knows what is there.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SKILL.md&lt;/code&gt; describes the layout: where files live, what the front matter means, and how ids look. Any agent that can read a folder can use the vault correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the setup for most agents is just this: "my notes are in ~/Documents/Jot, read SKILL.md." Something like "what was I thinking about last week" becomes a &lt;code&gt;grep&lt;/code&gt; and a &lt;code&gt;read&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I gave up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sync.&lt;/strong&gt; Jot does not sync. If you want it, put the folder in iCloud Drive or Syncthing. I have not built conflict handling for two Macs that write at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast queries over large vaults.&lt;/strong&gt; Search is a substring scan over parsed files. That is fine for thousands of notes. For hundreds of thousands, I would add an index.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema migrations.&lt;/strong&gt; The front matter is now an on-disk format that other tools read, so I can only add fields, not rename them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a capture inbox, these trades were worth it. Your notes outlive the app, every tool you already use can open them, and &lt;code&gt;ls ~/Documents/Jot&lt;/code&gt; is the admin panel.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sayjot.xyz/blog/no-database" rel="noopener noreferrer"&gt;sayjot.xyz/blog/no-database&lt;/a&gt;. I make &lt;a href="https://sayjot.xyz/?ref=crosspost" rel="noopener noreferrer"&gt;Jot (sayjot.xyz)&lt;/a&gt;, a Mac app that saves captures and dictation as plain Markdown files.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>markdown</category>
      <category>mcp</category>
      <category>macos</category>
    </item>
    <item>
      <title>Let Claude Code read your notes with MCP</title>
      <dc:creator>Mohak Bajaj</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:55:27 +0000</pubDate>
      <link>https://dev.to/mohakbajaj/let-claude-code-read-your-notes-with-mcp-333f</link>
      <guid>https://dev.to/mohakbajaj/let-claude-code-read-your-notes-with-mcp-333f</guid>
      <description>&lt;p&gt;I save a lot of small things during the day. An error message from a log. A line from the docs. An idea I had while reviewing a PR. Later, when I am in Claude Code, those notes are exactly the context I want it to have. Pasting them in by hand is slow.&lt;/p&gt;

&lt;p&gt;So Jot, my Mac capture app, ships an MCP server. With one command, Claude Code can list, search and read your notes, and add new ones. This post covers the setup for Claude Code, Codex and Cursor, what each tool does, and why there is no delete tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get
&lt;/h2&gt;

&lt;p&gt;Jot saves each note as a Markdown file in a folder, &lt;code&gt;~/Documents/Jot&lt;/code&gt; by default. You select text in any app and tap Shift twice to save it, or you add one from the terminal. &lt;code&gt;jot mcp&lt;/code&gt; is a local MCP server for that folder. It runs on your Mac over stdio. There is no account and no API key, and the notes do not leave the Mac unless your agent sends them to its model. The Jot app does not need to be running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: install Jot and link the CLI
&lt;/h2&gt;

&lt;p&gt;Download Jot from &lt;a href="https://sayjot.xyz/download" rel="noopener noreferrer"&gt;sayjot.xyz/download&lt;/a&gt; and open it once. The CLI lives inside the app, at &lt;code&gt;/Applications/Jot.app/Contents/Helpers/jot&lt;/code&gt;. There is no separate package to install.&lt;/p&gt;

&lt;p&gt;To run it as &lt;code&gt;jot&lt;/code&gt;, link it into &lt;code&gt;/usr/local/bin&lt;/code&gt;. Settings → Vault &amp;amp; Agents → Terminal command → &lt;strong&gt;Link&lt;/strong&gt; does it for you. macOS may ask for your password. Or run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ln -sf /Applications/Jot.app/Contents/Helpers/jot /usr/local/bin/jot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you skip this step, use the full path inside the app in place of &lt;code&gt;/usr/local/bin/jot&lt;/code&gt; in the commands below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: add the server to Claude Code
&lt;/h2&gt;

&lt;p&gt;This adds Jot for all your projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --scope user jot -- /usr/local/bin/jot mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start a new Claude Code session and run &lt;code&gt;/mcp&lt;/code&gt;. You should see &lt;code&gt;jot&lt;/code&gt; in the list, with its tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Codex and Cursor
&lt;/h2&gt;

&lt;p&gt;For Codex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex mcp add jot -- /usr/local/bin/jot mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cursor, Claude Desktop and other clients take a JSON config. Settings → Vault &amp;amp; Agents → MCP server → &lt;strong&gt;Copy config&lt;/strong&gt; puts it on your clipboard:&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="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"jot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/usr/local/bin/jot"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"mcp"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Cursor, paste it into &lt;code&gt;~/.cursor/mcp.json&lt;/code&gt; for every project, or &lt;code&gt;.cursor/mcp.json&lt;/code&gt; in one project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tools do
&lt;/h2&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;th&gt;Writes?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;list_jots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List jots: id, status, title with #tags, file path. Filter by tag, section, done, archived, limit.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;search_jots&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Case-insensitive search of open jots by body, tags, source app and URL.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;One whole file, front matter and body, plus absolute paths to its images.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;add_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a jot. The first line is its title. Optional tags and section.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set_done&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mark a jot done, or open again.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;archive_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Take a jot out of the inbox. The file stays in the folder.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tag_jot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add tags. Existing tags stay.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Clients that support MCP Apps also get an inbox view, and an eighth tool, &lt;code&gt;jot_image&lt;/code&gt;, that the view uses to show a jot's images. Other clients see the seven tools above.&lt;/p&gt;

&lt;p&gt;Writes go to the same Markdown files the app shows. The server changes the file with an atomic write, and the app sees the change because it watches the folder. If Claude adds a jot, it shows in your inbox a moment later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why there is no delete tool
&lt;/h2&gt;

&lt;p&gt;An agent can add, tag, finish and archive. It cannot delete. That is on purpose.&lt;/p&gt;

&lt;p&gt;Agents make mistakes, and they act fast. A prompt like "clean up my old notes" should never end with files gone. Archive covers the real need: the jot leaves the inbox, and the file stays in the folder. If an agent archives the wrong thing, you can get it back. The worst case is a mess you can see and fix, not lost notes.&lt;/p&gt;

&lt;p&gt;Deleting is still easy for you. It is one action in the app, and the file goes to a trash folder first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompts that work well
&lt;/h2&gt;

&lt;p&gt;You don't need to name the tools. Ask in plain words, and Claude picks the tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Search my jots for anything about the billing migration and summarize what I saved."&lt;/li&gt;
&lt;li&gt;"List my open jots tagged todo. Which ones are about this repo?"&lt;/li&gt;
&lt;li&gt;"Read the jot I saved from the Postgres docs and apply that fix to db/pool.ts."&lt;/li&gt;
&lt;li&gt;"Add a jot: follow up on the flaky upload test. Tag it todo and work."&lt;/li&gt;
&lt;li&gt;"Go through my open jots from this week, tag each one by project, and mark the ones we finished today as done."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two tips. Search matches substrings, so short, specific words work better than a long phrase. And search only looks at open jots, so ask for &lt;code&gt;list_jots&lt;/code&gt; with archived set to true when you want old ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Point it at another folder
&lt;/h2&gt;

&lt;p&gt;The server reads the folder you set in Jot's Settings. &lt;code&gt;--vault &amp;lt;dir&amp;gt;&lt;/code&gt; or the &lt;code&gt;JOT_VAULT&lt;/code&gt; environment variable points it somewhere else. If your Jot folder is inside an Obsidian vault, Claude reads the same notes you see in Obsidian. I wrote about that setup in &lt;a href="https://sayjot.xyz/blog/obsidian-highlights" rel="noopener noreferrer"&gt;How to save highlights from any Mac app into Obsidian&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  No MCP? The folder still works
&lt;/h2&gt;

&lt;p&gt;Some agents only read files. Jot writes two files for them in the folder. &lt;code&gt;INDEX.md&lt;/code&gt; lists the open jots with their titles. &lt;code&gt;SKILL.md&lt;/code&gt; explains the layout and the front matter. Settings → Vault &amp;amp; Agents can also install a Jot skill at &lt;code&gt;~/.agents/skills/jot/SKILL.md&lt;/code&gt;, which tells agents how to use the CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  More
&lt;/h2&gt;

&lt;p&gt;The full tool reference is on GitHub at &lt;a href="https://github.com/MohakBajaj/jot-mcp" rel="noopener noreferrer"&gt;MohakBajaj/jot-mcp&lt;/a&gt;. Jot runs on macOS 12 or later, on Apple silicon and Intel. It has a 3-day free trial, then $29 once for 1 Mac, and the first 50 one-Mac licenses are $9, or $6 until Dec 1 for Black Friday. The MCP server is included.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sayjot.xyz/blog/claude-code-mcp-notes" rel="noopener noreferrer"&gt;sayjot.xyz/blog/claude-code-mcp-notes&lt;/a&gt;. I make &lt;a href="https://sayjot.xyz/?ref=crosspost" rel="noopener noreferrer"&gt;Jot (sayjot.xyz)&lt;/a&gt;, a Mac app that saves captures and dictation as plain Markdown files.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>productivity</category>
      <category>markdown</category>
    </item>
    <item>
      <title>Porting my Electron app to Rust: 675 MB to 91 MB</title>
      <dc:creator>Mohak Bajaj</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:54:48 +0000</pubDate>
      <link>https://dev.to/mohakbajaj/porting-my-electron-app-to-rust-675-mb-to-91-mb-22nk</link>
      <guid>https://dev.to/mohakbajaj/porting-my-electron-app-to-rust-675-mb-to-91-mb-22nk</guid>
      <description>&lt;p&gt;Jot is a capture app for the Mac. Select text anywhere, press Shift twice, and it becomes a Markdown file in &lt;code&gt;~/Documents/Jot&lt;/code&gt;. Hold fn to dictate. Up to 1.1.4, Jot was an Electron app. Jot 2.0 is the same app in Rust, on &lt;a href="https://github.com/anomalyco/rune" rel="noopener noreferrer"&gt;Rune&lt;/a&gt;, a GPU UI framework.&lt;/p&gt;

&lt;p&gt;Both builds are universal, for Apple silicon and Intel. The Electron 1.1.4 app is 675 MB on disk. The Rust 2.0 app is 91 MB. The download went from a 302 MB dmg to a 44 MB one. 2.0 uses the same vault, settings file, Keychain items, license and bundle id, so 1.1.4 users update in place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why leave Electron
&lt;/h2&gt;

&lt;p&gt;Size was the obvious reason. Most of the 675 MB is Chromium, for an app that shows a list of notes. The less obvious reason was the shape of the code. An Electron app has a main process, a preload script and a renderer, and every feature crosses IPC. Jot's native work already lived outside Node: a Swift helper for Apple's speech API, another for Apple Intelligence cleanup, and a separate process for local speech models. Electron was the glue, not the engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  One process, no IPC
&lt;/h2&gt;

&lt;p&gt;I did not port the Electron layout. In the Rust app, the view and the state are one struct. A click handler gets &lt;code&gt;&amp;amp;mut Jot&lt;/code&gt; and changes it. There is no message to define, send, validate or version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────── app (Jot) ─────────────────┐
│ one process: state + view + vault          │
│ handlers get &amp;amp;mut Jot, no IPC              │
│                                            │
│  watcher thread ──┐   capture thread ──┐   │
│  (vault changes)  │   (grab selection) │   │
│                   ▼                    ▼   │
│            AppHandle::update(|s, tx| ..)   │
└───────┬───────────────────────┬────────────┘
        │                       │
┌───────▼────────┐     ┌────────▼──────────────────────────┐
│ jot-core       │     │ jot-os  (one API)                 │
│ note format    │◀────│  macos/  windows/  linux.rs       │
│ vault (std::fs)│     │  double_tap.rs  (shared, tested)  │
│ bin: jot (CLI) │     │  Link (jot:// parser)             │
└────────────────┘     └───────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Work that blocks runs on its own thread: watching the vault for changes, and grabbing the selection from another app. The result comes back through &lt;code&gt;AppHandle::update&lt;/code&gt;, so the UI thread never waits.&lt;/p&gt;

&lt;p&gt;The note format and the vault are in &lt;code&gt;jot-core&lt;/code&gt;. The &lt;code&gt;jot&lt;/code&gt; CLI and the MCP server are built from the same crate, so the app, the CLI and your agents use one tested implementation. In 1.1.4 the CLI was JavaScript that shared code with the app through the bundler.&lt;/p&gt;

&lt;h2&gt;
  
  
  OS code in one place
&lt;/h2&gt;

&lt;p&gt;Everything that calls the OS is in &lt;code&gt;jot-os&lt;/code&gt;. It has one public API, and each OS is one module that the compiler picks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="cp"&gt;#[cfg_attr(target_os = "macos", path = "macos/mod.rs")]&lt;/span&gt;
&lt;span class="cp"&gt;#[cfg_attr(windows, path = "windows/mod.rs")]&lt;/span&gt;
&lt;span class="cp"&gt;#[cfg_attr(all(unix, not(target_os = "macos")), path = "linux.rs")]&lt;/span&gt;
&lt;span class="k"&gt;mod&lt;/span&gt; &lt;span class="nf"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Logic that does not need the OS is written once and tested once. Shift Shift is the best example. The OS only reports key events. A small state machine decides when two taps count:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// A tap is a press and release shorter than this, with nothing else pressed meanwhile.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;TAP&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;/// The second tap must end within this of the first.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;GAP&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;Press&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;ShiftDown&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;ShiftUp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;/// Any other key or modifier. Breaks a tap in progress, so typing capitals never fires.&lt;/span&gt;
    &lt;span class="nc"&gt;Other&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Other&lt;/code&gt; is the important case. Any other key spoils the tap, so typing a capital letter never opens a capture. The same machine runs on macOS and Windows. On Linux, X11 gets a global chord, but Wayland gives an app no global key events, so Shift Shift is not available there.&lt;/p&gt;

&lt;p&gt;Electron Jot only ran on the Mac. The Rust build runs on Windows and Linux too, and CI runs &lt;code&gt;cargo test&lt;/code&gt; on all three. The Mac is still the main target.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same vault, both apps
&lt;/h2&gt;

&lt;p&gt;A note is a Markdown file with YAML front matter. The Rust app had to read every file that 1.1.4 wrote, and write files that 1.1.4 could still read, because people update at different times and some sync the folder between Macs.&lt;/p&gt;

&lt;p&gt;One rule made this safe: unknown front-matter keys are kept. &lt;code&gt;Meta::extra&lt;/code&gt; holds every key this build does not know. If a newer or older Jot wrote a field, a save from the Rust app keeps it. Both apps can use the same vault at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I checked parity
&lt;/h2&gt;

&lt;p&gt;Before it could ship, the port had to do everything 1.1.4 does. I audited every feature against the Electron code paths, not just the new crates, and kept the result in a parity file in the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Area                          | done | partly |
|-------------------------------|------|--------|
| Core, vault                   |  17  |   0    |
| Settings                      |   7  |   0    |
| CLI and MCP                   |   6  |   0    |
| Inbox                         |  19  |   0    |
| Capture                       |   5  |   1    |
| Voice, note, draw             |   8  |   0    |
| Speech                        |   9  |   0    |
| Settings window, onboarding   |   5  |   0    |
| License, updates, i18n        |   7  |   0    |
| Shell                         |   7  |   1    |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A feature counts as done only with a test, a headless snapshot or a recorded run. Many of the tests are ported from the TypeScript suite. With &lt;code&gt;--snap shot.png&lt;/code&gt;, the app renders itself to a PNG with no window. The Electron app can do the same, so I compared both with the same demo data.&lt;/p&gt;

&lt;p&gt;The two open items:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shift Shift on Wayland, which Wayland does not allow. Electron Jot had no Linux build at all.&lt;/li&gt;
&lt;li&gt;Developer ID signing and notarization, which happen at release time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Better dictation along the way
&lt;/h2&gt;

&lt;p&gt;While porting the speech code, I took a set of fixes from Hex, an MIT-licensed dictation app. They go beyond 1.1.4:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model warms with a silent run on key-down, so the first dictation after launch is faster.&lt;/li&gt;
&lt;li&gt;Recording continues 200 to 600 ms after you let go, so the last word is not clipped.&lt;/li&gt;
&lt;li&gt;Silence is judged on the loudest 30 ms window against -50 dBFS, not the clip's average, so quiet speech is no longer dropped.&lt;/li&gt;
&lt;li&gt;The mic opens before the front-app lookup, so the first word is not clipped either.&lt;/li&gt;
&lt;li&gt;Pasted transcripts are marked transient, so clipboard managers skip them. The old clipboard comes back only if nothing else changed it.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The Rust code is not smaller. It is about 76,000 lines, against about 73,000 lines of TypeScript in 1.1.4. Rune is young, so some things Electron gives you for free, like text fields, had to be checked before I could depend on them. In return, the app is about a seventh of the size, the state has one owner, and the OS code for three platforms sits behind one API.&lt;/p&gt;

&lt;p&gt;Jot 2.0 is at &lt;a href="https://sayjot.xyz" rel="noopener noreferrer"&gt;sayjot.xyz&lt;/a&gt;. If you are on 1.1.4, Check for Updates brings it in place.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sayjot.xyz/blog/rust-port" rel="noopener noreferrer"&gt;sayjot.xyz/blog/rust-port&lt;/a&gt;. I make &lt;a href="https://sayjot.xyz/?ref=crosspost" rel="noopener noreferrer"&gt;Jot (sayjot.xyz)&lt;/a&gt;, a Mac app that saves captures and dictation as plain Markdown files.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>electron</category>
      <category>macos</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Hiding Markdown syntax as you type, without moving the line</title>
      <dc:creator>Mohak Bajaj</dc:creator>
      <pubDate>Wed, 25 Nov 2026 05:53:36 +0000</pubDate>
      <link>https://dev.to/mohakbajaj/hiding-markdown-syntax-as-you-type-without-moving-the-line-2n64</link>
      <guid>https://dev.to/mohakbajaj/hiding-markdown-syntax-as-you-type-without-moving-the-line-2n64</guid>
      <description>&lt;p&gt;Jot 2.3 added a Markdown editor. Open a jot and the window grows into an editor beside the list. It styles Markdown as you type, and the &lt;code&gt;**&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt; and link brackets disappear until you need them. Any &lt;code&gt;.md&lt;/code&gt; file in Finder can open in it too.&lt;/p&gt;

&lt;p&gt;I set two rules before writing any of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The file holds exactly what you typed. Styling never rewrites a byte.&lt;/li&gt;
&lt;li&gt;Nothing on the line moves when the caret arrives, except the thing you are editing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is how both rules shape the code. The styling is one Rust file of about 650 lines, tests included.&lt;/p&gt;

&lt;h2&gt;
  
  
  Styles are byte ranges, not a document model
&lt;/h2&gt;

&lt;p&gt;Most rich editors parse Markdown into a tree, let you edit the tree, and write Markdown back out. That round trip is where your file gets rewritten: &lt;code&gt;*&lt;/code&gt; becomes &lt;code&gt;_&lt;/code&gt;, list markers get normalised, lines re-wrap. Jot's notes are also read by Obsidian, Vim, scripts and coding agents over MCP, so every rewrite would show up as a diff nobody made.&lt;/p&gt;

&lt;p&gt;So the editor never holds a tree. The text field holds the plain text. On each frame, a &lt;code&gt;pulldown-cmark&lt;/code&gt; parse (CommonMark with GitHub's tables, strikethrough, task lists, footnotes and autolinks, plus &lt;code&gt;$math$&lt;/code&gt;) gives each element its exact byte range. Those ranges become styled spans laid over the text. Typing edits the text; the spans are thrown away and rebuilt. Saving writes the text. There is nothing to convert back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two kinds of syntax
&lt;/h2&gt;

&lt;p&gt;Hiding all Markdown makes it unreadable. A list without bullets is just lines. So every piece of syntax is one of two kinds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;Kind&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// Syntax that stays visible, faint: `&amp;gt;`, `-`, `1.`, `[ ]`, fences, rules,&lt;/span&gt;
    &lt;span class="c1"&gt;/// table pipes, HTML, reference definitions.&lt;/span&gt;
    &lt;span class="nc"&gt;Marker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;/// Syntax that Live mode hides away from the caret: heading hashes, `**`,&lt;/span&gt;
    &lt;span class="c1"&gt;/// `*`, `~~`, backticks, `$`, link brackets and URLs, escapes.&lt;/span&gt;
    &lt;span class="nc"&gt;Syntax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Heading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Strong&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Emphasis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Done&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Strike&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Link&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Highlight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;Marker&lt;/code&gt; tells you the structure: quote bars, bullets, task boxes, fences, table pipes. It stays on screen, faint, and gets stronger on the caret's line. A &lt;code&gt;Syntax&lt;/code&gt; range is decoration: the stars around bold, the hashes before a heading, the &lt;code&gt;(https://…)&lt;/code&gt; after a link. It hides.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hiding without deleting
&lt;/h2&gt;

&lt;p&gt;You can't remove hidden syntax from the text, because then the text isn't what you typed. You can't leave it at full size in a transparent colour either, because then there are invisible gaps in every line. Jot sets it to a font size of 0.01:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// The size hidden syntax is set at: wide enough to lay out, too small to see.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;HIDDEN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;f32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Away from the caret the syntax takes no room and no ink; the caret still steps&lt;/span&gt;
&lt;span class="c1"&gt;// over it, and entering the element (or selecting over it) brings it back.&lt;/span&gt;
&lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Syntax&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;revealed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;HIDDEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;TRANSPARENT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Syntax&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;look&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;muted_foreground&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Marker&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;on_caret_line&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;look&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;muted_foreground&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Marker&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At 0.01 the characters still exist for layout and for the caret. Arrow keys step over them one by one, so you never lose your place in the real text. They just take no visible room. When the caret enters the element, the same range gets a normal size and a muted colour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Only what you touch comes back
&lt;/h2&gt;

&lt;p&gt;The obvious rule is "show all syntax on the caret's line". Try it and every click into a long line makes the whole line shift sideways as a dozen &lt;code&gt;**&lt;/code&gt; and &lt;code&gt;[]()&lt;/code&gt; appear at once.&lt;/p&gt;

&lt;p&gt;Jot's rule is narrower: an element shows its syntax only when the caret or selection touches that element's range.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Touching counts: a caret just after `**bold**` still shows its stars.&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;revealed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Mark&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;caret&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_some_and&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scope&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="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put the caret in the middle of a bold word and its two pairs of stars appear. The link three words later stays a link. A selection shows the syntax of everything inside it, so what you copy is what you see. The caret's line only changes the Markers, from faint to a little stronger, and they never change size.&lt;/p&gt;

&lt;h2&gt;
  
  
  The edge cases are CommonMark's
&lt;/h2&gt;

&lt;p&gt;A hand-written regex for &lt;code&gt;**bold**&lt;/code&gt; gets &lt;code&gt;snake_case_name&lt;/code&gt; and &lt;code&gt;2 * 3 = 6&lt;/code&gt; wrong. Using the parser's ranges means Jot agrees with GitHub about what is emphasis, what is a heading and what is just text. The tests pin the cases people actually type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;plain&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"snake_case_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"2 * 3 = 6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"a * b *"&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="s2"&gt;"**open"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;assert!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;kinds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iter&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;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nf"&gt;matches!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Strong&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Kind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Emphasis&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="s2"&gt;"{plain}"&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;assert!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;kinds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"#tag"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_empty&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="c1"&gt;// no space: not a heading&lt;/span&gt;
&lt;span class="nf"&gt;assert!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;kinds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-not a list"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_empty&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="c1"&gt;// no space: not a list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One case came from the renderer, not Markdown. Rune, the GPU UI framework Jot uses, places a line's strike-through from the line's first run of text. A done task like &lt;code&gt;- [x] ship it&lt;/code&gt; starts with hidden syntax, and a 0.01-size first run put the strike at the wrong height. The fix keeps that first character at full size, still transparent, so the line is struck where the words are.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source mode is the same text
&lt;/h2&gt;

&lt;p&gt;The status bar has Live and Source. Source is the same text with the same ranges, in a monospaced font, with all syntax shown and coloured and no size changes. Switching converts nothing, so the file and the caret stay where they are.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell you before you build one
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep the text as the only source of truth. Style it, never model it.&lt;/li&gt;
&lt;li&gt;Split syntax into structure you keep and decoration you hide.&lt;/li&gt;
&lt;li&gt;Hide by shrinking, not deleting, so the caret still walks the real bytes.&lt;/li&gt;
&lt;li&gt;Reveal per element, not per line, or the line jumps.&lt;/li&gt;
&lt;li&gt;Let a real CommonMark parser decide what counts. Your regex will be wrong about underscores.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sayjot.xyz/blog/live-markdown" rel="noopener noreferrer"&gt;sayjot.xyz/blog/live-markdown&lt;/a&gt;. I make &lt;a href="https://sayjot.xyz/?ref=crosspost" rel="noopener noreferrer"&gt;Jot (sayjot.xyz)&lt;/a&gt;, a Mac app that saves captures and dictation as plain Markdown files.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>markdown</category>
      <category>macos</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
