SmartMarkdown

Markdown for Claude

Structure your Markdown for Anthropic's Claude the way it parses best: XML-tagged documents and instructions, document placed before the task, noise removed and code tagged — with a live token estimate against Claude's 200K context window.

Your Markdown / Content

Optimized for Claude

<document>
# Product Requirements

## Background
We need a CSV import feature.

## Goals
- Parse CSV up to 50MB
- Show a preview before import
- Handle errors gracefully

```text
def import_csv(file):
    return parse(file)
```text
</document>
~55 tokens out~58 in7 saved by cleanup
Claude Opus / Sonnet: <1% of contextClaude (1M beta): <1% of context
  • Removed HTML comments, zero-width and non-breaking characters.
  • Added language hints to untagged code fences.
  • Collapsed redundant blank lines and trailing whitespace.
  • Structured with XML tags — the format Claude parses most reliably.
Reviewers

Sarah Chen, SEO Content Strategist

Based on 5 sources
238 people find this tool helpful

What This Tool Does

Claude is exceptional at working with long documents, but it performs best when those documents are clearly delimited and the task is well placed. This tool takes raw Markdown and produces a Claude-optimized prompt: it cleans noise, tags code blocks, wraps your content in XML tags, and orders everything the way Anthropic recommends.

XML-Tagged Structure

Rather than relying on Markdown fences alone, the output wraps your document in a <document> tag (with an optional title attribute) and any instruction in an <instructions> tag. These explicit boundaries are the format Claude parses most reliably, reducing the chance it confuses reference material with the task you want done.

Document-Then-Instruction

For long-context prompts, Anthropic recommends placing the bulky document first and the instruction last. The tool follows this ordering automatically, so Claude reads your material and then encounters a clear, final statement of what to do with it.

Token Budgeting

The optimized output's token count is estimated and shown against Claude's context windows, including the standard 200K and the 1M-token beta. You can confirm even a large document fits comfortably and leaves room for a detailed response.

Common Use Cases

  • Document Q&A: ground Claude on a spec, contract, or article.
  • Summarization: hand Claude a long report with a clear instruction.
  • Code understanding: provide tagged code for review or explanation.
  • Reusable prompts: standardize a document + instruction template.

Tips

  • Always add a concise instruction — Claude weights the final instruction heavily.
  • Use a descriptive title so Claude can refer to the document by name.
  • Clean content pasted from other tools first with the Markdown Cleaner.

FAQ

Frequently Asked Questions