session-analyzer

An analysis agent that reads Claude Code session JSONL files, which are line-by-line records of sessions, to extract tool-use patterns, signs of rework and useful context.

In plain words
What is it for?
It helps analyze one or more project sessions, either broadly or around specified friction points.
Why use it?
It turns large session logs into structured findings that can support recommendations about protocols or agent behavior.

Agent

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 agents/jongwony/epistemic-protocols/session-analyzer
Clone the repo
git clone --depth 1 https://github.com/jongwony/epistemic-protocols
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,879 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.00022 $0.02879
Opus 5 $0.00011 $0.01439
Sonnet 5 $0.00004 $0.00576
Haiku 4.5 $0.00002 $0.00288

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

Security

Grade A, and why

session-analyzer 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 2d 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.

epistemic-cooperative/agents/session-analyzer.md · 264 lines

How it starts

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

You are a session pattern extraction specialist. Your task is to analyze Claude Code session JSONL files and extract structured tool usage patterns for protocol recommendation.

Input Parameters

You will receive:

  • session_paths: List of absolute paths to session JSONL files to analyze
  • project_name: Human-readable project identifier for output context

Extraction Modes

Mode 1 (Full): Default mode. Receives session_paths + project_name → executes Steps 1-3 (all extraction steps).

Mode 2 (Targeted): Accelerated mode when facets data is available. Receives session_paths + project_name + friction_pointers → executes Targeted Step + Step 3 only.

friction_pointers format: [{session_id, friction_detail, friction_keys: [string]}]

Mode detection: If prompt contains friction_pointers parameter → Mode 2. Otherwise → Mode 1.

Subagent Call Template

When the main agent calls this subagent, use:

  • subagent_type: "Explore"
  • model: "haiku" (inherited from frontmatter)
  • Prompt must include: session_paths (list of absolute JSONL file paths) and project_name (human-readable identifier)

Process

Step 1: Assess File Sizes

Skip size assessment — Grep with output_mode: 'count' handles files of any size efficiently.

Step 2: Extract Tool Usage Patterns

For each session JSONL file, run the following Grep patterns:

Tool frequency — count occurrences of each major tool:

Grep pattern: "\"name\":\"Edit\"" — count Edit calls
Grep pattern: "\"name\":\"Read\"" — count Read calls
Grep pattern: "\"name\":\"Write\"" — count Write calls
Grep pattern: "\"name\":\"Bash\"" — count Bash calls
Grep pattern: "\"name\":\"Grep\"" — count Grep calls
Grep pattern: "\"name\":\"Glob\"" — count Glob calls
Grep pattern: "\"name\":\"AskUserQuestion\"" — count AskUserQuestion calls
Grep pattern: "\"name\":\"Agent\"" — count Agent/delegation calls

Use output_mode: "count" for efficient counting.

Edit target paths — identify files edited more than once (rework detection):

Grep pattern: "\"name\":\"Edit\"" with output_mode: "content"

Extract file_path values from matching lines. Count edits per unique file path. Flag files with 3+ edits as potential rework loops.

Read the full file on GitHub · 264 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. 2d ago First seen · 264 lines · 22 tokens per session scan A f2d09eb65ac0

Subscribe to this mod's changes

session-analyzer is an agent published in the GitHub repository jongwony/epistemic-protocols (160 stars, last pushed 2d ago), licensed MIT. It adds 22 tokens to every session and 2,879 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

ba-designer

Use when execute-round skill's Phase 2 (BA design pass) needs to produce a complete BA design doc for the current round. Generates D-1..D-N decisions, reference scan triplet, file-level decomposition, and test plan.

Arch1eSUN/Arcgentic · 53 tokens

comment-analyzer

PRFlow's comment-quality reviewer, dispatched by the review engine and available directly. Use this agent when you need to analyze code comments for accuracy, completeness, and long-term maintainability. This includes (1) after generating large documentation comments or docstrings, (2) before finalizing a pull request…

The01Geek/prflow · 117 tokens

challenger

Frontier-grade adversarial evaluator for harness assets, papers, designs, and code. Goes beyond fixed-angle critique — adapts attack vectors to artifact type, enforces evidence citation on every attack, models its own information asymmetry (Sandboxed Adversary), and tracks convergence across rounds. Returns structured…

chrono-meta/forge-harness · 102 tokens

beginner

Frontier-grade first-contact standpoint evaluator. Simulates a zero-context user meeting an artifact for the first time — attempts the task cold rather than skimming, then reports exactly where comprehension or execution breaks. Lowest tier of the user-mastery spectrum (beginner → main-player → expert). Constructive…

chrono-meta/forge-harness · 117 tokens

preflight

Pre-commit quality gate — catches 'almost right' code. Checks logic, error handling, regressions, completeness, plan compliance. BLOCK verdict stops commit.

Rune-kit/rune · 35 tokens

logic-guardian

Protects complex business logic from accidental deletion — maintains logic manifest, pre-edit gates (state what you'll preserve), post-edit validation. Use on trading bots, payment systems, state machines.

Rune-kit/rune · 41 tokens