memory-analyzer

Analyze OpenCode session memory for usage patterns, costs, and history.

2|Updated Jun 3, 2021
One-click install
npx skills add https://github.com/kalindudc/shell --skill memory-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-analyzer
Source: https://github.com/kalindudc/shell/tree/main/home/.config/opencode/skills/memory-analyzer
Command: npx skills add https://github.com/kalindudc/shell --skill memory-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyze OpenCode session memory to answer questions about usage patterns, costs, and history in a read-only manner that preserves data integrity.

Core Features & Use Cases

  • Read index.json for aggregate metrics (session counts, model usage, skill/command frequency).
  • Scan per-session JSON files for detailed metrics (tokens, duration, tools, files) and tie results to projects.
  • Grep memory .md logs for topic search and historical conversations to support knowledge retrieval.

Quick Start

Run the memory-analyzer to scan ~/.config/opencode/memory and generate a summary report.

Frequently Asked Questions about memory-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze session memory logs to calculate token usage and costs?

Session memory analysis works by reading index.json for aggregate metrics, scanning per-session JSON files for detailed token and duration data, and grepping .md logs for historical conversations. This read-only approach computes usage patterns and costs while preserving data integrity.

Can I extract usage statistics from OpenCode session history without modifying the files?

You can extract aggregate metrics like session counts, model usage frequency, and skill or command frequency by reading the index.json file. This provides a high-level summary of usage patterns across your OpenCode session memory directory.

How do I search historical conversation logs for specific topics in session memory?

To start analyzing session memory, run the memory-analyzer to scan the ~/.config/opencode/memory directory. It will read the index.json, individual session JSON files, and .md logs to generate a comprehensive summary report of your usage patterns and costs.

What's the best way to tie per-session token metrics to specific projects?

The analysis covers per-session JSON files containing detailed metrics such as tokens, session duration, tools used, and accessed files. By scanning these individual session files, you can tie specific usage results and token costs directly to their corresponding projects.

Does memory log analysis support both high-level summaries and detailed investigations?

Memory log analysis is limited to read-only operations, meaning it cannot modify, delete, or write to the session memory files. It strictly reads index.json, per-session JSON files, and .md logs to ensure complete data integrity during the usage analysis process.