analyze

analyze is a command for Claude Code from JoelYYoung/retrolens. It costs 0 tokens per session (791 once invoked), scanned A, original, MIT.

A command that examines one or more saved AI-agent sessions by moving from the overall session to its turns and tool calls. Tool calls are the actions an agent asks a computer or service to perform.

In plain words
What is it for?
Use it to analyze a selected session or compare sessions, limit the review to certain turns, and save a text or JSON analysis artifact.
Why use it?
It turns a long conversation log into a structured analysis, making phases, decisions, and detailed actions easier to understand.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the retrolens plugin — 1 skill, 4 commands 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 commands/joelyyoung/retrolens/analyze
Clone the repo
git clone --depth 1 https://github.com/JoelYYoung/retrolens

Made for: Claude Code.

Or install retrolens, the plugin that ships this one along with the rest of its 1 skill, 4 commands.

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 analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/joelyyoung/retrolens/analyze.svg)](https://agentmods.dev/commands/joelyyoung/retrolens/analyze)
Your own site
<a href="https://agentmods.dev/commands/joelyyoung/retrolens/analyze"><img src="https://agentmods.dev/badge/commands/joelyyoung/retrolens/analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 791 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.1 $0.00000 $0.00791
Opus 5 $0.00000 $0.00396
Sonnet 5 $0.00000 $0.00158
Haiku 4.5 $0.00000 $0.00079

Measured 5d ago against content hash 79707c90e139, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

analyze 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.

retrolens-plugin/commands/analyze.md · 96 lines

How it starts

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

retrolens:analyze Command

Analyze one or more sessions: drill from overview → turns → tool calls, map phases, and produce an analysis artifact.

Full skill reference: Read ./SKILL.md → Workflow C for the detailed drill-down method.

Prerequisites

Run /retrolens:connect first to connect to a log directory.

Usage

/retrolens:analyze [<session-id>] [--out <file>] [--turns <range>] [--json]

Arguments

  • <session-id> - A session ID/prefix, latest, or omit to choose interactively

Options

  • --out <file> - Write analysis to a file (recommended)
  • --turns <range> - Limit scope (e.g., 1-10)
  • --json - Emit structured summary

What This Command Does

Step 1: Ask the user which session(s) to analyze

If no <session-id> is provided, list available sessions and ask:

retrolens ls --json

Found N sessions. Which would you like to analyze?

# Date Turns Title/Preview
1 2026-04-10 23 "Fix CI build errors..."
2 2026-04-09 8 "Add custom reader..."
3 2026-04-08 45 "Refactor plugin structure..."

Enter a number, session ID prefix, or all to compare multiple sessions.

Step 2: Get session overview

retrolens read <ID> --json              # overview + turn summaries

Step 3: Drill into key turns

retrolens read <ID> --turn N --json     # full turn detail
retrolens read <ID> -t N --tool M       # specific tool call
retrolens read <ID> --turns 1-5 --json  # range of turns
retrolens read <ID> --diff 1,5 --json   # compare two turns

Step 4: Map phases

Identify workflow stages by tool usage patterns:

Phase Dominant Tools
Research read_file, semantic_search, grep_search, list_dir
Planning Discussion turns, vscode_askQuestions
Implementation create_file, replace_string_in_file
Testing run_in_terminal with test/build commands
Iteration Repeated edits after errors or user corrections

Read the full file on GitHub · 96 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 · 96 lines · 0 tokens per session scan A 79707c90e139

Subscribe to this mod's changes

analyze is a command published in the GitHub repository JoelYYoung/retrolens (2 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 791 tokens. 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-31.