| name | cass |
| description | Searches, indexes, and exports Claude Code sessions using the cass CLI (Coding Agent Session Search), and optionally runs the cass-memory (cm) reflection pipeline to distill sessions into persistent playbook rules. Use when the user wants to install cass or cass-memory, find past sessions, search conversation history, look up prior work on a topic, export a session to markdown, discover related sessions for a file, check session activity timelines, or reflect on past sessions to build procedural memory. Triggers on: "search my sessions", "find past work on X", "export session", "look in my history", "what sessions do I have about", "find related sessions", "when did I work on", "install cass", "setup cass-memory", "reflect on sessions", "build playbook", "cm reflect".
|
Help the user install, search, explore, and export their Claude Code sessions using the `cass` CLI and the optional `cass-memory` (`cm`) reflection pipeline.
Two tools — independent, loosely coupled:
| Tool | Role | Required |
|---|
cass | Infrastructure: index, search, export sessions | Yes |
cm (cass-memory) | Intelligence: reflect on sessions, build playbook rules | Optional |
Check if installed:
cass --version
cm --version
brew install dicklesworthstone/tap/cass
cass index --full
brew install dicklesworthstone/tap/cm
export ANTHROPIC_API_KEY=sk-ant-...
cm init && cm doctor
<quick_start>
- Check index freshness:
cass status --json
- If stale (recommended_action = "index"), run:
cass index
- Execute the user's request (search / export / context / timeline)
</quick_start>
Step 1: Pre-flight Check
Always run this first:
cass status --json
Key fields to check:
recommended_action: "ok" = index is fresh; "index" = needs reindexing
db_stats.total_sessions: how many sessions are indexed
freshness.stale: true if index is stale
If stale, run:
cass index
Skip re-indexing if the user is searching a session they already know the path to (direct export).
Step 2: Execute the Request
Search sessions
cass search "topic keyword" --json --fields summary
cass search "keyword" --json --fields summary --workspace $(pwd)
cass search "keyword" --json --fields summary --days 7
cass search "keyword" --json --fields summary --agent claude_code
cass search "first topic" --robot-format sessions | cass search "second topic" --sessions-from -
Output fields in --fields summary: source_path, line_number, agent, title, score.
Export a session
cass export ~/.claude/projects/<workspace-encoded>/<session-id>.jsonl
cass export <path-to-session.jsonl> -o /tmp/session.md
cass export <path> --include-tools
Session files live at: ~/.claude/projects/<workspace-encoded>/ — encode workspace path by replacing / with -.
Find related sessions for a file
cass context <path-to-session.jsonl> --json --limit 5
Returns sessions that worked in the same workspace or touched the same files.
View activity timeline
cass timeline --days 7
cass timeline --since 2025-01-01 --until 2025-01-31
Expand context around a search result
When cass search returns a line_number, use expand to see surrounding messages:
cass expand <path-to-session.jsonl> --line <line_number>
Reflect on sessions with cass-memory (cm)
cm reflect --days 7 --max-sessions 3 --dry-run
cm reflect --days 7 --max-sessions 5
cm playbook
cm context --workspace $(pwd)
cm search "rate limiting"
cm doctor
Step 3: Present Results
For search results: Show session title + path. If the user wants details, export the most relevant session.
For exports: Render the markdown inline or summarize key decisions/actions from the session.
For context results: List related sessions with their titles and workspaces.
Tips
- Use
--fields summary to keep token usage low for search results.
- Use
--workspace $(pwd) to scope to the current project.
cass search --robot-format sessions outputs paths only — useful for piping into export or chained searches.
- For semantic search (finds conceptually related content):
cass search "topic" --mode semantic
- Session paths follow this pattern:
~/.claude/projects/<workspace-encoded>/<uuid>.jsonl
<success_criteria>
Session search/exploration is complete when:
cass-memory reflection is complete when: