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

@lovstudio/cc-migrate-session

v0.1.1

Published

Migrate Claude Code sessions when a project folder moves. Rewrites ~/.claude/projects/<slug>/*.jsonl cwd fields and renames the slug directory.

Downloads

233

Readme

@lovstudio/cc-migrate-session

Migrate Claude Code sessions when a project folder moves.

When you mv /old/project /new/project, Claude Code's --resume flag can no longer find your history. That's because CC keys sessions by a path-slug — so the old history is still on disk at ~/.claude/projects/<old-slug>/, but CC looks in <new-slug>/ and finds nothing.

This tool fixes that:

  1. Copies ~/.claude/projects/<old-slug>/<new-slug>/
  2. Rewrites every "cwd" field inside the jsonl lines from /old/project/new/project

After running, cd /new/project && claude --resume shows your full history.

Install / Use

Zero install — just run with npx:

npx -y @lovstudio/cc-migrate-session /old/project /new/project

It will show a preview and ask for confirmation. Add --yes to skip the prompt, or --dry-run to see what it would do without writing.

Options

| Flag | Purpose | |------|---------| | -y, --yes | Skip interactive confirmation | | --dry-run | Print the plan, don't write | | --json | Machine-readable output (used by the CC skill) | | --projects-dir <dir> | Override ~/.claude/projects | | -h, --help | Show help |

Examples

# Interactive
npx -y @lovstudio/cc-migrate-session ~/old-repo ~/new-repo

# Non-interactive, in a script
npx -y @lovstudio/cc-migrate-session ~/old ~/new --yes

# Just tell me what would happen
npx -y @lovstudio/cc-migrate-session /a /b --dry-run

Safety

  • Copy, don't move. The old slug dir is never deleted. If anything goes wrong you still have your history.
  • Malformed jsonl lines are passed through unchanged.
  • Destination merge: if <new-slug>/ already has jsonl files, conflicting names will be overwritten. You'll get a warning.

Verify that claude --resume works from the new dir before running rm -rf ~/.claude/projects/<old-slug>/.

How it works

Claude Code stores each session at:

~/.claude/projects/<slug>/<session-uuid>.jsonl

where <slug> is the project's absolute path with every non-[A-Za-z0-9] character replaced by -:

| Path | Slug | |------|------| | /Users/mark/my-project | -Users-mark-my-project | | /Users/mark/.claude | -Users-mark--claude (the .-) | | /Users/mark/@手工川 | -Users-mark----- (@ plus 3 CJK chars) |

Each jsonl line also embeds "cwd": "<absolute path>". Both the dir name and the per-line cwd must be updated for --resume to pick up the history — this tool does both.

Companion CC skill

The skill/lovstudio-cc-migrate-session/ dir in this repo is a Claude Code skill (lovstudio:cc-migrate-session). Symlink it:

ln -s $(pwd)/skill/lovstudio-cc-migrate-session ~/.claude/skills/lovstudio-cc-migrate-session

Then when you tell Claude "I moved this project to /new/path" or "this project used to be at /old/path", CC will auto-invoke this CLI for you.

License

MIT