常见问题与踩坑记录#
实际使用中遇到的问题和解决方案。
1. uvx 命令不可用#
报错:
uvx: The term 'uvx' is not recognized as a name of a cmdlet, function,
script file, or executable program.解决:
# 安装 uv(PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
# 安装后重启终端
uvx claude-code-transcripts替代方案(不装 uv):
pip install claude-conversation-extractor
claude-extract --list2. PowerShell 与 Bash 命令差异#
| 操作 | Bash(Claude Code 内部) | PowerShell(用户终端) |
|---|---|---|
| 列出文件 | ls -lht | Get-ChildItem | Sort-Object LastWriteTime -Descending |
| 查看文件 | cat file.txt | Get-Content file.txt |
| 搜索文本 | grep "keyword" file | Select-String "keyword" file |
| 打开文件 | open file.html | start file.html |
| 环境变量 | echo $HOME | echo $env:USERPROFILE |
3. 交互式界面操作错误#
claude-search 搜索后无法导出#
搜索结果界面的操作选项:
| 选项 | 说明 |
|---|---|
V | 查看某个会话(不导出文件,只在终端显示) |
E | 导出所有搜索结果到默认目录 |
Q | 退出 |
注意:选择
V后需要输入编号(如5),不能直接输入会话 ID。推荐使用命令行方式导出。
4. ai-code-sessions 与 claude-code-transcripts 导出结果一样#
ai-code-sessions 是 claude-code-transcripts 的 fork,基础的 local 和 all 命令确实输出相同的 HTML。区别在于额外功能:ctx、ctx-resume、archive、changelog 等。
5. ai-code-sessions config 直接运行报错#
# ✅ 正确用法
uvx ai-code-sessions config show
# ❌ 不能直接运行
uvx ai-code-sessions config6. 导出时部分会话被跳过#
某些会话可能只包含系统消息或命令输出,没有实际的用户/助手对话内容,这是正常行为。
7. 默认输出目录#
| 工具/命令 | 默认输出位置 |
|---|---|
claude-extract(交互式) | C:\Users\<用户名>\Desktop\Claude logs |
claude-extract --output | 自定义位置 |
claude-code-transcripts all | ./claude-archive |
ai-code-sessions all | 必须指定 -o 参数 |
ai-code-sessions archive | <project_root>/.ais-archive |