How To Choose Between HTML and Markdown for AI Agents

Robert Ta argues HTML beats Markdown for AI code generation because it can encode requirements, mockups, tests, and milestones in one spec file that agents understand natively. Jonathan notes HTML works well for complex specs but Markdown stays more token-efficient for retrieval and simple edits.
Chapters
An Anthropic engineer says Markdown is dead and 99% of his tokens get thrown away on purpose. Instead, HTML is the new Markdown for your input artifacts for code generation. Here's what it means for teams using Cloud Code and AI coding tools daily. You can now spend just a percentage of your tokens on production code and make the other 99% worth throwing away by building thinking artifacts that make every future session smarter. That's sort of the promise of harness engineering without just pure hyperbole. But the thinking is, can you spend a lot of time on, because code generation is cheap nowadays, can you spend a lot of time on the specification and then maybe even generate some code as throwaway to learn and surface unknown unknowns? Tariq, I think I'm pronouncing his name right, Tariq Shihipar. Shihipar. Engineering lead for Cloud Code for Anthropic, was featured on a podcast we'll link a week or two ago. And he actually just talked about a new meta of writing your specs into an HTML file so that you as the human would interact better with the specification. And I'm gonna show you an example of that. This was for a specification for building a new feature in this app, Clarity Context, that I've been baking. And there are some key problems that we outlined in this. So you can imagine this living as a Markdown file. I had it critique our current UX. There was a 4-step wizard. There was an interview sort of portion. I had it give me a before and after experience of what onboarding would look like with an estimate of time to magic moment from product perspective. I had it also outline what components we would be touching and give me a before, after, what's it going to look like in the UI afterwards. Because this is HTML, you can actually inject your design system. I think that was a really cool part of creating this specification in HTML where I could actually see the Storyboard design pages and what it's supposed to look like. And not only that, the AI has these components now as code, at least the frontend code. So I've found it more likely to implement it in one shot, the frontend code to look exactly like this. And there's more down here, but This is files to change, how long it thinks it'll take, the TDD, test-driven development exit criteria and test strategy, different milestones around that, and the execution order. And then I had it also create me a prompt in a goal loop so that I could execute on this until it hit all the exit criteria. This is an example of doing spec-driven development with an HTML file. The main difference is that you can't go in here and edit this very easily. So what I do in practice is I'll have a Cloud Code session generate this and I'll be talking to the Cloud Code session on the side of looking at this. And I'll just whisper flow a bunch of the changes that I would like made in the specification before iterating. Cool. I'll pause there. I know I said a lot. Jonathan, what do you think of HTML specs?
Yeah, I think it's great. I think that maybe the surprise here, because I mean, like, everybody knows HTML. Like, why are we talking about Markdown versus HTML right now, right? Yeah, yeah, yeah, yeah.
Seriously.
I think what's interesting, I think, is that the agentic models have been trained to, like, communicate in HTML primitives, like tables, and it could do— you get a lot more out of the box than you specify, right? So, I think for specs and that kind of thing, it's really good. I think there's a divide, your interactive previews and complex specs, HTML is going to communicate those well. For RAG memory and machine handoffs, Markdown is a more efficient, token-efficient standard. And then if you need to make edits on a document, like you're kind of in this modality, like you were talking about, you take pictures of the HTML and and then talk. So you're having the— you're having a language model generate, you know, syntax as HTML so that it can render into a browser. You can take a picture of it and then ask the model like what to update, right? As opposed to generating characters on a word processor and then editing it and co—
co—
co— like authoring something with it.
Mm-hmm.
And so that's that's an interesting communication paradigm.
Yeah.
But I, I think like we're just in this kind of like infancy stage where somebody will probably develop like a specific version of HTML that is meant for like specification communication. Like, you know, kind of like, um, a React library or something like that. Uh, pattern library. Yeah. Yeah.
I could see that. Like a React spec for, for agents. Um, Yeah.
'Cause like React does all the com— components, I think. Yeah. Pattern library of components that are typically used for communication. In speculative development. I expect to see more evolution on that front. And like, I just think we're like in the early days of all this.










