claude-code-history-files-finder by daymade/claude-code-skills
npx skills add https://github.com/daymade/claude-code-skills --skill claude-code-history-files-finder从存储在 ~/.claude/projects/ 中的 Claude Code 会话历史文件中提取和恢复内容。
会话文件存储在 ~/.claude/projects/<normalized-path>/<session-id>.jsonl。
关于 JSONL 结构和提取模式的详细信息,请参阅 references/session_file_format.md。
查找特定项目的所有会话文件:
python3 scripts/analyze_sessions.py list /path/to/project
显示最近的会话,包括时间戳和大小。
可选:--limit N 仅显示 N 个会话(默认值:10)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
定位包含特定内容的会话:
python3 scripts/analyze_sessions.py search /path/to/project keyword1 keyword2
返回按关键词频率排序的会话,包含:
可选:--case-sensitive 进行精确匹配。
从会话历史中提取文件:
python3 scripts/recover_content.py /path/to/session.jsonl
提取所有 Write 工具调用,并将文件保存到 ./recovered_content/。
按关键词过滤:
python3 scripts/recover_content.py session.jsonl -k ModelLoading FRONTEND deleted
仅恢复路径匹配任何关键词的文件。
自定义输出目录:
python3 scripts/recover_content.py session.jsonl -o ./my_recovery/
获取详细的会话指标:
python3 scripts/analyze_sessions.py stats /path/to/session.jsonl
报告内容:
可选:--show-files 列出所有文件操作。
关于文件恢复、跟踪文件演变和批量操作等详细工作流示例,请参阅 references/workflow_examples.md。
recover_content.py 自动仅保留每个文件的最新版本。如果一个文件在会话中被多次写入,则只保存最终版本。
选择出现在以下位置的独特关键词:
创建描述性的输出目录:
# 不佳
python3 scripts/recover_content.py session.jsonl -o ./output/
# 良好
python3 scripts/recover_content.py session.jsonl -o ./recovered_deleted_docs/
python3 scripts/recover_content.py session.jsonl -o ./feature_xy_history/
恢复后,务必验证内容:
# 检查文件列表
ls -lh ./recovered_content/
# 阅读恢复报告
cat ./recovered_content/recovery_report.txt
# 抽查内容
head -20 ./recovered_content/ImportantFile.jsx
✅ 使用 Write 工具写入的文件 ✅ 在 markdown 代码块中显示的代码(部分提取) ✅ Edit/Read 操作中的文件路径
❌ 从未写入磁盘的文件(仅讨论过) ❌ 在会话开始前已删除的文件 ❌ 二进制文件(图像、PDF)- 仅路径可用 ❌ 未在会话中捕获的外部工具输出
# 验证项目路径规范化
ls ~/.claude/projects/ | grep -i "project-name"
# 检查实际项目目录
ls -la ~/.claude/projects/
可能的原因:
解决方案:
--show-edits 标志查看 Edit 操作对于大于 100MB 的会话:
会话文件可能包含:
共享前务必清理:
# 移除绝对路径
sed -i '' 's|/Users/[^/]*/|/Users/username/|g' file.js
# 验证没有凭据
grep -i "api_key\|password\|token" recovered_content/*
恢复的内容继承了原始会话的敏感性。请安全存储,并遵循组织处理会话数据的政策。
每周安装量
102
代码仓库
GitHub 星标数
636
首次出现
2026年1月20日
安全审计
安装于
claude-code86
opencode78
codex70
gemini-cli68
cursor64
github-copilot62
Extract and recover content from Claude Code's session history files stored in ~/.claude/projects/.
Session files are stored at ~/.claude/projects/<normalized-path>/<session-id>.jsonl.
For detailed JSONL structure and extraction patterns, see references/session_file_format.md.
Find all session files for a specific project:
python3 scripts/analyze_sessions.py list /path/to/project
Shows most recent sessions with timestamps and sizes.
Optional: --limit N to show only N sessions (default: 10).
Locate sessions containing specific content:
python3 scripts/analyze_sessions.py search /path/to/project keyword1 keyword2
Returns sessions ranked by keyword frequency with:
Optional: --case-sensitive for exact matching.
Extract files from session history:
python3 scripts/recover_content.py /path/to/session.jsonl
Extracts all Write tool calls and saves files to ./recovered_content/.
Filtering by keywords :
python3 scripts/recover_content.py session.jsonl -k ModelLoading FRONTEND deleted
Recovers only files matching any keyword in their path.
Custom output directory :
python3 scripts/recover_content.py session.jsonl -o ./my_recovery/
Get detailed session metrics:
python3 scripts/analyze_sessions.py stats /path/to/session.jsonl
Reports:
Optional: --show-files to list all file operations.
For detailed workflow examples including file recovery, tracking file evolution, and batch operations, see references/workflow_examples.md.
recover_content.py automatically keeps only the latest version of each file. If a file was written multiple times in a session, only the final version is saved.
Choose distinctive keywords that appear in:
Create descriptive output directories:
# Bad
python3 scripts/recover_content.py session.jsonl -o ./output/
# Good
python3 scripts/recover_content.py session.jsonl -o ./recovered_deleted_docs/
python3 scripts/recover_content.py session.jsonl -o ./feature_xy_history/
After recovery, always verify content:
# Check file list
ls -lh ./recovered_content/
# Read recovery report
cat ./recovered_content/recovery_report.txt
# Spot-check content
head -20 ./recovered_content/ImportantFile.jsx
✅ Files written using Write tool ✅ Code shown in markdown blocks (partial extraction) ✅ File paths from Edit/Read operations
❌ Files never written to disk (only discussed) ❌ Files deleted before session start ❌ Binary files (images, PDFs) - only paths available ❌ External tool outputs not captured in session
# Verify project path normalization
ls ~/.claude/projects/ | grep -i "project-name"
# Check actual projects directory
ls -la ~/.claude/projects/
Possible causes:
Solutions:
--show-edits flag to see Edit operationsFor sessions >100MB:
Session files may contain:
Always sanitize before sharing:
# Remove absolute paths
sed -i '' 's|/Users/[^/]*/|/Users/username/|g' file.js
# Verify no credentials
grep -i "api_key\|password\|token" recovered_content/*
Recovered content inherits sensitivity from original sessions. Store securely and follow organizational policies for handling session data.
Weekly Installs
102
Repository
GitHub Stars
636
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
claude-code86
opencode78
codex70
gemini-cli68
cursor64
github-copilot62
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
150,000 周安装