DatafetchPro
    export-claude-chats
    May 14, 20265 min read41 views

    Export Claude Chats to PDF, Markdown or CSV

    I built a free Tampermonkey userscript to export Claude chats to PDF, Markdown, or CSV in one click. Here is how it works and how to install it.

    If you use Claude for real work — research, drafting, analysis, client strategy — you have probably finished a long conversation and then realised you have no clean way to keep it. Screenshots. Manual copy-paste. Scrolling back and retyping the parts you need. Those are workarounds, and slow ones, especially when the conversation holds hours of back-and-forth you actually intend to use.

    So I wrote a Tampermonkey userscript that lets you export Claude chats to PDF, Markdown, or CSV in one click. A userscript is a small piece of JavaScript your browser runs on one specific site, adding a feature the site does not ship itself. This one puts a floating button on Claude.ai and a panel that downloads your current conversation in the format you choose.


    Why exporting Claude chats is harder than it should be

    Anthropic does offer an account-level data export — you request it from your settings and receive a bundle of your history. That covers backup and portability. What it does not cover is the everyday case: you are looking at one good conversation right now, and you want it as a file, right now, in a format your other tools understand. There is no download button in the chat window for that. You can check the current state of the account export in Anthropic's official help centre, since these features change.

    For casual use, that gap does not matter. For research archiving, content workflows, dataset building, or anything you hand to a client, it matters a lot.


    What Claude Chat Exporter Pro is

    It is a single Tampermonkey script. No account, no API key, no extra software beyond the userscript manager itself. Once installed, an orange floating button sits in the bottom-right corner of Claude.ai.

    The panel and live stats

    Click the button and a panel slides up showing three numbers for the conversation you are currently in: total messages, word count, and number of conversation turns. Pick a format, download, done.

    The stats refresh as the conversation grows. If you export midway through a chat and keep talking, the counts update in real time, so you always know what you are about to download.


    Three export formats, and when to use each

    Different work needs different file types, so the script covers the three that matter most.

    PDF, when presentation matters

    The PDF export uses a clean, print-ready layout with proper headers and role badges that separate your messages from Claude's. It opens the browser print dialogue, so you control page size, margins, and quality before saving. The output looks like a document you could attach to a report, not a raw text dump.

    Markdown, for Notion, Obsidian, and Bear

    The Markdown export uses headings and separators to organise the conversation into something immediately readable. Drop it into the Obsidian note-taking app, Notion, or any other Markdown-aware editor and it renders correctly with no cleanup.

    CSV, for analysis and pipelines

    This is the one that does the heavy lifting for data work. Each row carries the message index, the role (user or assistant), the full message content, the word count, and a timestamp. That structure drops straight into a spreadsheet, a database import, a fine-tuning dataset, or a downstream automation job.

    Format

    Best for

    What you get

    PDF

    Sharing, archiving, client deliverables

    Print-ready layout, role badges

    Markdown

    Notes tools and writing environments

    Headings and separators, no cleanup

    CSV

    Analysis, imports, dataset building

    Index, role, content, word count, timestamp


    How the script reads your conversation

    The script uses DOM scraping — it reads the conversation out of the rendered page, the same content your browser is already displaying. It walks every user and assistant message in order and pulls the full text without dropping messages or mangling formatting, including in long conversations.

    Why single-page apps break simple scripts

    Claude.ai is a single-page application. Moving between conversations does not reload the page, it just swaps the content. Basic userscripts run once on page load, so they capture whatever was on screen at that moment and then go stale — or never fire at all if you arrived by clicking through from another chat.

    What continuous monitoring means in practice

    This script watches the page for changes instead of running once, an approach built on the MutationObserver browser API documented by MDN. The practical result: the stats panel matches the conversation you are actually looking at, and the button keeps working as you navigate between chats without refreshing.


    Who gets the most out of it

    Research and writing work

    Extended analysis sessions — working through literature, building an argument, drafting and editing across dozens of turns — produce material worth keeping. Copying chunks into a document afterwards is slow and misses things. Markdown export into your notes tool takes five seconds.

    Data and dataset work

    If you are building AI tooling, preparing training data, or running conversation analysis, the CSV export hands you a clean, role-labelled, timestamped dataset straight from the source. No transcription step.

    Client-facing work

    Consultants using Claude for research, strategy, or competitive analysis can send the PDF into a deliverable without it reading like a chat log. That is the difference between a working note and something a stakeholder will actually open.


    Installing the userscript in about 30 seconds

    The four steps

    1. Install the Tampermonkey extension for Chrome, Firefox, or Edge.
    2. Open the Tampermonkey dashboard and create a new script.
    3. Paste in the full code from the Claude Chat Exporter Pro source listing and save.
    4. Refresh claude.ai. The floating button appears on chat pages.

    If the floating button does not appear

    Three things to check, in order. Confirm Tampermonkey is enabled and the script shows as active in the dashboard. Confirm you saved the script rather than closing the editor tab. Then hard-refresh the Claude tab, because a script installed while the page is already open will not attach until the page reloads.


    Limits worth knowing

    Two honest notes. First, the script reads what the page renders, so anything Claude displays in a special container may export differently from plain message text — run one test export on a long conversation before you rely on it for something that matters.

    Second, whether running a userscript against Claude.ai fits Anthropic's terms of service and your own account rules is your call, not mine. I can tell you how the technical approach works. Reading the terms and deciding is on you, and that goes for any site.


    When a userscript is not enough

    This script does one job on one site. Plenty of the work I get asked for does not fit in a browser tab: pulling data from a site that fights back, scheduling a job to run nightly, cleaning the output into PostgreSQL or Google Sheets, pushing it through a webhook into something else. That is my custom scraping and automation service rather than a free script.

    If you have a data problem shaped like that, tell me what you need built</a> and I'll say whether it is a two-hour job or a two-week one. Otherwise, take the script, install it, and stop screenshotting your conversations. More write-ups on scraping and browser automation live in my archive of scraping and automation posts.



    0

    Rather not build it yourself?

    I build this kind of thing for a living.

    Send me the site and what you need out of it — you'll get an approach, a timeline, and a fixed quote back. Scoping is free.