Agent skill
session-recovery
Troubleshoot Claude Code session issues. Use when encountering "No conversations found" errors, missing sessions, or session file corruption problems.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/session-recovery
SKILL.md
Claude Code Session Recovery Skill
Quick Reference
When to use this skill:
- "No conversations found to resume" when running
claude -r - New conversations not creating session files
- Sessions appearing in wrong locations (
/tmp/instead of~/.claude/projects/) - Session history missing after environment changes
- IDE/terminal settings affecting session creation
- Need to migrate or recover 600+ legacy sessions
Official Session Storage
Standard Location: ~/.claude/projects/
Structure:
~/.claude/projects/
├── -home-username-my-project/ # Encoded absolute path
│ └── 364695f1-13e7-4cbb-ad4b-0eb416feb95d.jsonl
└── -tmp-another-project/
└── a8e39846-ceca-421d-b4bd-3ba0eb1b3145.jsonl
Format: One JSON event per line (JSONL), UUID-based filenames
Critical Pitfall: HOME Variable
Problem
Claude Code uses $HOME environment variable to determine session storage location. If $HOME is incorrect, sessions go to wrong directory or disappear.
Symptoms
claude -rshows "No conversations found to resume"- New conversations work but files don't appear in expected location
- Sessions found in
/tmp/or other unexpected paths - Works on one machine but not another
Diagnosis
/usr/bin/env bash << 'PREFLIGHT_EOF'
# Step 1: Check current HOME
echo "Current HOME: $HOME"
# Step 2: Check system expectation
echo "Expected HOME: $(getent passwd $(whoami) | cut -d: -f6)"
# Step 3: Find where Claude is actually writing
find /tmp -name "*.jsonl" -path "*/.claude/projects/*" 2>/dev/null
PREFLIGHT_EOF
Reference Documentation
For detailed diagnostic steps and solutions, see:
- Troubleshooting Guide - Detailed diagnostic procedures and fixes
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?