session-scan
Skill573 starsChanged 4 months agoMITView on GitHub
Compute metrics for Claude Code sessions. Discovers via ccrider, filters trivial, computes friction/opportunity/fingerprint scores. Use for broad session triage.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mpazik/session-scantheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mpazik/session-scan★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cc-changelogSkill
- codex-abSkill
- docs-checkSkill
- plugin-dev-workflowSkill
- promoteSkill
- releaseSkill
- session-deep-diveSkill
- session-trendsSkill
- skill-monitorSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Read .claude/session-metrics/metrics.jsonl (if exists).
- Distinctive: line 97
Spawn ALL subagents in parallel: Wait for all to complete.
- Very specific: line 119
If Tier 2 eligible: suggest /session-deep-dive --from-scan.
- Distinctive: line 152
ALWAYS delete temp and result files: after processing
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Scan (Tier 1)
Compute deterministic metrics for sessions discovered via ccrider MCP.
STOP — Read Before Executing
NEVER call mcp__ccrider__get_session_messages in main context.
Each response is 5-50KB of JSON. Fetching N sessions directly = context crash.
You MUST delegate all scoring to subagents. The main context only does: discovery, deduplication, subagent spawning, and result collection.
Requirements
Requires ccrider MCP. If not available:
ccrider MCP is required. See: https://github.com/neilberkman/ccrider
Usage
/session-scan # Last 7 days, up to 50 sessions
/session-scan --since 2026-02-01 # Since specific date
/session-scan --project enaia # Filter by project name
/session-scan --limit 20 # Cap session count
/session-scan --list # Discovery only, no scoring
/session-scan --rescan # Recompute already-scanned sessionsWhat Main Context Does
1. Parse Arguments
Extract from $ARGUMENTS:
--since DATE: ISO date filter (default: 7 days ago)--project NAME: Filter by project path substring--limit N: Max sessions to process (default: 50)--list: Discovery only — show table, skip scoring--rescan: Recompute metrics for already-scanned sessions
2. Discover Sessions (safe — response is ~1KB)
mcp__ccrider__list_recent_sessions(limit: N, project: PROJECT, after_date: SINCE)Filter out sessions with < 10 messages. If --list: show table and stop.
3. Deduplicate
Read .claude/session-metrics/metrics.jsonl (if exists).
Skip sessions already scanned unless --rescan flag is set.
Report: "N new sessions to scan (M already in ledger)"
4. Resolve Scorer Path
Glob: **/session-scan/references/compute-metrics.pyStore as SCORER_PATH (absolute). PROJECT_ROOT = current working directory.
5. Spawn ONE Subagent Per Session
DO NOT fetch messages yourself. DO NOT run Python yourself. You MUST use the Task tool to spawn subagents.
For EACH unscanned session, spawn a haiku subagent using this template:
Task(subagent_type="general-purpose", model="haiku", mode="bypassPermissions", prompt="""
Score one Claude Code session. Steps:
1. Fetch messages:
mcp__ccrider__get_session_messages(session_id: "{SESSION_ID}", last_n: 200)
2. Write the full tool result (messages JSON) to:
{PROJECT_ROOT}/.claude/session-metrics/_tmp_{SHORT_ID}.json
3. Run scorer and capture result in ONE Bash command:
python3 {SCORER_PATH} {PROJECT_ROOT}/.claude/session-metrics/_tmp_{SHORT_ID}.json --session-id {SESSION_ID} --project {PROJECT_NAME} > {PROJECT_ROOT}/.claude/session-metrics/_result_{SHORT_ID}.json && rm {PROJECT_ROOT}/.claude/session-metrics/_tmp_{SHORT_ID}.json
4. Report back: "Scored {SHORT_ID}: friction=X.XX fingerprint=Y"
If ccrider fails, report the error and exit.
""")Spawn ALL subagents in parallel. Wait for all to complete.
6. Collect Results
for f in .claude/session-metrics/_result_*.json; do
cat "$f" >> .claude/session-metrics/metrics.jsonl
rm "$f"
done7. Display Results
Show summary table sorted by friction (descending):
| ID | Project | Date | Type | Friction | Opportunity | Tier2? |
|----------|---------|------------|-------------|----------|-------------|--------|
| ffa155ee | enaia | 2026-02-18 | bug-fix | 0.42 | 0.65 | Yes |
| 90a74843 | wedding | 2026-02-17 | feature | 0.15 | 0.20 | No |If Tier 2 eligible: suggest /session-deep-dive --from-scan.
8. Update Scan Metadata
Write .claude/session-metrics/latest-scan.json:
{
"scanned_at": "2026-02-20T14:30:00Z",
"sessions_discovered": 25,
"sessions_scanned": 18,
"sessions_skipped": 7,
"tier2_eligible": 5
}Scoring Reference
See references/scoring-guide.md for full algorithm documentation.
- Friction Score (0-1): Weighted signals, sigmoid-normalized
- Fingerprint: Rule-based classifier (6 types)
- Plugin Opportunity (0-1): Missed
/phx:commands - Tier 2 Eligible: friction > 0.35 OR opportunity > 0.5 OR plugin used OR msgs > 50
Iron Laws
- NEVER call
get_session_messagesin main context — WILL crash context - ONE subagent per session — each fetches exactly ONE session
mode="bypassPermissions"on every Task — subagents need Write+Bash- Absolute paths in subagent prompts — subagents don't inherit context
- Result files, not direct append — avoid jsonl race conditions
- NEVER modify existing metrics.jsonl entries — append-only ledger
- ALWAYS delete temp and result files after processing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

