A privacy-first Chrome extension to export claude.ai conversations to Markdown, HTML, PDF, JSON and plain text — or copy them straight to your clipboard.
Everything runs locally in your browser. No backend, no telemetry, no third-party services. Audit the entire codebase in an afternoon.
- Export to Markdown — clean
.mdwith human/assistant turns, code blocks, and collapsible thinking sections. - Export to HTML — self-contained, single-file
.htmlwith inlined styles. Claude's replies are rendered from Markdown (headings, lists, tables, code blocks), as on claude.ai. - Export to PDF — opens a print-tuned preview and triggers your browser's native print dialog (vector text, real pagination).
- Export to JSON — the whole conversation as structured data, for scripts and other tools (see Architecture).
- Export to plain text —
.txtwith no Markdown or HTML around the messages, for email, tickets and anywhere Markdown would show as clutter. Message text is kept exactly as written. - Copy to clipboard — copy as Markdown, as HTML source, as plain text, or formatted, which pastes into Google Docs, Notion and similar with headings, lists and code intact.
- Branched conversations — only the active branch (the path you're reading) is exported, not regenerated dead-ends.
- Artifacts — exported in full, with later edits applied, so each one shows the version Claude produced at that point (labelled v2, v3, …).
- Images — embedded in HTML, PDF and formatted copies (claude.ai's ~1000px preview), so the file stands alone. Markdown, plain text and JSON link to the preview instead; those links only open while you're logged in to claude.ai.
- Attachments — text claude.ai extracted from pasted or uploaded documents is included (collapsed); other files are listed by name.
- Timestamps — each turn shows when it was sent (UTC) in Markdown, HTML and PDF.
- Thinking — Claude's thinking, or its summary where claude.ai only kept a summary, in collapsible sections.
- Tool calls — web searches, connectors, code execution and other tool use, each with its input and result, in collapsible sections. Pages a search returned are listed as links. Untick Tool calls and results in the popup to leave them out.
- Multiple organizations — works whether the conversation lives in your personal account or a Team/Enterprise org.
- Code-fence safe — code blocks containing backticks get a longer fence, so they don't break out.
- XSS-safe — raw HTML in conversations is escaped, and
javascript:-style links are dropped. Images are embedded as data, never loaded from a URL, so opening an export never fetches anything.
This extension is built around one principle: your conversations never leave your browser.
- ✅ Zero network calls outside
claude.ai. No analytics, no telemetry, no error reporting, no remote code. - ✅ No persistent storage. Nothing is written to disk other than the files you choose to export.
- ✅ Minimal permissions (see below).
- ✅ No build-time obfuscation. Source maps are shipped with the build so you can step through the exact code that runs.
- ✅ Reproducible builds.
npm ci && npm run buildfrom a release tag reproduces the releaseddist/(see below). - ✅ Open source under MIT.
| Permission | Why we need it |
|---|---|
host_permissions: https://claude.ai/* |
Required to inject the content script into your claude.ai tab and call the claude.ai JSON API from that script using your existing session cookies. The extension touches no other origin. |
storage |
Used only via chrome.storage.session (in-memory, cleared when the browser closes) to hand the rendered print-ready HTML from the popup to the print-preview tab, and to remember the popup's Include choice. We never write to chrome.storage.local or sync, so nothing persists across sessions and nothing syncs to your Google account. |
Permissions we deliberately do not request:
activeTab— not needed;host_permissionsforclaude.aialready lets us read the active tab's URL when it matches.tabs— not needed for the same reason.downloads—.mdand.htmlexports use a normal anchor click with thedownloadattribute, which doesn't require the API.scripting— the content script is registered statically in the manifest; we never inject programmatically.<all_urls>/ any other host — the extension only ever talks toclaude.ai.
Install Claude Exporter from the Chrome Web Store.
git clone https://github.com/bensquire/claude-exporter.git
cd claude-exporter
nvm use # Node version from .nvmrc
npm ci
npm run buildThen in Chrome:
- Open
chrome://extensions. - Enable Developer mode (top-right toggle).
- Click Load unpacked and select the
dist/directory. - Pin the extension to your toolbar (optional but convenient).
- Open any conversation on claude.ai.
- Click the Claude Exporter icon in your toolbar.
- Pick an action:
- Download: Markdown · HTML · PDF · JSON · Plain text
- Copy to clipboard: Copy as Markdown · Copy formatted · Copy as HTML · Copy as plain text
Under Include, untick Tool calls and results for a shorter export without them. The choice applies to every format and is remembered until you close the browser.
For PDF: a new tab opens with the print preview and the system print dialog automatically appears. Choose Save as PDF as the destination. Chrome remembers your last destination, so subsequent prints are effectively one click.
If a claude.ai tab was open before you installed the extension, the first export reloads it so the content script can load. Anything you'd typed but not sent in that tab is lost.
- Images are exported at claude.ai's preview size (about 1000px), not as the original upload, which claude.ai doesn't make available. Other files are listed by name; only text claude.ai extracted from documents is exported.
- Chrome caps the data passed to the print tab at 10 MB, so a PDF of a conversation with very many images (roughly 100 or more) fails. HTML export has no such limit.
- Thinking and tool calls are included in Markdown and HTML exports (collapsed), but hidden in PDFs.
- claude.ai usually keeps only a summary of Claude's thinking, and sometimes nothing at all. The summary is exported, labelled "Thinking (summary)"; the full thinking can't be exported because claude.ai doesn't provide it.
- Images that a tool returned are noted as
[Image], not embedded. - Copy as HTML copies the HTML source as text. Use Copy formatted to paste formatted text.
- claude.ai's API is undocumented, so a change on their side can break exports until the extension is updated.
claude.ai exposes a cookie-authenticated JSON API at /api/organizations/{org}/chat_conversations/{chat}?tree=True&rendering_mode=messages&render_all_tools=true. Because the extension's content script runs on the claude.ai origin, your browser cookies are sent automatically — no token handling, no OAuth, no storage of credentials. render_all_tools matters: without it, claude.ai replaces every tool call and result with a "This block is not supported on your current device yet." text block. The org is taken from claude.ai's lastActiveOrg cookie, falling back to each of your other orgs in turn.
The full message tree is fetched and converted into a transcript: the active branch (using current_leaf_message_uuid), with each message's content blocks (text, thinking, images, artifacts, tool calls and results) and attachments in a simple, documented shape. Every output format is a pure function of that transcript. For HTML-based formats, image previews are first fetched from claude.ai (with your session, as the page itself does) and embedded.
For PDF specifically: rather than rasterizing the live claude.ai page (which produces poor output because their CSS isn't print-tuned), the extension generates its own standalone HTML with a print-optimized stylesheet, opens it in a new tab, and triggers window.print(). Result: vector text, real pagination, and turns kept on one page where they fit.
src/
├── manifest.ts # MV3 manifest, permissions, content_scripts
├── messages.ts # Typed popup ↔ content script message protocol
├── util.ts # safeStringify, shared by the converter and formatters
├── popup/
│ ├── popup.html # Toolbar popup UI
│ └── popup.ts # Button handlers, clipboard write, tab opening
├── content/
│ ├── content.ts # Message handler: fetch, convert, dispatch to a formatter
│ ├── api.ts # Authenticated fetch wrappers for claude.ai API
│ └── types.ts # Types for the claude.ai API responses
├── transcript/
│ ├── types.ts # The Transcript format every formatter consumes
│ ├── from-claude.ts # claude.ai API → Transcript (the only code that knows the API shape)
│ ├── images.ts # Embeds image previews, given a fetcher
│ └── options.ts # Export options and applyOptions (thinking, tool calls, attachment text)
├── formatters/
│ ├── shared.ts # Escaping, fence picking, labels, timestamps
│ ├── markdown.ts # Transcript → Markdown
│ ├── html.ts # Transcript → standalone HTML + print CSS, or a style-free fragment
│ ├── json.ts # Transcript → JSON
│ └── text.ts # Transcript → plain text
└── viewer/
├── viewer.html # Print preview shell
└── viewer.ts # Reads HTML from session storage and prints
claude.ai JSON ──toTranscript──▶ Transcript ──applyOptions──▶ Transcript ──embedImages¹──▶ Transcript ──formatter──▶ .md / .html / .json / .txt / clipboard
¹ HTML-based formats only.
The converter and formatters are pure functions: no I/O, no DOM, no chrome.* APIs. embedImages is handed its fetcher, so it's tested without a network. When claude.ai changes its API, only transcript/from-claude.ts should need to change.
Defined in src/transcript/types.ts, and exported as-is (with a schema tag) by the JSON export:
- Transcript:
id,title, optionalcreatedAt/updatedAt/model, andturns. - Turn:
id,role(human|assistant), optionalcreatedAt,blocks,attachments. - Block, by
kind:text: withformatmarkdown(Claude's replies) orplain(your messages, shown verbatim);thinking: withsummarizedwhen only a summary was kept;image: the file's name, and its claude.ai previewurlandwidth/heightwhen known (dataUrlholds the image itself only inside HTML-based exports);artifact: the full content at that point, withversionandpartial(only an edit was available);tool_use: the tool'sname, its rawinput, and claude.ai's description of the call asmessagewhen it gave one;tool_result:text,isError, the tool'snamewhen known, andsources(titleandurl) for pages the tool returned, such as web search results;unknownfor block types this version doesn't know.
- Attachment:
name, optionalsize/mimeType/extractedText, andsource(uploadorfile).
- Add
src/formatters/<name>.tsexporting(t: Transcript) => string. - Add the format to
ExportFormatinsrc/messages.tsand to theexporterstable insrc/content/content.ts. - Add a button in
src/popup/popup.html, and tests intests/formatters/.
TypeScript checks that every block kind is handled, so a format can't silently skip one.
nvm use # Node version from .nvmrc
npm ci # install dependencies (lockfile-frozen)
npm run dev # HMR-capable dev build (watch mode)
npm run build # production build → dist/
npm run typecheck # tsc --noEmit
npm run lint # oxlint
npm run format # oxfmt . (writes in place)
npm run format:check # oxfmt --check .
npm test # vitest unit tests
npm run test:watch # vitest in watch modeAfter running npm run build, reload the extension in chrome://extensions (the circular arrow icon on the extension card) to pick up your changes.
- Vite + @crxjs/vite-plugin — fast builds, HMR, MV3-aware bundling.
- TypeScript strict mode with
noUncheckedIndexedAccessandexactOptionalPropertyTypes. - oxlint + oxfmt — fast Rust-based linter and formatter.
- Vitest — unit tests for the formatters, API helpers and edge cases.
Pushing a version tag publishes to the Chrome Web Store via GitHub Actions. See RELEASING.md.
- 4-space indentation, single quotes, semicolons, trailing commas. Enforced by
oxfmt(see.oxfmtrc.json). - Arrow functions over
functiondeclarations (personal preference). - Defensive parsing at the API boundary in
src/content/api.tsandsrc/content/types.ts. The claude.ai API is undocumented and may change.
Unit tests cover:
- Branched conversation trees (only the active branch is rendered).
- HTML escaping (XSS-safe rendering of arbitrary user content), including raw HTML,
javascript:links and images inside Claude's Markdown. - Converting claude.ai data into the transcript, including artifact versions, thinking summaries, tool calls and their sources, inline images and attachments.
- Embedding images: only claude.ai URLs are fetched, and only
data:image/…ever reaches an<img>. - Each output format, including the JSON round trip and the formatted-copy fragment.
- Finding a conversation across multiple organizations (personal + Team/Enterprise).
- Code-fence collision (backticks inside content force the fence to grow).
- Unknown / future block types (degrade gracefully, never crash).
- Empty conversations, single messages, very long conversations (200+ messages).
- Unicode, emoji, RTL text.
- Missing optional fields.
Each GitHub release has the exact zip that was uploaded to the Chrome Web Store, built by CI from the tagged commit. To check it against the source:
git clone https://github.com/bensquire/claude-exporter.git
cd claude-exporter
git checkout vX.Y.Z # the release tag
nvm use # Node version pinned in .nvmrc
npm ci # frozen-lockfile install
npm run builddist/ should match the contents of the release zip byte for byte, except assets/crx-manifest.js-*.js.map: that source map embeds a path that depends on where you cloned the repo.
Issues and PRs welcome. Please:
- Run
npm run typecheck && npm run lint && npm run format:check && npm testbefore opening a PR. - Add tests for any change to the formatters or content-block walker.
- Keep the runtime dependency surface minimal — every dep is something users have to audit. The only direct one today is
markdown-it, for rendering Claude's replies in HTML exports; it brings in five small packages of its own (entities,linkify-it,mdurl,punycode.js,uc.micro). - Don't add new permissions to the manifest without strong justification.
MIT © Ben Squire
