关于 cass
CASS 是用于搜索和浏览多个编码 Agent 会话历史的命令行工具。它支持按关键词检索、查看上下文、时间线和导出,适合回顾过去的编码工作。
主要功能
- 01跨 Agent 搜索会话
- 02支持通配符和 Agent 筛选
- 03查看消息及周边上下文
- 04浏览活动时间线与统计
- 05导出 Markdown、HTML 和 JSON
适用场景
- 01查找过去解决类似问题的记录
- 02回顾近期不同 Agent 的工作
- 03深入查看搜索结果中的对话
- 04保存重要会话以供后续参考
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ johnlindquist/ claude --skill cass安装后在 Claude Code 中输入/cass确认已加载。
详细介绍
CASS - 编码 Agent 会话搜索
跨多个 Agent 搜索和探索你的 AI 编码会话历史。
前提条件
安装 cass:
# Install via cargo or download binary
cargo install cass
构建索引:
cass index
命令行参考
搜索会话
# Basic search
cass search "query" --json
# With wildcards
cass search "react*" --json
cass search "*hook*" --json
# Limit results
cass search "query" --limit 20 --json
# Filter by agent
cass search "query" --agent claude --json
cass search "query" --agent codex --json
cass search "query" --agent cursor --json
cass search "query" --agent gemini --json
cass search "query" --agent aider --json
# Filter by workspace/project
cass search "query" --workspace /path/to/project --json
# Filter by time
cass search "query" --days 7 --json
# Output detail levels
cass search "query" --fields minimal --json # paths only
cass search "query" --fields summary --json # default
cass search "query" --fields full --json # everything
# Highlight matches
cass search "query" --highlight --json
检查健康状态
# Verify index is healthy before searching
cass health
构建/重建索引
# Full rebuild
cass index --full
# Watch mode for continuous updates
cass index --watch
查看会话详情
# View specific line from search results (path is positional)
cass view /path/to/session.jsonl -n 42 --json
# With more context lines
cass view /path/to/session.jsonl -n 42 -C 10 --json
展开上下文
# Show surrounding messages around a line (path is positional, -n is required)
cass expand /path/to/session.jsonl --line 42 -C 3 --json
# More context
cass expand /path/to/session.jsonl --line 42 -C 10 --json
活动时间线
# Activity across agents
cass timeline --json
# Last N days (use relative format)
cass timeline --since 7d --json
# Today only
cass timeline --today --json
# By agent
cass timeline --agent claude --json
# Group by hour or day
cass timeline --group-by hour --json
cass timeline --group-by day --json
导出对话
# Export to markdown (path is positional)
cass export /path/to/session.jsonl --format markdown
# Export to HTML
cass export /path/to/session.jsonl --format html -o conversation.html
# Export to JSON
cass export /path/to/session.jsonl --format json
# Include tool calls
cass export /path/to/session.jsonl --include-tools
统计信息
# Index statistics
cass stats --json
功能
# Show supported features and connectors
cass capabilities --json
查找相关会话
# Find sessions related by workspace, day, or agent (path is positional)
cass context /path/to/session.jsonl --json
# Limit per relation type
cass context /path/to/session.jsonl --limit 3 --json
支持的 Agent
claude- Claude Code 会话codex- OpenAI Codex CLIcursor- Cursor IDEgemini- Gemini CLIaider- Aiderchatgpt- ChatGPT(如果已导出)
工作流模式
查找过往解决方案
# Search for how you solved something before
cass search "authentication jwt" --json
cass search "postgres connection pool" --json
cass search "react state management" --json
回顾最近的工作
# What did I work on today?
cass timeline --today --json
# Last week's activity
cass timeline --since 7d --json
深入探究某个会话
# 1. Search for topic
cass search "bug fix login" --json
# 2. Get line number from results, view details
cass view /path/from/results.jsonl -n 123 --json
# 3. Expand context around interesting parts
cass expand /path/from/results.jsonl --line 123 -C 5 --json
# 4. Export full conversation for reference
cass export /path/from/results.jsonl --format markdown -o reference.md
跨 Agent 学习
# How did different agents handle similar problems?
cass search "api design" --agent claude --json
cass search "api design" --agent codex --json
cass search "api design" --agent cursor --json
最佳实践
- 先构建索引 - 搜索前先运行
cass index - 检查健康状态 - 如果搜索没有返回结果,运行
cass health - 使用通配符 - 用
*pattern*进行灵活匹配 - 按 Agent 过滤 - 当你记得自己用过哪个工具时
- 使用时间线 - 用于按时间顺序探索
- 导出有价值的会话 - 将重要对话保存为 markdown
评论
支持 Markdown