session-analysis

A guide to the structure and meaning of JSON files created by clens, a tool that records AI coding-agent sessions and turns their event logs into summaries and metrics.

In plain words
What is it for?
Use it to inspect session statistics, decisions, file changes, timelines, agent activity, team data, and other information in clens distilled files.
Why use it?
It helps you read session data consistently instead of guessing what each field or metric means.

Skill for Claude CodeCodex

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/silouone/clens/session-analysis
Any agent
npx skills add silouone/clens --skill session-analysis
Clone the repo
git clone --depth 1 https://github.com/silouone/clens

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,110 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.00028 $0.01110
Opus 5 $0.00014 $0.00555
Sonnet 5 $0.00006 $0.00222
Haiku 4.5 $0.00003 $0.00111

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

Security

Grade A, and why

session-analysis 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

packages/cli/agentic/skills/session-analysis/SKILL.md · 68 lines

How it starts

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

Session Analysis

Knowledge base for interpreting clens distilled session data. This skill provides schema documentation and analysis guidance for the DistilledSession JSON files produced by clens distill.

What is clens?

clens captures AI agent sessions (Claude Code) as local JSONL event streams via hooks. The distill command processes raw events through 23 extractors into a single structured JSON file containing stats, backtracks, decisions, file maps, git diffs, edit chains, diff attribution, reasoning traces, user messages, summaries, timelines, plan drift, active duration, agent tree, agent distillation, agent enrichment, aggregate team data, team metrics, decisions (team), summary (team), communication graphs, communication sequences, agent lifetimes, and journey data.

Pillars

  • Distill Schema -- Complete type-annotated schema for every field in the distilled JSON output
  • Interpretation Guide -- How to read metrics, reference ranges, pattern interpretation, and actionable analysis techniques

Key Conventions

  • All timestamps are Unix milliseconds (number). Convert with new Date(t) for human-readable output.
  • Cost estimates are USD approximations based on token heuristics (~20% margin). Not billing-accurate.
  • Distilled files live at .clens/distilled/{sessionId}.json. Raw events at .clens/sessions/{sessionId}.jsonl.
  • Session IDs are UUIDs. Use first 8 characters for display (e.g., a1b2c3d4).
  • The complete flag indicates whether all extractors ran successfully. If false, some sections may be empty.
  • Optional fields (marked with ?) are omitted from the JSON when absent, not set to null.

Data Sources (23 Extractors)

Extractor Field Source Description
stats stats Hook events Aggregate counts, durations, tool usage, failure rates, cost
backtracks backtracks Hook events Failure retries, iteration struggles, debugging loops
decisions decisions Hook events Timing gaps, tool pivots, phase boundaries
file-map file_map Hook events Per-file read/edit/write/error counts
git-diff git_diff Git + hooks Commits, hunks, working tree changes
edit-chains edit_chains Hook + transcript Thinking-to-code binding, abandoned edits, net changes
diff-attribution edit_chains.diff_attribution Git + hooks Maps git hunks to specific edit tool_use_ids
reasoning reasoning Transcript Extended thinking blocks with intent classification
user-messages user_messages Transcript User prompts, commands, system messages
summary summary Synthesized Narrative, phases, key metrics, top errors, workload
timeline timeline Synthesized Chronological interleaved event stream
active-duration (feeds summary) Synthesized Active vs idle vs pause time
plan-drift plan_drift Hook + filesystem Spec vs actual file drift score
agent-tree agents[] Links + hooks Sub-agent hierarchy tree construction
agent-distill agents[] Transcript per agent Per-subagent stats, file_map, tokens, model
agent-enrich agents[] Links Enriches agents with communication, tasks, messages
aggregate (feeds stats, file_map) Agents + parent Merges agent data into parent-level aggregates
team team_metrics Links Agent count, task completions, utilization
decisions-team decisions Links + hooks Team-level decision extraction with agent context
summary-team summary Links + agents Team-level summary with agent workload breakdown
comm-graph communication_graph Links Message edges between agents
comm-sequence comm_sequence Links Temporal message ordering between agents
agent-lifetimes agent_lifetimes Links Agent spawn/stop timestamps and lifespans

Read the full file on GitHub · 68 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 68 lines · 28 tokens per session scan A 61df1904947e

Subscribe to this mod's changes

session-analysis is a skill published in the GitHub repository silouone/clens (6 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 1,110 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-31.