Skip to main content
ClaudeWave
Skill434 repo starsupdated today

cass

# Cass Session Search Cass mines archived agent session logs to recover past prompts, decision patterns, and working methodologies from local or cross-machine session history. Use it when retrieving a specific prompt you've already written, discovering what you previously decided not to do, analyzing repeated successful patterns across sessions, or recovering context after losing active conversation history. The skill includes session indexing, multi-workspace search with jq filtering, token analytics, and the ability to resume past sessions in their original harness.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/boshu2/agentops /tmp/cass && cp -r /tmp/cass/skills-codex/cass ~/.claude/skills/cass
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# cass Session Search

> **Core Insight:** Your repeated prompts are your best prompts. If you typed it 10+ times, it works. Mine your history.

`cass` is an upstream (Dicklesworthstone) tool and is **self-describing** — do not re-learn its surface from this skill. Discover it live:

```bash
cass capabilities --json      # features/connectors/limits of the installed binary
cass introspect --json        # full schema of every command + response
cass robot-docs guide|commands|examples|schemas|contracts   # machine-targeted docs
```

This skill carries only the AgentOps operating doctrine: when to reach for cass, the discovery workflow, the recovery posture, and the anti-patterns we have actually hit.

## Constraints

- Never run bare `cass` because it launches a blocking TUI; use a JSON, robot, or explicit file-output command.
- Treat a stale index as searchable and refresh it with a bounded background command because stale is not broken and an unbounded rebuild can stall the lane.
- Preserve source sessions and require explicit permission for destructive cleanup; recovery may rebuild only derived index state.

## When to Use

- "What did I ask last time?" / "find that prompt that worked" — session archaeology
- Prior-art check before inventing a new approach, plan, or prompt
- Scope archaeology: "when did we decide NOT to do X?"
- Post-context-loss recovery: what was searched for after a crash = what mattered

### Folded triggers (ag-s43tg wave 1): `casr` + `cass-memory` route here

- **`casr` → cross-harness resume.** Cross Agent Session Resumer: convert and resume sessions across Claude Code, Codex, Gemini, and other providers — `cass resume` plus [RESUME.md](references/RESUME.md) own this lane (resolve subagent logs to their parent via `cass context` first; subagent files are not resumable).
- **`cass-memory` → `cm` procedural memory.** Use when starting non-trivial work, mining lessons, or preventing repeated mistakes with cm procedural memory — mine past sessions here first, then promote the durable lessons through `cm` instead of re-deriving them each session.

## The Goldmine Principle

Your conversation history contains:
- **Refined prompts** — Every rephrase that worked better was captured
- **Working rituals** — Prompts repeated 10+ times ARE your methodology
- **Scope decisions** — "When did we decide NOT to do X?"
- **Recovery moments** — What you searched for after context loss = what mattered

**The insight:** Mining your past beats inventing new approaches. CASS is a context source in the federated graph: it supplies cited episodic evidence on demand — mine as a research-phase move before writing a fresh plan or prompt. What it returns is evidence with source identity and freshness, never policy, and AgentOps maintains no merged corpus of its own around it.

## History-First Routing

Before deriving a plan, prompt, or approach from scratch, run one bounded
search of past sessions (one query family, `--fields minimal`, a real
`--limit`, under a minute of wall clock). Three outcomes, each with its own
routing:

- **Direct hit** — a prior session solved this. Reuse its prompt or decision;
  cite `source_path` and line in whatever you build on it.
- **Adjacent hit** — prior work borders the problem. Extract the working
  fragments, then derive only the missing part fresh.
- **Verified absence** — zero hits after retrying against discovered workspace
  keys (`--aggregate workspace`). Now derivation is justified, and the absence
  itself is worth noting: you are in new territory, so budget accordingly.

The named failure mode is re-derivation drift: solving the same problem
slightly differently each session, so the corpus accumulates near-duplicate
approaches and no single one ever hardens into a ritual. Stop condition for
the history pass itself: one query family exhausted or a direct hit found —
history search is a bounded pre-step, not an open-ended excavation that
displaces the actual task.

## Lesson Weighting: Decay and Failure Overweight

Mined lessons are evidence with a shelf life, not doctrine:

- **Confidence decays with corpus drift.** Weight a mined lesson by what has
  changed since it was captured, not by calendar age alone. A lesson about a
  tool surface or repository that has since moved is a hypothesis to re-verify
  — one probe against the current surface — before it steers a fresh plan. A
  lesson about durable method (how to decompose, how to verify) decays far
  more slowly. Never carry a stale-surface lesson forward at its original
  confidence; the named failure mode is fossil doctrine — a dead workaround
  reapplied for months because it once worked and nobody re-checked.
- **Overweight failures.** A session where an approach failed is worth more
  than a session where one worked: successes are overrepresented in what gets
  polished and remembered, while failures encode the boundary of validity.
  When mining prior art for an approach, explicitly search for its failures
  ("didn't work", "reverted", "gave up", error strings) before adopting it. A
  hit showing the approach failing in circumstances like yours outranks three
  hits showing it succeeding elsewhere.

## THE EXACT PROMPT — Discovery Workflow

```
1. Bootstrap: Check health, refresh index, get project overview
   cass status --json && cass index --json
   cass search "*" --workspace /data/projects/PROJECT --aggregate agent,date --limit 1 --json

2. Find prompts: Search for keywords, filter to user prompts (lines 1-3)
   cass search "KEYWORD" --workspace /data/projects/PROJECT --json --fields minimal --limit 50 \
     | jq '[.hits[] | select(.line_number <= 3)]'

3. Follow hits: View the actual content
   cass view /path/from/source_path.jsonl -n LINE -C 20

4. Expand context: See the full conversation flow
   cass expand /path/from/source_path.jsonl --line LINE --context 3

5. Discover related: Find the whole work cluster
   cass context /path/from/source_path.jsonl --json
```

Why it works: