A PowerShell script that consolidates all Claude Code persistent memory files across all your projects into a single Markdown file, ready to paste or attach to a Claude app conversation.
- Windows with PowerShell 5.1+
- Claude Code CLI installed (memory lives at
%USERPROFILE%\.claude\projects\)
Place export_context.ps1 inside your %USERPROFILE%\.claude\ folder, then run:
powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.claude\export_context.ps1"This generates context_export.md in the same directory.
For every project that has a memory/ folder, it includes:
MEMORY.md— the index- All individual memory files (
user_*.md,project_*.md,feedback_*.md, etc.)
Projects without a memory/ folder are skipped.
- Run the script
- Open
context_export.md - Attach it to a new Claude conversation (claude.ai or the desktop app)
- Claude will have full context of your past sessions across all projects
context_export.mdis regenerated every run — safe to re-run anytime- Add
context_export.mdto.gitignoreif you fork this, as it may contain project details you don't want public