How to export a Claude.ai or ChatGPT chat into VS Code
Install the Exportal VS Code extension and the Exportal Companion browser extension, pair them once, then click the floating button in any chat at claude.ai/chat, claude.ai/design/p or chatgpt.com/c. The whole conversation is written as Markdown to <workspace>/.exportal/ in VS Code and attached to Claude Code as an @-mention, so you keep working on it instead of re-explaining your project.
It takes about two minutes to set up and one click per chat after that. Both halves are free and MIT licensed.
What you need
- Visual Studio Code 1.85 or newer, with the Exportal extension from the VS Code Marketplace.
- A Chromium-based browser (Chrome, Edge, Brave) with Exportal Companion installed.
- An open workspace folder in VS Code. The Markdown is written inside it, so a window with no folder has nowhere to put the file.
- Your normal logged-in browser session. Exportal reads the conversation with the session you already have, so there is no API key and no account to create.
Both halves are required. The browser extension talks to a small HTTP server that lives inside the VS Code extension and listens only on 127.0.0.1.
The one-click path
What you will do once, and what you will do every time after that.
-
Install the VS Code extension
Press Ctrl+Shift+X, search for "Exportal" and install it. The first time VS Code opens it, a two-step pairing wizard appears.
-
Install the browser companion
Step 1 of the wizard sends you to the Chrome Web Store. Install Exportal Companion there.
-
Pair them once
Step 2 of the wizard shows a pairing token with a "Copy token and open Chrome" button. Click it: claude.ai opens with the token in the URL fragment, the companion captures it, its options page says "Done! All connected", and VS Code confirms. Nothing to copy or paste by hand. If you skipped the wizard, reopen it with Ctrl+Shift+P and "Exportal: Show pairing token".
-
Open the chat you want and click Export
Go to the conversation at
claude.ai/chat/<uuid>,claude.ai/design/p/<uuid>orchatgpt.com/c/<uuid>, click the floating Exportal button in the bottom-right corner and choose "Export this chat". The keyboard shortcut Alt+Shift+E does the same without opening the panel. -
Write your prompt in Claude Code
VS Code saves the Markdown, opens it, and opens the Claude Code panel with the file already attached as an
@-mention. The Exportal panel also shows quick prompts such as "Continue this conversation" that copy the prompt with the cursor already in Claude Code's input.
vscode:// handler. The conversation is imported as soon as the bridge starts. The first time, your browser may ask you to confirm opening Visual Studio Code.
Where the file lands, and what is in it
The conversation is written to <workspace>/.exportal/<timestamp>-<slug>.md. It contains the full exchange, including tool use, thinking blocks and results, as clean Markdown rather than a screenshot of a chat.
Secrets and filesystem paths are redacted by default, and turning that off takes an explicit opt-out. Email and IP redaction is available with an explicit opt-in. Add .exportal/ to your .gitignore if you do not want the imports in version control.
For a Claude Design project, the generated assets (HTML, JSX, JSON and so on) are downloaded to a sibling folder, and the Markdown starts with a list of them so Claude Code knows they are there.
The other three paths
From the official export ZIP
If you would rather use the provider's own export (claude.ai: Settings, Export data; ChatGPT: Settings, Data controls, Export), open the Exportal tab in VS Code and click the provider's row. A recently downloaded ZIP is detected automatically, including the multi-file exports that large accounts receive. This path does not depend on any internal API.
From Claude Code back to the web chat
In the Exportal tab, under "Export current session", click claude.ai or ChatGPT. Exportal picks your most recent Claude Code session, renders it to Markdown, copies it to the clipboard, saves a copy to .exportal/ and opens the provider. You paste it yourself: no provider offers a write API, so that last step is manual by design. Both sites silently truncate pastes over 100K characters, which is why the file is saved as a fallback you can drag in instead.
From the terminal
The CLI covers the same ground without the browser: npx exportal export <sessionId> --out session.md renders a Claude Code session, and npx exportal import list and import show read a provider ZIP. Both redact secrets by default and print a preview of what will be written before it touches the disk.
Making an imported chat show up in /resume
Turn on the exportal.alsoWriteJsonl setting and, alongside the Markdown, Exportal writes a .jsonl session to ~/.claude/projects/. The imported conversation then appears in Claude Code's /resume list as if it had been a local session.
This one is opt-in and labelled experimental on purpose: the .jsonl format is reverse-engineered, not documented by Anthropic, and can break between Claude Code versions. The Markdown export, which is the main feature, does not depend on it.
If something does not work
The companion's icon badge tells you where the problem is before you open anything: OK in green means the import landed, SET in yellow means the token is missing, OFF in red means VS Code is not responding, AUTH means the token is invalid, and OLD means the VS Code side is outdated. Click the icon in any error state and the options page opens with a banner explaining the fix.
The badge says SET or AUTH
The companion has no token, or one that no longer matches. In VS Code run "Exportal: Show pairing token" and click "Copy token and open Chrome". A companion loaded unpacked has a different extension id than the store build, which means separate storage, so it needs its own pairing.
The badge says OFF
VS Code is not running, or its window has no workspace folder open. The banner offers Retry and Open VS Code.
You use more than one browser
Install the companion in each one and paste the same token into its options page. The token belongs to the VS Code profile, not to a browser, so one VS Code pairs with as many browsers as you like. The "paired" notification only appears once per token, so the second browser confirms on its own options page.
Related
- How Exportal compares to other chat exporters, including when you should not use it.
- The alternatives worth knowing first: copying and pasting by hand, Claude Code's own Session history for cloud sessions, and MCP.
- The FAQ: account safety, plans, what happens when a provider changes its internal API.
- The threat model: what the bridge accepts and what redaction does and does not catch.
- Support, if none of the above covers it.