MCPcopy
hub / github.com/codeaashu/claude-code / export

Function export

web/lib/api/conversations.ts:81–108  ·  view source on GitHub ↗
(id, format)

Source from the content-addressed store, hash-verified

79 },
80
81 async export(id, format) {
82 const conv = findConversation(id);
83
84 if (format === "json") {
85 return new Blob([JSON.stringify(conv, null, 2)], {
86 type: "application/json",
87 });
88 }
89
90 // Markdown export
91 const lines: string[] = [`# ${conv.title}`, ""];
92 const created = new Date(conv.createdAt).toISOString();
93 lines.push(`> Exported from Claude Code · ${created}`, "");
94
95 for (const msg of conv.messages) {
96 const heading =
97 msg.role === "user"
98 ? "**You**"
99 : msg.role === "assistant"
100 ? "**Claude**"
101 : `**${msg.role}**`;
102 lines.push(heading, "");
103 lines.push(extractTextContent(msg.content), "");
104 lines.push("---", "");
105 }
106
107 return new Blob([lines.join("\n")], { type: "text/markdown" });
108 },
109};

Callers

nothing calls this directly

Calls 3

extractTextContentFunction · 0.90
findConversationFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected