Hidden Token Cost of Using Markdown in Your AI Prompts & Workflows
TL;DR
Markdown in AI prompts isn't free: every asterisk, hash, and blank line counts as tokens and inflates costs.
Key Points
- Sam Witteveen demonstrates that code-based agent skills (Python, Bash) are significantly more token-efficient than markdown-heavy instructions.
- Claude Skills already use this approach: tasks are defined directly in code rather than verbose text blocks.
- A Python script can express the same logic more compactly than a multi-page markdown document with headers and bullet points.
- Teams running many agent workflows can achieve measurable token and cost savings by switching to code-based skills.
Nauti's Take
The insight sounds simple, yet most teams consistently ignore it: markdown was built for humans, not language models. Decorating system prompts with bold headers and nested bullet points is essentially paying for formatting overhead.
Code-based instructions are the logical next step – more precise, more compact, and directly executable. The deeper advantage is that code forces clarity.
Vague requirements that hide comfortably in markdown prose actually have to be defined properly in Python.