How Claude Formats Chat Links When Referencing Past Conversation Search Results
Claude converts raw <chat> XML tags from conversation search results into clean, clickable Markdown links using the format https://claude.ai/chat/{uri}.
When Claude retrieves historical conversation snippets using the internal conversation_search tool, the system must transform machine-readable metadata into user-friendly references. According to the leaked system prompts in the asgeirtj/system_prompts_leaks repository, this formatting follows strict rules defined across multiple Anthropic model configurations.
The Raw Conversation Search Response
When Claude queries past conversations, the raw response contains an XML-like <chat> tag with three critical attributes. This structure appears in the internal tool output before any user-facing formatting is applied.
The raw tag follows this schema:
<chat uri='12345abcdef' url='https://claude.ai/chat/12345abcdef' updated_at='2024-12-01T15:30:00Z'></chat>
uri: The unique identifier for the conversationurl: The full canonical URL (redundant with the URI)updated_at: ISO 8601 timestamp of the last conversation activity
Claude never exposes this raw XML to users. Instead, the system prompt instructions mandate specific transformation rules.
How Claude Formats Chat Links for Display
The canonical format for presenting conversation references is explicitly defined in multiple system prompt files. Claude must extract the uri attribute from the <chat> tag and construct a clickable Markdown link pointing to https://claude.ai/chat/{uri}.
This rule appears in Anthropic/old/claude-opus-4.5.md at lines 107-110:
"Always format chat links as a clickable link like:
https://claude.ai/chat/{uri}"
The same instruction appears in:
Anthropic/old/claude-4.5-sonnet.mdat lines 44-46Anthropic/old/claude-4.1-opus-thinking.mdat lines 96-100
When synthesizing search results, Claude generates natural language summaries of the retrieved conversation content, then appends the formatted link using the extracted URI. The result is a clean, copy-paste-ready URL such as https://claude.ai/chat/12345abcdef.
Practical Implementation Example
To replicate Claude's chat link formatting in your own applications, extract the uri attribute from the conversation search response and concatenate it with the base URL.
Here is a JavaScript implementation that mirrors Claude's internal logic:
/**
* Transform a <chat> tag payload into a Claude-formatted URL.
* @param {string} uri - The unique identifier from the <chat> tag.
* @returns {string} The formatted Claude chat URL.
*/
function formatClaudeChatLink(uri) {
const baseUrl = 'https://claude.ai/chat/';
return `${baseUrl}${uri}`;
}
// Example usage:
const conversationUri = 'a1b2c3d4e5';
const chatLink = formatClaudeChatLink(conversationUri);
console.log(chatLink);
// Output: https://claude.ai/chat/a1b2c3d4e5
When embedding this in Markdown responses, the URL renders as a clickable link in most modern chat interfaces and documentation systems.
Summary
- Claude receives conversation search results wrapped in
<chat uri="..." url="..." updated_at="...">XML tags. - System prompts in
asgeirtj/system_prompts_leaksmandate converting these to the formathttps://claude.ai/chat/{uri}. - This formatting rule is explicitly defined in
claude-opus-4.5.md,claude-4.5-sonnet.md, andclaude-4.1-opus-thinking.md. - The resulting links are clean, clickable, and point directly to the Claude web interface for the referenced conversation.
Frequently Asked Questions
What is the exact URL structure Claude uses for chat links?
Claude uses the structure https://claude.ai/chat/{uri}, where {uri} is the unique identifier extracted from the uri attribute of the raw <chat> tag. This creates a direct link to the specific conversation in the Claude web interface.
Where are the chat link formatting rules defined in the system prompts?
The formatting rules appear in multiple files within the asgeirtj/system_prompts_leaks repository. Specifically, you can find them in Anthropic/old/claude-opus-4.5.md at lines 107-110, Anthropic/old/claude-4.5-sonnet.md at lines 44-46, and Anthropic/old/claude-4.1-opus-thinking.md at lines 96-100.
Does Claude show the raw XML tags to users when referencing past conversations?
No. Claude never exposes the raw <chat uri="..." url="..." updated_at="..."> XML structure to end users. The system prompt instructions explicitly require Claude to parse these internal tags and present only the formatted https://claude.ai/chat/{uri} link alongside a natural language summary of the conversation content.
Can I use the same chat link format in my own applications?
Yes. The URL format https://claude.ai/chat/{uri} is a public-facing pattern that resolves to the Claude web application. If you have access to conversation URIs through Claude's API or export features, you can construct these links using the simple concatenation pattern shown in the JavaScript example above.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →