npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-web-to-cowork

v1.2.0

Published

Import Claude web-exported conversations into Cowork (Claude Desktop) local sessions

Readme

claude-web-to-cowork

English | 中文


English

Import Claude web-exported conversations into Cowork (Claude Desktop) local sessions.

If you've exported your Claude.ai conversation history and want to browse them inside Claude Desktop's Cowork sidebar, this tool converts the web export JSON format into Cowork's local session format.

⚠️ Disclaimer

This is an unofficial, community-maintained tool. The Cowork session format is not publicly documented — it was reverse-engineered through observation. Format mismatches could cause Claude Desktop to behave unexpectedly. Always back up before importing.

Quick Start

# Install
npm install -g claude-web-to-cowork

# Diagnose your environment
cwtc doctor

# Back up existing sessions FIRST
cwtc backup

# List available conversations
cwtc list ./conversations.json

# Import a single conversation (by index)
cwtc import 0 ./conversations.json

# Or import everything
cwtc import-all ./conversations.json

# Restart Claude Desktop to see imported sessions

Commands

| Command | Description | |---------|-------------| | cwtc list <file> | List all conversations in the export file | | cwtc search <keyword> <file> | Search conversations by title/summary | | cwtc info <index\|uuid> <file> | Show conversation details | | cwtc import <index\|uuid> <file> | Import a single conversation | | cwtc import-all <file> | Import all conversations | | cwtc imported | List already-imported sessions | | cwtc remove <sessionId> | Remove an imported session | | cwtc backup | Back up current Cowork sessions | | cwtc import-memories <file> <dir> | Import memories into project memory directory | | cwtc doctor | Diagnose environment |

How to Export from Claude Web

  1. Go to Claude.ai → Settings → Privacy → Export data
  2. Download the export archive
  3. Extract conversations.json from the archive
  4. Use it with this tool: cwtc list ./conversations.json

Supported Platforms

  • Windows: %LOCALAPPDATA%\Claude-3p\local-agent-mode-sessions\
  • macOS: ~/Library/Application Support/Claude/local-agent-mode-sessions/

How It Works

The tool converts Claude's web export format (a JSON array of conversation objects with chat_messages containing interleaved text, thinking, tool_use, and tool_result blocks) into Cowork's local session format:

local-agent-mode-sessions/{orgId}/00000000/
  {sessionId}.json                  ← session metadata
  {sessionId}/
    .audit-key                      ← audit signing key
    audit.jsonl                     ← audit log
    .claude/
      .claude.json                  ← Claude config
      projects/{encoded-cwd}/
        {cliSessionId}.jsonl        ← conversation data (what Cowork reads)

Known Limitations

  • HMAC signatures: The audit log uses best-effort HMAC-SHA256. The exact algorithm used by Cowork is not publicly documented. This has not caused loading issues in testing.
  • Attachments/Files: File attachments from web conversations are referenced but not imported (the actual file data is not included in the JSON export).
  • macOS path: The macOS Cowork path is based on community reports and may differ by installation method.

API Usage

const { detectCoworkPaths, findTargetDir, convertConversation, writeSession } = require('claude-web-to-cowork');

const paths = detectCoworkPaths();
const target = findTargetDir(paths.sessionsDir);

const result = convertConversation(webConv, {
    sessionsDir: paths.sessionsDir,
    orgId: target.orgId,
});
writeSession(result);

Building Standalone Binaries

npm run build:win      # Windows .exe
npm run build:mac      # macOS Intel
npm run build:mac-arm  # macOS Apple Silicon
npm run build:all      # All platforms

中文

将 Claude 网页端导出的对话 JSON 导入为 Cowork(Claude Desktop)本地会话。

如果你导出了 claude.ai 上的对话历史,并希望在 Claude Desktop 的 Cowork 侧边栏中浏览它们,这个工具可以将网页导出格式转换为 Cowork 的本地会话格式。

⚠️ 免责声明

这是一个非官方、社区维护的工具。Cowork 会话格式未公开发布文档——它是通过逆向工程观察得出的。格式不匹配可能导致 Claude Desktop 出现异常行为。导入前务必备份。

快速开始

npm install -g claude-web-to-cowork
cwtc doctor          # 诊断环境
cwtc backup          # 先备份!
cwtc list ./conversations.json    # 列出会话
cwtc import 0 ./conversations.json # 导入第 0 条
cwtc import-all ./conversations.json # 全部导入
# 退出并重启 Claude Desktop

工作原理

将 Claude Web 导出格式(JSON 数组,每条会话包含 chat_messages,其中 textthinkingtool_usetool_result 块交织在一起)转换为 Cowork 本地会话格式。

支持的平台

  • Windows: %LOCALAPPDATA%\Claude-3p\local-agent-mode-sessions\
  • macOS: ~/Library/Application Support/Claude/local-agent-mode-sessions/

已知限制

  • HMAC 签名:审计日志使用最佳猜测的 HMAC-SHA256。Cowork 的确切算法未公开。测试中未因此导致加载问题。
  • 附件/文件:Web 对话中的文件附件仅保留引用(实际文件数据不在 JSON 导出中)。
  • macOS 路径:基于社区报告,可能因安装方式不同而有所差异。

License

MIT © 2026 chuiyu