Opencode Conversation Analysis

by connorads

code

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.

Skill Details

Repository Files

3 files in this skill directory


name: opencode-conversation-analysis description: 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. compatibility: OpenCode-specific (relies on OpenCode session storage format). Requires jq, bash.

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

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

This script:

  • Finds all main sessions (excludes subagent child sessions)
  • Extracts user messages 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:

# 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 the ${#text} -ge 10 check in extract.sh
  • Include subagent sessions: Remove the parentID == null filter in extract.sh
  • Time period filtering: Add timestamp filtering in extract.sh

Storage Format Reference

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

Related Skills

Mermaid Diagrams

Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams (domain modeling, object-oriented design), sequence diagrams (application flows, API interactions, code execution), flowcharts (processes, algorithms, user journeys), entity relationship diagrams (database schemas), C4 architecture diagrams (system context, containers, components), state diagrams, git graphs, pie charts,

artdesigncode

Matlab

MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter

codedata

Dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.

codeworkflow

Consult Zai

Compare z.ai GLM 4.7 and code-searcher responses for comprehensive dual-AI code analysis. Use when you need multiple AI perspectives on code questions.

code

Writing Effective Prompts

Structure Claude prompts for clarity and better results using roles, explicit instructions, context, positive framing, and strategic organization. Use when crafting prompts for complex tasks, long documents, tool workflows, or code generation.

codedocumentworkflow

Analyze Performance

Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.

code

Flowchart Creator

Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes. Use when users request flowcharts, process diagrams, workflow visualizations, or decision trees.

artcodeworkflow

Bio Reporting Rmarkdown Reports

Create reproducible bioinformatics analysis reports with R Markdown including code, results, and visualizations in HTML, PDF, or Word format. Use when generating analysis reports with RMarkdown.

code

Desmos Graphing

Create interactive Desmos graphs in Obsidian using desmos-graph code blocks. Use when visualizing functions, parametric curves, inequalities, or mathematical relationships with customizable styling and settings.

code

Performance

Rendimiento & Optimización - Atoll Tourisme. Use when optimizing performance or profiling code.

code

Skill Information

Category:Technical
Last Updated:1/25/2026