重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
session-recovery by terrylica/cc-skills
npx skills add https://github.com/terrylica/cc-skills --skill session-recovery在以下情况下使用此技能:
claude -r 时显示“未找到可恢复的对话”/tmp/ 而非 ~/.claude/projects/)标准位置: ~/.claude/projects/
结构:
~/.claude/projects/
├── -home-username-my-project/ # 编码后的绝对路径
│ └── 364695f1-13e7-4cbb-ad4b-0eb416feb95d.jsonl
└── -tmp-another-project/
└── a8e39846-ceca-421d-b4bd-3ba0eb1b3145.jsonl
格式: 每行一个 JSON 事件(JSONL),基于 UUID 的文件名
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Claude Code 使用 $HOME 环境变量来确定会话存储位置。如果 $HOME 不正确,会话将保存到错误的目录或消失。
claude -r 显示“未找到可恢复的对话”/tmp/ 或其他意外路径中找到会话/usr/bin/env bash << 'PREFLIGHT_EOF'
# 步骤 1:检查当前 HOME
echo "Current HOME: $HOME"
# 步骤 2:检查系统预期值
echo "Expected HOME: $(getent passwd $(whoami) | cut -d: -f6)"
# 步骤 3:查找 Claude 实际写入的位置
find /tmp -name "*.jsonl" -path "*/.claude/projects/*" 2>/dev/null
PREFLIGHT_EOF
有关详细的诊断步骤和解决方案,请参阅:
| 问题 | 原因 | 解决方案 |
|---|---|---|
| “未找到对话” | HOME 变量错误 | 验证 $HOME 是否与预期的用户目录匹配 |
| 会话在 /tmp/ 中 | HOME 设置不正确 | 在 shell 配置文件中修复 HOME,重启终端 |
| 会话文件丢失 | 磁盘空间或权限问题 | 检查 ~/.claude/projects/ 的权限和磁盘空间 |
| 显示错误的项目会话 | 路径编码不匹配 | 检查编码路径是否与当前工作目录匹配 |
| 会话未持久化 | 文件系统问题 | 验证对 ~/.claude/projects/ 的写入权限 |
| IDE 会话独立 | 不同环境使用不同的 HOME | 确保终端和 IDE 的 HOME 一致 |
| 遗留会话不可见 | 迁移未完成 | 参阅 TROUBLESHOOTING.md 中的迁移部分 |
| UUID 文件名损坏 | 写入不完整 | 检查部分 .jsonl 文件,删除损坏的文件 |
每周安装次数
63
代码仓库
GitHub 星标数
22
首次出现时间
2026 年 1 月 24 日
安全审计
安装于
opencode59
claude-code58
gemini-cli58
codex57
github-copilot56
cursor55
Use this skill when:
claude -r/tmp/ instead of ~/.claude/projects/)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
Claude Code uses $HOME environment variable to determine session storage location. If $HOME is incorrect, sessions go to wrong directory or disappear.
claude -r shows "No conversations found to resume"/tmp/ or other unexpected paths/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
For detailed diagnostic steps and solutions, see:
| Issue | Cause | Solution |
|---|---|---|
| "No conversations found" | Wrong HOME variable | Verify $HOME matches expected user directory |
| Sessions in /tmp/ | HOME set incorrectly | Fix HOME in shell profile, restart terminal |
| Session files missing | Disk space or permissions | Check ~/.claude/projects/ permissions and disk |
| Wrong project sessions shown | Path encoding mismatch | Check encoded path matches current working directory |
| Sessions not persisting | File system issues | Verify write permissions to ~/.claude/projects/ |
| IDE sessions separate | Different HOME per environment |
Weekly Installs
63
Repository
GitHub Stars
22
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode59
claude-code58
gemini-cli58
codex57
github-copilot56
cursor55
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
127,000 周安装
| Ensure consistent HOME across terminal and IDE |
| Legacy sessions not visible | Migration not complete | See migration section in TROUBLESHOOTING.md |
| UUID filename corruption | Incomplete writes | Check for partial .jsonl files, remove corrupt ones |