Resume a Claude Cowork conversation in Claude Code.
Claude Cowork ("local agent mode") locks the model for the life of a session. cowork2code
moves an existing Cowork conversation into Claude Code — where the model is just a runtime
flag — so you pick up the exact same thread on whatever model you want.
A Cowork session is a whole working environment, not just a chat log. cowork2code carries
all of it into Claude Code:
- The full conversation — re-homed as a native Claude Code session you resume with
claude --resumeand continue on any model. - Every working file — the session's
outputs/andmemory/are copied into your target directory. - The MCP servers — written to a ready-to-use
.mcp.jsonin the target directory, so Claude Code reconnects them automatically. - Skills, plugins, and slash commands — these are not per-session files: they live in
your global
~/.claude/skillsand~/.claude/plugins, which Claude Cowork and Claude Code on the same machine already share. So they're available the moment you resume — nothing to migrate.cowork2coderecords which the session had enabled inCOWORK_SESSION.mdfor reference.
The original Cowork session is never modified — the source is read-only.
A Cowork session already stores its conversation as a standard Claude Code transcript inside
a sandboxed home. cowork2code does not translate any format — it re-homes that transcript
into a real working directory, rewrites the recorded paths, brings the rest of the
environment along, and hands you the claude --resume command.
Claude Cowork session (sandboxed) Claude Code (your home)
--------------------------------- -----------------------
local_<id>/
.claude/projects/<dir>/<id>.jsonl --re-home--> ~/.claude/projects/<escaped-cwd>/<id>.jsonl
outputs/ --copy-----> <target>/
memory/ --copy-----> <target>/memory/
local_<id>.json (config) --MCP------> <target>/.mcp.json
--notes----> <target>/COWORK_SESSION.md
The CLI, one line:
$ uv tool install git+https://github.com/looptech-ai/cowork2codeThat puts the cowork2code command on your PATH. (pipx install git+https://github.com/looptech-ai/cowork2code
works too.) Once it's published to PyPI this shortens to uv tool install cowork2code.
CLI + MCP server (so an agent can drive the migration for you):
$ git clone https://github.com/looptech-ai/cowork2code.git
$ cd cowork2code && ./install.shinstall.sh installs the CLI and registers the local MCP server with Claude Code. After a
one-line CLI install you can register the MCP yourself with
claude mcp add cowork2code -- cowork2code-mcp.
Requirements: python3 >= 3.10 (the CLI core is standard-library only) and, for the MCP
server, uv — which resolves the single mcp dependency on
demand, with no global install.
$ cowork2code list
2026-06-12 09:41 claude-haiku-4-5-20251001 Research: emerging LLM productivity trends id=local_e51809de-...
2026-06-11 16:02 claude-sonnet-4-6 Draft quarterly board update id=local_7a2c91b4-...
2026-06-10 08:55 claude-opus-4-8[1m] Refactor ingestion pipeline id=local_3c4d77af-...Add --all to include archived sessions, or --json for machine-readable output.
$ cowork2code rehome --title "emerging" --into ~/dev/llm-trends-resume
Session: Research: emerging LLM productivity trends (claude-haiku-4-5-20251001 -> opus-4-8[1m])
Target cwd: /Users/you/dev/llm-trends-resume
Transcript: /Users/you/.claude/projects/-Users-you-dev-llm-trends-resume/a1803cbc-....jsonl
Copied 3 file(s); notes: /Users/you/dev/llm-trends-resume/COWORK_SESSION.md
MCP servers -> /Users/you/dev/llm-trends-resume/.mcp.json
cd /Users/you/dev/llm-trends-resume && claude --resume a1803cbc-... --model 'opus-4-8[1m]'Run the printed command and your conversation continues on the new model:
$ cd ~/dev/llm-trends-resume && claude --resume a1803cbc-... --model 'opus-4-8[1m]'
# ... the full prior conversation loads; /model confirms opus-4-8[1m]# Resume in the directory the conversation originated from (no --into):
$ cowork2code rehome --id a1803cbc-... --original
# Preview without writing anything:
$ cowork2code rehome --title "emerging" --into ~/tmp/x --dry-run
# Re-home and launch Claude Code immediately on a chosen model:
$ cowork2code rehome --title "emerging" --into ~/tmp/x --model opus-4-8 --launch
# Point at a specific session folder instead of searching:
$ cowork2code rehome --from "~/Library/Application Support/Claude/local-agent-mode-sessions/<acct>/<wks>/local_<id>" --into ~/tmp/xSelectors (--title, --id, --from) are mutually exclusive, and so are the targets
(--into, --original); supply exactly one of each. The default launch model is
opus-4-8[1m]. If a title is ambiguous, the tool lists the matches and exits so you can
refine the selector or use --id.
After install.sh, Claude Code exposes a cowork2code MCP server with two tools:
| Tool | Purpose |
|---|---|
cowork_session_list |
List local Cowork sessions (title, model, ids, transcript path). |
cowork_session_rehome |
Re-home a session and return the resume command. |
You can then ask Claude Code, in plain language, to find a Cowork session and migrate it — the agent calls these tools and reports back the resume command.
Note: the MCP server runs on the host and needs filesystem access to
~/Library/Application Support/Claude/.... The intended driver is Claude Code running on your machine. Claude Cowork itself is sandboxed and may not be able to read that directory, so registering this server inside Cowork may not work even though registering it in Claude Code does.
cowork2code switch-model creates a new Cowork session that continues an existing
conversation on a different model — so you can keep working in Cowork instead of moving to
Claude Code.
$ cowork2code switch-model --title "emerging" --to-model claude-sonnet-4-6
New Cowork session: Research: emerging LLM trends (→ claude-sonnet-4-6) (claude-haiku-4-5 -> claude-sonnet-4-6)
Session id: local_…
Quit Cowork fully (Cmd+Q) and relaunch to see it on the new model.
Cleanup: rm -rf "…/local_…" "…/local_….json"This authors a session in Cowork's local storage (your own machine, your own data) and is experimental and unsupported: Cowork's on-disk format is undocumented and may change across updates. The original session is never modified, every run prints a one-line cleanup, and the new session's config and audit log are written with owner-only permissions. Rendering the conversation on the new model is reliable; whether the next turn retains full prior context depends on Cowork internals — verify before relying on it.
- The session's
outputs/andmemory/files. .mcp.json— the session's remote MCP servers, ready for Claude Code to reconnect (never overwrites an existing.mcp.json).COWORK_SESSION.md— notes describing the original session (model, system prompt, MCP servers, slash commands, initial message). Informational; not auto-applied.cowork-session-config.json— the raw original session configuration.
The re-homed transcript lands in ~/.claude/projects/<escaped-target-cwd>/, named for its
session id, so claude --resume <id> loads it from the target directory.
- Source is read-only. Nothing under the Cowork sessions directory is modified, moved, or deleted.
- Project-directory naming follows Claude Code's exact scheme (each non-alphanumeric
byte becomes
-), verified against real~/.claude/projectsdirectories. - No clobbering. If a transcript already exists at the target, the tool stops; use
--new-idto mint a fresh session id or--forceto overwrite. An existing.mcp.jsonis never overwritten. - Symlinks in the session's working files are skipped, not followed.
- Sensitive content. The notes and config sidecars copy the original system prompt and MCP server list. Review them before sharing the target directory.
- Platform. macOS in this release. The sessions root is configurable with
--sessions-root, so other layouts can be added without code changes elsewhere.
$ uv run --no-project --with pytest pytestThe suite is hermetic: it builds a synthetic Cowork sessions root in a temporary directory and never touches your real Claude data.
Project layout:
cowork2code/
paths.py project-directory escaping and path resolution
transcript.py locate, rewrite, and write transcript JSONL
discover.py scan the sessions root and resolve selectors
notes.py render the configuration-notes sidecar
rehome.py plan and execute a re-home (Cowork -> Claude Code)
audit.py build Cowork's audit.jsonl from a transcript
cowork_session.py synthesize a new Cowork session (switch-model)
_fs.py shared file-tree copy helper
cli.py the cowork2code command
mcp_server.py the local MCP server
cowork2code_mcp.py zero-install uv launcher for the MCP server
install.sh install the CLI and register the MCP server
MIT (c) LoopTech.