Skip to main content
All projects

Tandem Markdown

An open-source WYSIWYG markdown editor for VS Code that merges outside edits without interrupting your typing.

What
Open-source WYSIWYG markdown editor for VS Code
My part
Product design, merge architecture and build
When
Since November 2026
Tandem Markdown showing wide syntax rendering, Notion-style slash editing, live external file merging while typing, and raw Markdown underneath

The idea

Working in markdown inside VS Code usually forces an awkward trade. You can edit raw text with a read-only preview beside it, which splits your attention across two panes, or you can install a rich-text editor that parses the file into its own document tree and rewrites your formatting on save. Fix one typo and half the file's bullets, tables and line endings shift in git.

A second problem shows up the moment an AI agent, a git checkout or a sync folder edits a note you still have open. Most editors either overwrite your unsaved typing, refuse to save over the newer file on disk, or dump you into a modal warning. I wanted one editor inside VS Code that felt clean to read and write in, stayed faithful to the underlying markdown, and handled outside writes calmly while typing kept going.

Drawing over the real file

Instead of parsing a markdown file into a separate rich-text model and serializing it back out, Tandem Markdown holds the file's exact text in CodeMirror 6 and draws headings, tables, callouts, wikilinks, KaTeX math and Mermaid diagrams directly over it. Opening a note, switching views and closing it write nothing. Editing a word changes only that word in the file.

One tab holds three views of the same document: Source (VS Code's own text editor), Rich editor, and read-only Rich view. Pressing Alt+M moves between them while keeping your cursor, your scroll position and a shared undo history. Inside the Rich editor, typing / opens a block insert menu for callouts, tables, math, diagrams and front matter, while staying out of the way for file paths like /usr/bin.

The slash insert menu open inside Tandem Markdown in VS Code
The slash insert menu inside the Rich editor

Notes come from many dialects, so the renderer supports GitHub alerts, tables and task lists alongside Obsidian wikilinks, callouts, embedded notes and highlights, plus Pandoc and MkDocs blocks, <details> HTML wrappers, and LaTeX delimiters copied out of chat tools. Everything beyond CommonMark and GitHub defaults has its own setting, and anything unrecognized stays editable as plain markdown.

Merging changes from disk

When another program writes to a file you have open, the extension runs a 3-way merge against the last clean base and your unsaved edits. Changes in other parts of the note fold straight into the open tab, and Tandem Markdown draws a subtle outline around the lines that changed until you have seen them, then fades it out. Your cursor stays where it was and your unsaved typing continues untouched.

External edits merged and outlined in sprint.md while unsaved typing continues below
An outside write merged and outlined above unsaved typing

Where both sides edited the same words, the reconciler keeps your words at the clash, merges the rest, saves a 30-day backup of the incoming version outside your workspace, and writes a .conflict file beside the note. That file explains what collided so an agent can read it and finish its edit after you save. A one-click command adds those handoff rules to AGENTS.md and Claude Code's rules folder so agents know to check for it.

The merge core stays pure and separated from VS Code's host layer so it can be exercised under randomized sequences of typing, saves, undos and disk writes, checking three invariants on every run: unsaved typing is never silently dropped, settled outside writes are never silently lost, and the panel never drifts out of step with the file VS Code will save.

Decisions

  • Nothing the toolbar or slash menu inserts writes HTML, and unrecognized syntax renders as plain text, so a note never gets locked into the extension.
  • Editing a table cell changes only that cell in the file, rather than re-padding every row and turning a small edit into a whole-table git diff.
  • A clash from a git pull or checkout writes a backup and a diff prompt instead of a .conflict file, because no agent is waiting to read one.
  • VS Code's own tools stay intact inside the rich views: spell-check underlines with Ctrl+. quick fixes, F2 rename across links and headings, interactive git gutter change marks, and inline git conflict buttons.
  • Released open source under the MIT license, with zero telemetry and a single switch to keep remote image requests off as well.