{"slug": "how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app", "title": "How to sync messages of Claude Code extension in VS Code and Claude Code app?", "summary": "A developer released a free, open-source PowerShell script that syncs Claude Code chats started in VS Code to the Claude Code desktop app by writing missing session wrapper files, enabling users to carry conversations between both apps without editing chat data.", "body_md": "**Make a Claude Code chat you started in VS Code show up in the Claude Code desktop app — so you can carry one conversation back and forth between both apps.**\n\nWindows · one PowerShell script · no install · never edits your chats · MIT licensed\n\nFull explanations are below — but if you just want it done, this is the whole thing.\n\n```\nSTEP 1   Download the script (green \"Code\" button → Download ZIP → Extract).\nSTEP 2   In VS Code: Terminal → New Terminal. Paste ONE line, swap in your folder, press Enter:\n\n   powershell -NoProfile -ExecutionPolicy Bypass -File \"‹PATH TO THE .ps1›\" -ProjectPath \"‹YOUR VS CODE PROJECT FOLDER›\" -Apply\n\nSTEP 3   Fully quit the desktop app (tray icon → Quit) and reopen it.\n\nDone — your VS Code chats from that folder now appear in the desktop app's sidebar.\n```\n\n👉 Confused by `‹PATH TO THE .ps1›`\n\nvs `‹YOUR PROJECT FOLDER›`\n\n? Read ** the 3-folders section** — it's the #1 thing people trip on.\n\n**Understand it (5-min read):**\n\n[📖 The one idea behind everything](#idea)— notebook + index card[❓ The WH questions](#wh)— who / what / why / when / where / how[🔒 Is it safe?](#safe)— yes, and exactly why\n\n**Do it (copy-paste):**\n\n[📥 Install — get the script onto your PC](#install)[🧩 IMPORTANT: don't mix up these 3 folders](#folders)—**read this first**[🚀 How to use it — copy-paste recipes](#recipes)— restart the desktop app⚠️ The step everyone forgets[🆘 Red error? The two common fixes](#errors)\n\n**Use it:**\n\n[🔁 Carry one chat between both apps (ping-pong)](#pingpong)[🗑️ How to undo](#undo)[🧭 Bonus: the folder → \"drawer\" naming](#drawer)·⚠️ Honest limitations[📜 License](#license)\n\nImagine every Claude Code chat is a **notebook**, and there's a **library index card** that points to it.\n\n```\nTHE NOTEBOOK = your actual chat (every message you and Claude wrote)\nTHE INDEX CARD = a tiny note that says \"a notebook exists, here's its name and where it is\"\n```\n\n- The\n**VS Code extension** finds notebooks**by looking on the shelf**(the folder on your disk). - The\n**desktop app** is lazier — it**only reads index cards**. No card = it can't see the notebook,*even though the notebook is right there.*\n\nWhen you start a chat in the **desktop app**, it writes the index card for you. ✅\nWhen you start a chat in **VS Code**, **no card gets written.** ❌ → the desktop app is blind to it.\n\n**This tool writes the missing index card.** That's the whole thing. One card per chat.\n\n```\n   YOUR VS-CODE CHAT\n   notebook  ✔  (your messages — already on disk, we never touch it)\n   index card ✘  MISSING        ──run this tool──►   index card ✔   ──►  desktop app sees it\n```\n\nAnyone who uses **Claude Code in more than one place** — the **VS Code extension** and the **desktop app** — and is annoyed that chats started in VS Code never appear in the desktop app's sidebar.\n\nIt creates a small \"index card\" file (Claude Code calls it a *session wrapper*) for chats that don't have one. With the card in place, the desktop app lists the chat and can open it. **It adds tiny pointer files. Nothing else.**\n\nBoth apps and the terminal CLI **share the exact same chat file** on disk. But the desktop app builds its sidebar **only** from index cards, and **only the desktop app writes those cards** — VS Code never does. So VS-Code-born chats are invisible to the desktop app until someone writes the card. This tool writes it.\n\nWhenever you started a chat in VS Code and now want it in the desktop app too. Run it as often as you like — **it skips chats that already have a card**, so re-running is always safe.\n\n```\nTHE NOTEBOOK (your chat — we only READ it, never change it):\n   C:\\Users\\<you>\\.claude\\projects\\<folder-as-dashes>\\<session-id>.jsonl\n\nTHE INDEX CARD (what this tool WRITES):\n   C:\\Users\\<you>\\AppData\\Roaming\\Claude\\claude-code-sessions\\<guid>\\<guid>\\local_<session-id>.json\n```\n\nFor each VS-Code-born chat in a folder, the tool:\n\n```\n1. Opens the chat file and reads ONLY its first ~50 lines   (a read-only peek)\n2. Figures out two things:\n      • which folder the chat belongs to\n      • a friendly title (the chat's first message), with the date in front\n        e.g.  \"[Jun 13] hey help me find the claude's sesins...\"\n3. Writes a tiny index card whose pointer (\"cliSessionId\") aims at that chat file\n4. Drops the card next to the desktop app's other cards\n```\n\nThat's it. It **reads** your chats (peek only) and **writes** new little card files.\n\n```\n✘ It NEVER edits, moves, or deletes your actual chat files (.jsonl)\n✘ It NEVER overwrites a card that already exists (it skips those)\n✘ It NEVER deletes anything — it only ADDS card files\n✔ It is DRY-RUN by default — it writes NOTHING unless you add  -Apply\n✔ It is trivially reversible — delete the card file it made, and the listing is gone\n   (your chat stays perfectly safe, because the card was never the chat)\n```\n\nYou need just **ONE file**: `register_vscode_session_in_desktop.ps1`\n\n. There is **nothing to compile or install** — you save this one file and run it. Pick either way to get it.\n\n```\n1. Open   https://github.com/budhasantosh010/claude-code-session-bridge\n2. Click the green  \"< > Code\"  button  →  \"Download ZIP\"\n3. Find   claude-code-session-bridge-main.zip   in your Downloads folder\n4. Right-click it  →  \"Extract All…\"  →  choose a PERMANENT home, e.g.  C:\\Users\\<you>\\Tools\n5. You now have the script here:\n   C:\\Users\\<you>\\Tools\\claude-code-session-bridge-main\\register_vscode_session_in_desktop.ps1\ncd C:\\Users\\<you>\\Tools\ngit clone https://github.com/budhasantosh010/claude-code-session-bridge.git\n```\n\nResult:\n\n```\nC:\\Users\\<you>\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\n```\n\n📌 Keep it somewhere permanent you'll remember (a\n\n`Tools\\`\n\nfolder is perfect).Don't leave it in Downloads— too easy to delete by accident.\n\n```\n1. In File Explorer, find   register_vscode_session_in_desktop.ps1\n2. Hold SHIFT, right-click it  →  \"Copy as path\"\n3. The full path is now on your clipboard, e.g.:\n   \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\"\n```\n\nAlmost everyone trips on this at first — including the person who *built* this tool. There are **three completely different folders** in play, and they are NOT the same thing:\n\n```\n①  THE SCRIPT (the tool)        ←  a .ps1 file. Just a helper program. Lives ANYWHERE.\n       C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\n\n②  YOUR PROJECT FOLDER          ←  where YOUR code/work lives. The folder you open in VS Code.\n       C:\\Users\\Alex\\Documents\\my-website\n\n③  CLAUDE'S SESSIONS FOLDER     ←  Claude's OWN private storage. You NEVER point at this.\n       C:\\Users\\Alex\\.claude\\projects\\...\n```\n\n👉 **Folder ② — your project folder** (the one you open in VS Code).\n🚫 **NOT folder ③** (`.claude\\projects\\...`\n\n).\n\nWhy? The `-ProjectPath`\n\npart is asking **\"which project's chats do you want?\"** — and you name a project by **where its code lives** (its human name, like `...\\my-website`\n\n). The script then quietly translates that into folder ③ for you. **You never type folder ③ yourself.**\n\n```\nYOU type:        -ProjectPath \"C:\\Users\\Alex\\Documents\\my-website\"        ← folder ② (your code)\nSCRIPT figures:  → look inside C:\\Users\\Alex\\.claude\\projects\\c--Users-...-my-website\\   ← folder ③\n                   (it does this itself — not your job)\n```\n\n**No.** Here's the key idea:\n\nThe\n\n`.ps1`\n\nfile isNOT part of Claude.It's a small helper program. It has nothing to do with Claude's internal machinery, so it doesnotbelong in`.claude`\n\n.\n\n```\n.claude\\  =  Claude's house. Claude's own stuff (sessions, settings, memory).\n              ── you don't store your own tools inside someone else's house ──\n\nthe .ps1  =  YOUR screwdriver. A tool. It can sit in ANY drawer you like —\n              Desktop, a Tools\\ folder, anywhere. It works exactly the same.\n```\n\nThe script's **location doesn't matter at all.** What matters is that your command **points at it** with the `-File \"...\"`\n\npart:\n\n```\n-File \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\"\n       └─────────── \"hey PowerShell, run THIS tool — it's right here\" ───────────┘\n```\n\nMove the `.ps1`\n\nto `C:\\Tools\\`\n\n? Then just change that to `-File \"C:\\Tools\\register_vscode_session_in_desktop.ps1\"`\n\nand it still runs fine.\n\n```\nRUN this tool ①  ──  to bookmark the chats of this project ②  ──  into the desktop app.\n   (-File \"...ps1\")        (-ProjectPath \"...your code folder\")\n\nFolder ③ (.claude) = Claude's private storage. The tool reads it FOR you. You never name it.\n① SCRIPT PATH   = where you saved register_vscode_session_in_desktop.ps1   (copied just above)\n② PROJECT PATH  = the folder you open in VS Code for that chat\n```\n\n**To copy the PROJECT PATH:** in VS Code, right-click the top folder in the Explorer sidebar → **\"Copy Path\"**.\n(Or in File Explorer, Shift+right-click the folder → **\"Copy as path\"**.)\n\n```\n1. Open PowerShell:  in VS Code click  Terminal → New Terminal\n                     (or press the Windows key, type \"PowerShell\", press Enter)\n2. Paste a recipe below — with YOUR two paths filled in\n3. Press Enter\n```\n\n💡\n\nGolden habit:run itwithout`-Apply`\n\nfirst — that's apreviewand writes nothing. Happy with what it lists? Add`-Apply`\n\nand run again to actually write the cards.\n\n**👇 Every recipe below uses this ONE concrete example. Just swap in your own two paths.**\n\n```\nExample SCRIPT PATH :  C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\nExample PROJECT PATH:  C:\\Users\\Alex\\Documents\\my-website\n```\n\nPlain English: \"Look at my-website's chats and add a card for any that doesn't have one yet.\"\n\n```\npowershell -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\" -ProjectPath \"C:\\Users\\Alex\\Documents\\my-website\" -Apply\n```\n\nPlain English: \"Show me what you WOULD add, but don't touch anything yet.\"\n\n```\npowershell -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\" -ProjectPath \"C:\\Users\\Alex\\Documents\\my-website\"\n```\n\nPlain English: \"I only want this single chat in the desktop app, not all of them.\"\n\n**Step 1 — find the chat's id:**\n\n```\n1. Open File Explorer and go to:   C:\\Users\\<you>\\.claude\\projects\\\n2. Open the \"drawer\" for your project. Its name is your PROJECT PATH with every\n   space and symbol turned into a dash. So:\n      C:\\Users\\Alex\\Documents\\my-website   →   c--Users-Alex-Documents-my-website\n3. Inside, each chat is a file named  <session-id>.jsonl . The filename IS the id:\n      41c938f1-e81e-4d13-ad39-bde9636a51c0.jsonl\n       └──────────────── this is the id ───────────────┘\n```\n\n**Step 2 — run it (paste the id after -SessionId):**\n\n```\npowershell -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\" -SessionId 41c938f1-e81e-4d13-ad39-bde9636a51c0 -Apply\n```\n\nPlain English: \"Sweep all my projects at once.\" Note: no`-ProjectPath`\n\nhere —`-AllProjects`\n\ntakes its place.\n\n```\npowershell -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\Alex\\Tools\\claude-code-session-bridge\\register_vscode_session_in_desktop.ps1\" -AllProjects -Apply\npowershell -NoProfile -ExecutionPolicy Bypass -File \"‹SCRIPT PATH›\" -ProjectPath \"‹PROJECT PATH›\" -Apply\n                                                      └─ paste path ①      └─ paste path ②\n```\n\n**After running with -Apply, fully QUIT and RE-OPEN the desktop app.**\nThe sidebar reads index cards\n\n**only when it starts up**— new cards won't appear until you restart. (Quit properly: right-click the Claude icon in the Windows tray, bottom-right near the clock →\n\n**Quit**. Just closing the window may not be enough.)\n\n```\n\"... cannot be loaded because running scripts is disabled ...\"\n   → You forgot the  -ExecutionPolicy Bypass  part. Copy the WHOLE recipe line; it's already in there.\n\n\"No cabinet drawer for: C:\\...\\your-folder\"\n   → That PROJECT PATH has no Claude Code chats yet, OR the path is slightly wrong.\n     Fix: make sure you copied the EXACT folder you open in VS Code (Explorer → right-click top\n     folder → \"Copy Path\"). Run Recipe B (preview) first to check before using -Apply.\nWROTE  41c938f1   [Jun 19] read the project_log...    ← a new card was written\nWOULD  9f089261   [Jun 13] hey help me find...        ← preview only (you left off -Apply)\nResult: 1 new sticky-note(s), 4 already registered (skipped).\n                  └ added this run       └ already had cards, left untouched\n```\n\n| Flag | Meaning |\n|---|---|\n(none) |\nDry run — lists what it would do, writes nothing. |\n`-Apply` |\nActually write the card file(s). |\n`-ProjectPath \"<path>\"` |\nThe folder you opened in VS Code (default: current folder). |\n`-SessionId <id>` |\nDo just one chat, by its id. |\n`-AllProjects` |\nEvery project folder under `~/.claude/projects` , not just one. |\n\nHere's the part that surprises people: **there is nothing to \"sync.\"** Your messages already live in **one shared notebook**. No copying, no uploading. The only trick is **each app re-reads the notebook when you OPEN the chat** — so \"syncing\" just means *open the chat in the other app.*\n\n```\n   DESKTOP  ──you type, Claude replies──►  the shared notebook grows\n      │\n      │   ① STOP (let the reply finish)\n      ▼\n   VS CODE  ──open the SAME folder → /resume → pick the chat──►\n            it re-reads the notebook → your desktop messages are right there\n      │\n      │   ② type, Claude replies → notebook grows again, then STOP\n      ▼\n   DESKTOP  ──re-open the chat from the sidebar──►\n            re-reads → your VS Code messages appear\n🔴 THE ONE GOLDEN RULE\n   Only ONE app \"live\" on a chat at a time.\n   Finish your turn → STOP → switch → open/resume → continue.\n   Never type in both at the same second (both would scribble in the same\n   notebook at once and could smear a line).\n   When you return to an app, OPEN THE CHAT FRESH so it re-reads from disk —\n   don't trust a tab you left sitting open; it may still show the old page.\n1. Go to:  C:\\Users\\<you>\\AppData\\Roaming\\Claude\\claude-code-sessions\\<guid>\\<guid>\\\n2. Find:   local_<that-session-id>.json\n3. Delete it.\n4. Restart the desktop app → the chat is gone from the sidebar.\n```\n\n**index card**. Your actual chat (the notebook `.jsonl`\n\n) is **never touched** and stays safe.\n\nClaude Code files each chat under a folder name made from the chat's working directory, where **every character that isn't a letter or number becomes a dash -**:\n\n```\nC:\\Users\\Me\\Music\\my project\n        │   (every space / symbol → dash)\n        ▼\nc--Users-Me-Music-my-project        ← the \"drawer\" inside  ~/.claude/projects\\\n```\n\nThat's why the **exact** folder matters: a parent folder, a subfolder, or a renamed folder becomes a *different* drawer — and therefore a different list of chats.\n\n**Windows only**(it uses Windows paths + PowerShell). Pull requests for macOS/Linux desktop paths are very welcome.** The title is a best guess**from the chat's first message — rename it inside the app if you like.- The card stamps\n**default settings**(model, effort, no MCP tools). When you open the chat, the** notebook is the source of truth**; the card's settings are just defaults for the listing. - Tested against the Claude Code desktop app's card format as of\n**mid-2026**. If the desktop app changes that format later, the script may need a small update. **Community tool, not affiliated with Anthropic.**\n\n**MIT** — see [LICENSE](/budhasantosh010/claude-code-session-bridge/blob/main/LICENSE). Use it, fork it, share it, ship it.", "url": "https://wpnews.pro/news/how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app", "canonical_source": "https://github.com/budhasantosh010/claude-code-session-bridge", "published_at": "2026-06-20 11:16:37+00:00", "updated_at": "2026-06-20 11:37:15.397086+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models"], "entities": ["Claude Code", "VS Code", "Claude", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app", "markdown": "https://wpnews.pro/news/how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app.md", "text": "https://wpnews.pro/news/how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app.txt", "jsonld": "https://wpnews.pro/news/how-to-sync-messages-of-claude-code-extension-in-vs-code-and-claude-code-app.jsonld"}}