AgentSkillsCN

find-sessions

完整的会话分析流水线。只需用自然语言描述您想要探寻的内容,即可获得综合性的分析报告。需借助 ccrider MCP。

SKILL.md
--- frontmatter
name: find-sessions
description: Find Claude Code sessions worth analyzing using ccrider MCP. Discovers sessions by topic, project, or recency. Use when a developer wants to understand their coding patterns.
argument-hint: [search topic] [--project NAME] [--recent N]

Find Sessions

Discover Claude Code sessions worth analyzing using ccrider MCP.

Usage

code
/phx:find-sessions                          # List 20 most recent sessions
/phx:find-sessions "LiveView errors"        # Search sessions by topic
/phx:find-sessions --project my_project     # Filter by project name
/phx:find-sessions --recent 10              # Limit results
/phx:find-sessions "Oban" --project myapp   # Combine topic + project filter

Requirements

This skill requires ccrider MCP to be installed and configured.

If ccrider tools are not available, tell the user:

ccrider MCP is required but not available. Install it:

claude mcp add ccrider -- npx @anthropic/ccrider-mcp-server

See: https://github.com/neilberkman/ccrider

Steps

1. Check ccrider availability

Call mcp__ccrider__list_recent_sessions with limit: 1. If the tool is not found or errors, show the install instructions above and stop.

2. Parse arguments from $ARGUMENTS

  • No args: List mode — list_recent_sessions(limit: 20)
  • Quoted or unquoted text (not starting with --): Search mode — search_sessions(query: text)
  • --project NAME: Pass as project filter (match substring in project path)
  • --recent N: Set limit to N

Search mode and list mode can combine with --project and --recent.

3. Fetch sessions

  • List mode: Call mcp__ccrider__list_recent_sessions with limit and optional project filter
  • Search mode: Call mcp__ccrider__search_sessions with query, optional project filter, and limit

4. Present results

Display a clean markdown table:

code
Found {count} sessions:

| #  | Session ID | Project   | Date       | Msgs | Summary                              |
|----|------------|-----------|------------|------|--------------------------------------|
| 1  | 90a74843   | my_project| 2026-02-09 | 30   | Fix gettext translations in kanban   |
| 2  | bb24e252   | virgil    | 2026-02-08 | 45   | PostgreSQL FTS article preview       |

Formatting rules:

  • Session ID: First 8 characters only
  • Project: Last path segment (e.g., my_project from /Users/.../my_project)
  • Date: Just the date portion (YYYY-MM-DD)
  • Summary: First user message, strip HTML/XML tags, truncate to 80 chars
  • For search results, prefer showing the matched snippet instead of the summary

5. Ask which to analyze

Ask the user:

"Which sessions do you want to analyze? Enter numbers (e.g., 1,3,5), 'all', or 'none'."

6. Save selection

Write selected session IDs (full IDs) to .claude/sessions-to-analyze.md:

markdown
# Sessions to Analyze

<!-- Generated by /phx:find-sessions on {date} -->

| #   | Session ID        | Project | Summary        |
| --- | ----------------- | ------- | -------------- |
| 1   | 90a74843-66b3-... | my_app  | Fix gettext... |

## Session IDs

- 90a74843-66b3-4d82-81b2-5c20d6e2fbb3
- bb24e252-7be7-491c-a184-f114a337ade9

Tell the user:

"Saved {N} sessions to .claude/sessions-to-analyze.md. Run /phx:analyze-session --from-find to analyze them, or /phx:analyze-session {id} for a specific one."