Quick answer
To export a Claude Code session, type /export followed by a file name, for example /export landing-page-session.txt. Claude Code saves the whole session history as a plain text file. Before you share it, remove any secrets and client data. Then you can give the file to another AI agent, such as Codex, with a short handoff prompt so it carries on where you left off. You can also ask an agent to read it and draft a reusable skill from the steps you repeated.
Key takeaways
/exportplus a file name saves the full session as plain text- Always clean the file first: API keys, passwords, client details and private file paths
- A good handoff prompt asks the next agent to summarise, list unfinished work and wait for approval
- Exports are a quick way to turn one good session into a repeatable skill
- Use a clear naming pattern so you can find old sessions later
In this guide
- What does the Claude Code /export command do?
- How do you export a Claude Code session?
- What should you remove before sharing the file?
- How do you hand the session to another AI agent?
- How do you turn an exported session into a reusable skill?
- How should you name and store exports?
- Frequently asked questions
- The bottom line
Long Claude Code sessions hold lots of useful context: what you tried, what failed and what you decided. Until now, most of that was lost when you closed the window. The new export command keeps it.
This guide shows how to export a Claude Code session, clean it and reuse it. It was one of the practical updates in our Muse Spark Open and AI news round-up.
📘 Main article: This guide supports Muse Spark Open: Meta’s Open-Weight Model, Opus 6 Rumours and This Week’s AI News. Read it for the other Claude updates this week, including Opus 5.5 Fast Mode pricing.
What does the Claude Code /export command do?
It saves your entire current session, including your messages and Claude’s replies, as a plain text file. Plain text matters because almost any tool can read it. That includes another AI agent, a notes app or a simple search across your files.
| Use | Why an export helps |
|---|---|
| Handing work to another agent | The next agent sees what was done and why, so it doesn’t start from scratch |
| Picking up tomorrow | You keep a record of decisions even after the session ends |
| Building a skill or shortcut | You can spot the steps you repeat and turn them into a checklist |
| Reviewing what went wrong | You can see exactly where a task went off track |
| Client or team records | You have a readable log of AI-assisted work, once it’s cleaned |
How do you export a Claude Code session?
- Update Claude Code so you have the latest commands.
- Finish the session, or reach a natural stopping point.
- Type
/exportfollowed by a file name, for example/export 2026-10-16-landing-page.txt. - Find the file. It is saved where Claude Code is working, usually your project folder. If you can’t see it, ask Claude where it saved the export.
- Open it and check that it holds the whole session you expected.
💡 Tip: Export before a very long session gets compressed or you close the app. Features like idle compaction shorten old context to save usage. Our guide to Claude Code idle compaction and nested sessions explains when that happens.
What should you remove before sharing the file?
An export includes everything that appeared in the session. Before it goes anywhere else, search the file for these and remove them:
- API keys and tokens. Search for words like
key,token,secretandsk-. - Passwords and login details.
- Client names, emails and personal data.
- Private file paths or server addresses that reveal how your systems are set up.
- Large pasted outputs you don’t need, such as long logs, to keep the file small.
⚠️ Warning: Never paste an uncleaned export into a public chat, forum or shared document. If a real key appears in the file, assume it is exposed and rotate it, not just delete the line.
How do you hand the session to another AI agent?
Attach or paste the cleaned file into the next agent, for example Codex, and give it a clear brief. Here is a handoff prompt you can copy:
📋 Handoff prompt:
You are picking up a task that was started in Claude Code. The attached file is the full session history.
1. Summarise in five bullet points what was done and what was decided.
2. List anything that was left unfinished or failed.
3. Ask me up to three questions if anything is unclear.
4. Do not redo finished work. Continue from the first unfinished step, and wait for my go-ahead before you change any files.
The last line matters most. It stops the new agent from rushing ahead on assumptions it took from someone else’s session.
💡 Tip: For very long sessions, ask the first agent for a one-page summary before you export. Then hand over both the summary and the full file. The summary gives quick orientation, and the full file is there if the details are needed.
Building automations with AI agents? Good handoffs are what turn one-off sessions into a reliable workflow. Browse more practical guides on Prodify Digital.
How do you turn an exported session into a reusable skill?
If you find yourself doing the same kind of task again and again, such as publishing checks, page reviews or report clean-ups, an export is the raw material for a reusable skill.
- Export a session where the task went well.
- Clean it as described above.
- Give it to Claude, or another agent, with the prompt below.
- Edit the draft checklist yourself. Remove steps that only applied once.
- Save it as a skill, mod or custom command, then test it on a fresh task.
📋 Skill-drafting prompt:
Read the attached Claude Code session export. Find the steps I repeated or would repeat next time.
Write them up as a reusable, generic checklist: a one-line description of when to use it, the inputs it needs, numbered steps and a final check.
Leave out client names, file paths and anything specific to this one project.
For examples of what to build, see SEO Checklist Automation: Build a /publish-check Shortcut in Claude Code and How to Write a Claude Code Mod Prompt That Actually Works.
How should you name and store exports?
| Habit | Example |
|---|---|
| Date first, so files sort in order | 2026-10-16-landing-page.txt |
| Add the project or client code (not the name) | 2026-10-16-acme01-landing-page.txt |
| Mark cleaned files | ...-clean.txt |
| Keep raw exports private | A folder only you can access, deleted after a set period |
Frequently asked questions
How do I export a Claude Code session?
Type /export followed by a file name, for example /export my-session.txt. Claude Code saves the session history as a plain text file.
What format is a Claude Code export?
Plain text, so any editor, AI agent or search tool can read it.
Can I continue a Claude Code session in Codex?
Yes. Give Codex the cleaned export with a handoff prompt asking it to summarise the work, list what is unfinished and wait for your approval before changing files.
Is it safe to share an export?
Only after cleaning it. Exports can contain API keys, passwords, client data and private paths. Remove those first, and rotate any key that appeared.
Can an export become a Claude Code skill?
Yes. Ask an agent to read a good session and draft a generic checklist from the repeated steps, then edit and test it.
The bottom line
Learning to export a Claude Code session takes seconds and stops good work disappearing when a session ends. Clean the file, hand it over with a clear brief, and turn your best sessions into skills. For the rest of this week’s Claude and AI news, go back to Muse Spark Open: Meta’s Open-Weight Model, Opus 6 Rumours and This Week’s AI News.
Related posts
- Muse Spark Open: Meta’s Open-Weight Model, Opus 6 Rumours and This Week’s AI News
- Claude Code Idle Compaction and Nested Sessions: How to Cut Token Waste
- How to Write a Claude Code Mod Prompt That Actually Works

[…] How to Export a Claude Code Session and Reuse It in Another AI Agent — how to use /export, clean the file and hand the work to Codex or another agent, or turn it into a reusable skill. […]