THE MESH
Reference
Back
@the_smart_ape · x.com ↗

MD vs HTML: The 3-Question Framework

Stop picking sides. Let the document tell you what it wants to be.

Both camps are wrong. MD fundamentalists and HTML converts are both costing themselves tokens, edit cycles, and search relevance. The question isn't MD vs HTML — it's: for this specific document, who reads it, who edits it, and how long does it live? Answer those 3 and the format picks itself.

The 3 Questions

Every doc you produce with Claude has three properties. Each one votes for MD or HTML. When the 3 votes line up, you have your answer. When they split, use the hybrid pattern.

Question 1
Audience
Humans
Claude
Both
Question 2
Lifecycle
Written once
Edited many times
Question 3
Horizon
A day
A quarter
Forever

Q1: Who actually reads this?

Claude reads its own output back — constantly. If a doc gets re-ingested in a future session, codebase indexing, RAG over your notes, or an agent reading a spec before writing code, HTML eats your context window alive.

800 words, 6 sections, a couple of code blocks:
~1,100Markdown
~3,200HTML with styles + SVG

That's 3×. Multiply by 30 reference files in your project: 60k tokens burned. Retrieval pipelines also chunk HTML worse — expect 15–25% degradation in relevance because markup dilutes the semantic signal.

Doc is reference material Claude will read again → MD, no exceptions. Doc is a one-time deliverable for a human → HTML is on the table.

Q2: How many times will this get edited?

Claude does not edit HTML the way it edits MD. Modify a sentence in Markdown: ~5 lines of diff. Modify the same sentence in a styled HTML file: 40–100 lines of diff. Claude rewrites surrounding markup "to clean it up." Class names shift. Spacing tokens change. SVGs get re-emitted with slightly different coordinates. Nothing visibly broke. Everything is shifting underneath.

Over 5–10 iterations, your HTML document drifts. You end up with 3 different spacing systems and 4 color schemes in the same file. Call this markup drift — invisible until you diff version 1 against version 8.

If the doc gets edited more than 2–3 times → MD or hybrid. HTML is a publication format, not an iteration format. MDX and Markdoc partially fix this.

Q3: How long does this thing live?

The grep test: in 6 months, can you grep -r "pricing" across your project and find this doc? In MD, yes. In HTML, you're searching for <h2>pricing</h2> and missing <h2 class="section-title" data-anchor="pricing">pricing</h2>.

The survivability test: open the HTML file in 3 years. Does the CDN link to Tailwind still work? Did Lucide change its API? A Markdown file from 2015 still opens cleanly.

Ephemeral, demonstrative, one-shot → HTML is fine. Retrieved, indexed, or meant to outlive its author → MD.

Examples

DocumentAudienceLifecycleHorizonVerdict
Product spec Humans + Claude Edited weekly Months MD
Weekly Slack update Humans, once Write once A week HTML if visual hierarchy adds info
Pull request description Humans + GitHub + Claude Write once Indexed forever MD
Animation prototype Humans, in a meeting Thrown away One hour HTML
System architecture doc Everyone incl. future Claude Evolves with system Years Hybrid

One MD Source, Many HTML Renders

Write the canonical document in Markdown. Generate HTML views on demand for specific audiences. One architecture.md becomes:

Each HTML is a derived artifact. Regenerate it whenever the source changes. The MD stays reviewable, indexable, greppable. The HTML does the heavy presentation lift. Setup: a 10-line script that pipes your MD into Claude with three different system prompts. No infrastructure. No lock-in.

The win: you stop trading off. MD keeps all the longevity benefits. HTML does all the presentation work. The source of truth stays text.

The Reversibility Test (30 seconds)

Before committing to HTML, ask: if I had to convert this back to clean Markdown right now, could I do it in one prompt?

If the answer is no, you've put content inside the markup. Content should always be cleanly extractable from the format. The day you can't separate them is the day the document becomes unmaintainable. This catches 90% of bad format choices in 30 seconds.

Legitimate Exceptions for HTML

Takeaway

Stop having format opinions. Start asking 3 questions. Let the doc tell you what it wants to be. Most documents want to be Markdown. A few want to be HTML. One canonical source can produce both, on demand.

Format is a tool. It should be invisible. When you're arguing about it, you're losing.