<claudexml/>

<source> — when and how to use it in Claude prompts

Nested inside . Lets Claude cite back to the source name or URL you supplied.

Provenance metadata nested inside a <document>. Lets Claude cite back accurately.

When to use <source>

  • Any time you want the model to name its sources in the answer.

When not to use it

  • When the documents are anonymous or citation isn't required.

Minimal example

<document>
  <source>RFC 2616, Section 14.9</source>
  <document_content>The Cache-Control general-header field is used to specify...</document_content>
</document>

Full example

See the RAG example on the <document> page.

Common mistakes

  • Putting the source after the content. Place <source> first inside the document — it primes attribution.
Cite this page
<source> — When and How to Use in Claude Prompts. claudexml.com. https://claudexml.com/tags/source/