opencode-conversation-analysis

Analyze OpenCode conversation history to identify themes and patterns in user messages. Use when asked to analyze conversations, find themes, review how a user steers agents, or extract insights from session history.

13 stars

Best use case

opencode-conversation-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze OpenCode conversation history to identify themes and patterns in user messages. Use when asked to analyze conversations, find themes, review how a user steers agents, or extract insights from session history.

Teams using opencode-conversation-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/opencode-conversation-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/connorads/dotfiles/main/.agents/skills/opencode-conversation-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/opencode-conversation-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How opencode-conversation-analysis Compares

Feature / Agentopencode-conversation-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze OpenCode conversation history to identify themes and patterns in user messages. Use when asked to analyze conversations, find themes, review how a user steers agents, or extract insights from session history.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Conversation Analysis

Analyze user messages from OpenCode sessions to identify recurring themes, communication patterns, and steering behaviours.

## Critical Rules

1. **NEVER cat or read chunk files directly** - they're huge and will explode your context
2. **Pass file paths to subagents** - let them read and analyze independently
3. **Use parallel subagents** - one per chunk, they run concurrently
4. **Subagents return structured JSON** - you synthesize at the end

## Workflow

### Step 1: Run Extraction

```bash
~/.agents/skills/opencode-conversation-analysis/scripts/extract.sh
```

This script:
- Reads from `~/.local/share/opencode/opencode.db` (SQLite) when available
- Falls back to `~/.local/share/opencode/storage/` for older OpenCode installs
- Extracts user messages from main sessions with metadata (session_id, title, timestamp, text)
- Filters out messages < 10 characters
- Chunks into ~320k char files (~80k tokens each)
- Outputs to `/tmp/opencode-analysis/chunk_*.jsonl`

Review the output summary to see how many chunks were created.

### Step 2: Launch Parallel Subagents

For each chunk file, spawn a `general` subagent with this prompt template:

```
Read the file /tmp/opencode-analysis/chunk_N.jsonl which contains user messages from coding sessions (JSONL format with fields: session_id, session_title, timestamp, text).

Analyze these messages to identify recurring themes in how the user steers/guides AI coding assistants. Look for patterns like:
- How they give feedback
- How they correct mistakes
- How they scope/refine requests
- Communication style preferences
- Technical approaches they emphasize

For each theme you identify, provide:
1. Theme name (short, descriptive)
2. Description (1-2 sentences)
3. 2-3 direct quote examples from the messages

Return ONLY valid JSON in this format:
{
  "themes": [
    {
      "name": "Theme Name",
      "description": "Description of the pattern",
      "examples": ["quote 1", "quote 2"]
    }
  ]
}
```

Launch ALL chunk subagents in parallel (single message, multiple Task tool calls).

### Step 3: Synthesize Results

Once all subagents return:

1. Collect all theme objects from all chunks
2. Group similar themes (same name or overlapping descriptions)
3. Merge examples from duplicate themes
4. Rank themes by how many chunks they appeared in
5. Pick the best 2-3 examples per theme

### Step 4: Output Format

Present the final analysis as markdown with this structure:

```markdown
# Themes in How You Steer AI Coding Assistants

Analysis of N messages across M sessions (date range)

---

## 1. Theme Name

Description of the pattern.

**Examples:**
- "direct quote 1"
- "direct quote 2"
- "direct quote 3"

---

## 2. Next Theme
...
```

Output directly to the user - don't write to a file unless asked.

## Customisation Options

The user may request:
- **Different chunk sizes**: Edit `CHUNK_SIZE` in extract.sh (default 320000 chars)
- **Different message filter**: Edit `MIN_TEXT_LEN` in `extract.sh` (default 10 chars)
- **Include subagent sessions**: Remove the `parent_id IS NULL` (SQLite) and `parentID` (legacy) filters in extract.sh
- **Time period filtering**: Add timestamp filtering in extract.sh

## Storage Format Reference

See [references/storage-format.md](references/storage-format.md) for details on OpenCode's conversation storage structure.

Related Skills

We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.