claude-chat-to-claude-code-cli-mirroring

Import recent claude.ai chat conversations into Claude Code session history as resumable JSONL transcripts.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/dsonyy/dotfiles --skill claude-chat-to-claude-code-cli-mirroring-dsonyy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: claude-chat-to-claude-code-cli-mirroring
Source: https://github.com/dsonyy/dotfiles/tree/main/skills/claude-chat-to-claude-code-cli-mirroring
Command: npx skills add https://github.com/dsonyy/dotfiles --skill claude-chat-to-claude-code-cli-mirroring-dsonyy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, jq, uuidgen, and includes scripts (resource) components.

What problem does it solve? Conversations held on claude.ai are not visible inside Claude Code, so context from web chats is lost when working in the terminal. This Skill mirrors recent claude.ai conversations into the local Claude Code projects directory so they appear in session history and can be reopened with /resume. ## Core Features & Use Cases - Conversation Mirroring: Fetches the most recent claude.ai conversations via the claude.ai API using your sessionKey cookie and writes them as Claude Code session JSONL files. - Titled Sessions: Each imported session gets an ai-title entry prefixed with [MIRROR] so mirrored chats are easy to identify in /resume. - Skip Protection: Conversations already modified locally are skipped, and empty conversations are ignored. - Use Case: You discussed a design on claude.ai in the browser and want to continue that exact thread inside Claude Code on your machine; run the mirror script and resume the [MIRROR] session. ## Quick Start Ask the assistant to mirror your last 5 claude.ai conversations into Claude Code so you can resume them locally.

Frequently Asked Questions about claude-chat-to-claude-code-cli-mirroring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import claude.ai conversations into Claude Code?▼

Save your claude.ai sessionKey cookie value into ~/sessionKey, then run the mirror script with an optional conversation count. It writes JSONL session files into ~/.claude/projects so the chats appear under /resume with a [MIRROR] title prefix.

How many claude.ai conversations can I mirror at once?▼

The script mirrors the 5 most recently updated conversations by default. Pass a positive integer argument to mirror.sh to change the count, for example mirror.sh 10 to fetch the ten most recent chats.

Where do I find the sessionKey cookie for claude.ai?▼

Open claude.ai in your browser, press F12, go to Application > Cookies > https://claude.ai, and copy the sessionKey cookie value. Paste it into the file ~/sessionKey with no extra whitespace.

Why does the mirror script say my cookie is invalid or expired?▼

The claude.ai API returns HTTP 401 or 403 when the sessionKey cookie has expired or been revoked. Copy a fresh sessionKey value from your browser cookies into ~/sessionKey and run the script again.

Will mirroring overwrite conversations I already resumed and edited locally?▼

No. The script skips any existing session file whose line count differs from the freshly generated 3-line format, treating it as locally modified. Only untouched or missing conversations are written.