session-insights

session-insights is a skill for Claude Code, Codex from IlyaGorsky/memory-toolkit. It costs 31 tokens per session (839 once invoked), scanned A, original, MIT.

A session-analysis tool that reads past JSONL transcripts, which are line-by-line JSON records, to find problems, decisions, patterns, and sources of friction.

In plain words
What is it for?
It can search sessions by ticket, keyword, session ID, or workstream, then extract and organize relevant user messages and insights.
Why use it?
It helps recover useful context from earlier work that is no longer visible in the current conversation.

Skill for Claude CodeCodex

Part of the memory-toolkit plugin — 11 skills, 5 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ilyagorsky/memory-toolkit/session-insights
Any agent
npx skills add IlyaGorsky/memory-toolkit --skill session-insights
Clone the repo
git clone --depth 1 https://github.com/IlyaGorsky/memory-toolkit

Made for: Claude Code, Codex.

Or install memory-toolkit, the plugin that ships this one along with the rest of its 11 skills, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-insights

README.md
[![agentmods](https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-insights.svg)](https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-insights)
Your own site
<a href="https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-insights"><img src="https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-insights.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 839 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00839
Opus 5 $0.00015 $0.00419
Sonnet 5 $0.00006 $0.00168
Haiku 4.5 $0.00003 $0.00084

Measured 5d ago against content hash 526b2e9ff843, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

session-insights scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/session-insights/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/session-insights — Extract insights from past sessions

Parse .jsonl session transcripts and extract structured insights: problems, decisions, patterns, friction points. Works on sessions outside the current context.

Step 1: Find sessions

Resolve memory directory, then find sessions by argument:

GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
PROJ_KEY=$(echo "$GIT_ROOT" | tr '/.' '-' | sed 's/^-//')
SESSIONS_DIR="$HOME/.claude/projects/-${PROJ_KEY}/"
  • Ticket/keyword — grep across all .jsonl files
  • Session ID — specific file by UUID
  • Workstream — use node "$MEM" --dir="$MEM_DIR" workstream <name> for context, match by dates/keywords
  • No argument — most recent session
grep -l "<query>" "$SESSIONS_DIR"*.jsonl 2>/dev/null | head -10

Also check session index if available:

cat "$MEM_DIR/sessions.jsonl" 2>/dev/null

Step 2: Extract user messages

For each session found:

import json, sys

with open(sys.argv[1]) as f:
    for i, line in enumerate(f):
        try:
            obj = json.loads(line.strip())
            if obj.get('type') != 'user':
                continue
            c = obj.get('message', {}).get('content', obj.get('content', ''))
            if isinstance(c, list):
                for item in c:
                    if isinstance(item, dict) and item.get('type') == 'text':
                        text = item.get('text', '').strip()
                        if text and not text.startswith('<') and len(text) > 5:
                            print(text[:300])
            elif isinstance(c, str):
                text = c.strip()
                if text and not text.startswith('<') and len(text) > 5:
                    print(text[:300])
        except:
            pass

Step 3: Analyze

Extract structured insights from the user messages:

  1. Problems — what didn't work, was redone, caused friction
  2. Decisions — what was chosen and why (architectural, process)
  3. Insights — non-obvious conclusions, patterns, reassessments
  4. Friction points — where the agent repeatedly failed, what required many iterations

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 114 lines · 31 tokens per session scan A 526b2e9ff843

Subscribe to this mod's changes

session-insights is a skill published in the GitHub repository IlyaGorsky/memory-toolkit (13 stars, last pushed 4mo ago), licensed MIT. It adds 31 tokens to every session and 839 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.