# Session Trends

Analyze trends across session metrics.

- Repository: https://github.com/oliver-kriska/claude-elixir-phoenix (572 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add oliver-kriska/claude-elixir-phoenix --skill session-trends -g -a claude-code -y`
Codex: `npx skills add oliver-kriska/claude-elixir-phoenix --skill session-trends -g -a codex -y`
Cursor: `npx skills add oliver-kriska/claude-elixir-phoenix --skill session-trends -g -a cursor -y`
Gemini CLI: `npx skills add oliver-kriska/claude-elixir-phoenix --skill session-trends -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add oliver-kriska/claude-elixir-phoenix`

## Description

Analyze trends across session metrics. Computes windowed aggregates, deltas, and compares against MEMORY.md findings. Use periodically for progress tracking.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Session Trends

Analyze trends from the metrics ledger. Computes windowed aggregates,
fingerprint distributions, and compares against MEMORY.md baselines.

## Requirements

Requires `.claude/session-metrics/metrics.jsonl` from `/session-scan`.

## Usage

```
/session-trends                          # All windows (7d, 30d, all)
/session-trends --window 30d             # Specific window only
/session-trends --project enaia          # Filter by project
/session-trends --compare MEMORY.md      # Compare against memory baseline
/session-trends --html out.html          # Write HTML report with ASCII bars
```

For pure context-window stats (max prompt tokens, ctx %, compaction rate)
across raw Claude Code JSONL files, see the `--scan-jsonl` mode of
`compute-metrics.py` (inspired by badlogic / earendil-works/pi).

## Pipeline

### Step 1: Parse Arguments

Extract from `$ARGUMENTS`:

- **`--window WINDOW`**: Time window, `7d`, `30d`, or `all` (default: show all three)
- **`--project NAME`**: Filter metrics by project name
- **`--compare PATH`**: Path to MEMORY.md for baseline comparison
  (default: auto-detect from `.claude/` project memory)

### Step 2: Read Metrics Ledger

Read `.claude/session-metrics/metrics.jsonl`.

If empty or missing:

> No metrics found. Run `/session-scan` first.

If `--project` specified, filter entries by project field.

### Step 3: Compute Trends via Python

```bash
python3 .claude/skills/session-scan/references/compute-metrics.py \
  --trends .claude/session-metrics/metrics.jsonl \
  --memory {MEMORY_PATH}
```

Capture the JSON output.

### Step 4: Display Trend Report

Format the JSON output as a readable report:

#### Overview

```
Total sessions: {N} ({backfilled} backfilled from v1)
Date range: {earliest} to {latest}
```

#### Window Comparison

The rest: https://github.com/oliver-kriska/claude-elixir-phoenix/blob/HEAD/.claude/skills/session-trends/SKILL.md
