Claude Code 目录清理报告#
清理日期: 2026-02-18
清理路径: C:\Users\AI-Olne\.claude\
执行者: Claude Code
一、清理前空间分析#
目录大小排名#
| 目录 | 大小 | 说明 |
|---|
| projects/ | 377M | 项目数据(包含大量失败事件日志) |
| downloads/ | 222M | 下载文件(旧版安装包) |
| plugins/ | 150M | 插件缓存 |
| telemetry/ | 141M | 遥测数据(大量失败事件) |
| transcripts/ | 57M | 会话记录(810个文件) |
| skills/ | 23M | 技能文件 |
| file-history/ | 16M | 文件修改历史 |
总计: 约 1GB
二、清理操作#
已清理项目#
| 项目 | 释放空间 | 说明 |
|---|
| ✅ telemetry/ | ~141M | 遥测数据,无风险 |
| ✅ downloads/claude-2.1.9-win32-x64.exe | ~222M | 旧版安装包 |
| ✅ transcripts/ (7天前) | ~1.6M | 317个旧会话记录 |
| ✅ file-history/ (7天前) | ~8M | 453个旧文件历史 |
| ✅ projects/ 失败事件日志 | 大量 | 1p_failed_events*.json |
| ✅ projects/ tool-results | ~70M | 工具执行结果缓存 |
| ✅ projects/ 7天前会话 | 大量 | 旧项目会话记录 |
| ✅ settings.json.bak_* | ~15K | 配置备份文件 |
| ✅ settings - 副本.md | ~1K | 副本文件 |
保留项目#
| 项目 | 原因 |
|---|
| CLAUDE.md | 用户配置指令 |
| settings.json | 当前设置 |
| config.json | 配置文件 |
| .credentials.json | 认证凭据 |
| agents/ | 自定义代理定义 |
| commands/ | 自定义命令 |
| skills/ | 技能定义 |
| plugins/ | 插件(保留) |
| hooks/ | 钩子配置 |
| history.jsonl | 命令历史 |
| stats-cache.json | 统计缓存 |
三、清理后结果#
目录大小对比#
| 目录 | 清理前 | 清理后 |
|---|
| projects/ | 377M | 163M |
| downloads/ | 222M | 0 |
| telemetry/ | 141M | 0 |
| transcripts/ | 57M | 23M |
| file-history/ | 16M | 8M |
| 总计 | ~1GB | 369M |
释放空间: 约 600M+
四、清理后目录结构#
~/.claude/
├── CLAUDE.md # 用户配置 (保留)
├── settings.json # 设置文件 (保留)
├── config.json # 配置文件 (保留)
├── .credentials.json # 认证凭据 (保留)
├── history.jsonl # 命令历史 (保留)
├── stats-cache.json # 统计缓存 (保留)
├── agents/ # 自定义代理 (保留)
├── commands/ # 自定义命令 (保留)
├── skills/ # 技能文件 (保留)
├── plugins/ # 插件 (保留)
├── hooks/ # 钩子 (保留)
├── projects/ # 项目数据 (已清理旧数据)
├── transcripts/ # 会话记录 (仅保留本周)
├── file-history/ # 文件历史 (仅保留本周)
├── debug/ # 调试日志 (已重置)
├── telemetry/ # 遥测数据 (已清空)
└── downloads/ # 下载目录 (已清空)
五、维护建议#
定期清理计划#
| 项目 | 建议频率 | 保留策略 |
|---|
| debug/ | 每周 | 保留最近7天 |
| transcripts/ | 每周 | 保留最近7天 |
| file-history/ | 每周 | 保留最近7天 |
| telemetry/ | 每月 | 可全部清理 |
| projects/tool-results | 每周 | 可全部清理 |
清理命令参考#
# 清理7天前的会话记录
find ~/.claude/transcripts/ -name "*.jsonl" -mtime +7 -delete
# 清理7天前的文件历史
find ~/.claude/file-history/ -type f -mtime +7 -delete
# 清理遥测数据
find ~/.claude/telemetry/ -type f -delete
# 清理 debug 日志
find ~/.claude/debug/ -name "*.txt" -delete
# 清理 tool-results
find ~/.claude/projects/ -type d -name "tool-results" -exec rm -rf {} \;
报告生成时间: 2026-02-18 19:30
执行者: Claude Code (claude-opus-4-5-think)