Capital One’s Security Agent Tries to Disprove Its Own Findings
Security scanners already produce more credible-looking alerts than most teams can afford to investigate. On July 16, 2026, Capital One released VulnHunter,…
Moving to a new computer or switching from WSL to native Linux? Here's how to preserve all your Claude Code conversation history and make it accessible on your new setup.
After copying your .claude folder to your new computer, you might find that some sessions appear in your history but throw errors when you try to resume them:
No conversation found with session ID: abc123-def456-...
This happens because Claude Code organizes conversation transcripts by project path, and your paths have changed.
Claude Code stores your conversations in a specific directory structure:
~/.claude/
├── history.jsonl # List of all sessions (metadata only)
├── projects/ # Actual conversation transcripts
│ ├── -home-olduser-project-a/
│ │ ├── session-id-1.jsonl
│ │ └── session-id-2.jsonl
│ └── -home-newuser-project-a/
│ └── session-id-3.jsonl
├── session-env/ # Session environment data
├── todos/ # Todo lists per session
└── ...
When you move from one machine to another, your username or project paths might change:
/home/olduser/project-a → ~/.claude/projects/-home-olduser-project-a//home/newuser/project-a → ~/.claude/projects/-home-newuser-project-a/Sessions from your old machine exist in the old path structure, making them invisible to Claude Code on your new machine.
First, check what project directories exist:
ls ~/.claude/projects/
You'll see directories like:
-home-olduser-project-a (from your old computer)-home-newuser-project-a (from your new computer)Copy all session transcripts from old paths to new paths without overwriting existing files:
cd ~/.claude/projects
# For each project, copy old sessions to new location
# The -n flag prevents overwriting existing files
cp -n ./-home-olduser-project-a/*.jsonl ./-home-newuser-project-a/
cp -n ./-home-olduser-project-b/*.jsonl ./-home-newuser-project-b/
cp -n ./-home-olduser-project-c/*.jsonl ./-home-newuser-project-c/
Important: Use the -n flag (or --no-clobber) to preserve any new sessions you've already created on your new computer.
Count sessions before and after:
# Count old sessions
find ~/.claude/projects/-home-olduser-* -name "*.jsonl" -not -name "agent-*" | wc -l
# Count new sessions (should include both old and new)
find ~/.claude/projects/-home-newuser-* -name "*.jsonl" -not -name "agent-*" | wc -l
The second number should be roughly the sum of old sessions + any new sessions you created.
Try resuming one of your old sessions:
claude resume abc123-def456-...
It should now work! 🎉
When moving Claude Code to a new computer:
~/.claude/ directory to new computerIf you have many projects, create a script to automate the migration:
#!/bin/bash
# Map old paths to new paths
declare -A path_mapping
path_mapping["-home-olduser-project-a"]="-home-newuser-project-a"
path_mapping["-home-olduser-project-b"]="-home-newuser-project-b"
path_mapping["-home-olduser-project-c"]="-home-newuser-project-c"
cd ~/.claude/projects
for old_dir in "${!path_mapping[@]}"; do
new_dir="${path_mapping[$old_dir]}"
if [ -d "$old_dir" ]; then
echo "Migrating: $old_dir -> $new_dir"
mkdir -p "$new_dir"
cp -n "$old_dir"/*.jsonl "$new_dir/" 2>/dev/null || true
fi
done
echo "Migration complete!"
Save this as migrate-claude-sessions.sh, make it executable, and run it:
chmod +x migrate-claude-sessions.sh
./migrate-claude-sessions.sh
Moving from Windows WSL to native Linux often changes your username:
/home/ubuntu/projects//home/john/projects/Follow the steps above to copy from -home-ubuntu-* to -home-john-*.
Your old computer used alice, new one uses alice-work:
/home/alice/my-app//home/alice-work/my-app/Copy from -home-alice-my-app/ to -home-alice-work-my-app/.
Instead of copying, you can create symbolic links:
cd ~/.claude/projects
ln -s ./-home-olduser-project-a/* ./-home-newuser-project-a/
However, this may cause issues if you create new sessions, so copying is recommended.
The source directory might not exist. List available directories:
ls -la ~/.claude/projects/
Check if the session file actually exists in the new location:
find ~/.claude/projects -name "your-session-id.jsonl"
If it only appears in the old directory, repeat the copy command for that specific project.
Claude Code creates a directory for every working directory you've used. You might have:
-home-olduser (home directory sessions)-home-olduser-projects-app1-home-olduser-projects-app2Map each one individually to its new counterpart.
Claude Code uses the working directory path as a unique identifier for organizing conversations. This design allows you to:
However, it means that path changes require manual migration of session files.
Once migration is complete, you can optionally:
.claude/projects/ for safekeepingI recommend keeping them for a while until you're certain everything works correctly.
Here's what a typical migration looks like:
Before migration:
-home-olduser-* directories)-home-newuser-* directories)After migration:
All conversation history from both computers is now accessible!
Migrating Claude Code sessions between computers is straightforward once you understand the path-based storage structure. The key is copying session files from old project paths to new ones while preserving any sessions you've already created on the new machine.
With this guide, you can maintain years of valuable Claude Code conversation history across computer migrations, OS changes, or username updates.
Pro tip: Consider backing up your entire ~/.claude/ directory regularly to avoid losing conversation history. It's a treasure trove of problem-solving context and development history!
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com