Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计异常

ln-002-session-analyzerln 002 会话分析器

Agent Skill

ln-002-session-analyzer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,085

周安装

86

GitHub Stars

441

下载量

681
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ln-002-session-analyzer(ln 002 会话分析器)
来源仓库:https://github.com/levnikolaevich/claude-code-skills
仓库路径:skills/ln-002-session-analyzer
安装命令:
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-002-session-analyzer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-002-session-analyzer

简介

用于查找和筛选与 ln-002 会话分析相关的信息。

  • 适合根据任务需求快速定位分析方法或工具链。
  • 通过 GitHub 安装,需结合原始 README 验证功能。
  • 建议在使用前评估对会话数据的处理权限。ln-002-session-analyzer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 注意隐私保护,避免记录或外传用户交互内容。

SKILL.md

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.

Session Analyzer (Standalone Utility)

Type: Standalone Utility Category: 0XX Shared

Analyzes a session for errors, inefficiencies, and improvement opportunities. Produces actionable fixes for skills, tools, hooks, and communication style.

Scope: Single-session deep analysis (10 dimensions). Broader than protocol self-audit, narrower than /audit-sessions batch. For skill self-audit: shared/references/meta_analysis_protocol.md §7. For multi-day patterns: /audit-sessions.


When to Use This Skill

  • After completing a task — find what went wrong and how to improve
  • Periodically — audit recent sessions for patterns
  • After a skill run — analyze how well the skill instructions worked
  • When debugging tool/hook issues — find root causes in session data

Input

$ARGUMENTS:

  • (empty) — analyze current session (conversation context)
  • recent — scan latest JSONL session per agent (Claude, Codex)
  • {skill-name} — focus analysis on that skill's execution within the session

hex-line is an optional accelerator for large local session logs and repo files. If MCP is unavailable, continue with built-in Read/Grep/Glob/Bash; this skill must never block on MCP connectivity.


Dimensions

#DimensionScan forImprovement target
D1Tool ErrorsNOOP_EDIT, TEXT_NOT_FOUND, hash mismatch, out of rangeSKILL.md steps — add paths, anchors
D2Tool WasteFull reads without outline, repeated reads, bash fallbacksSKILL.md — "outline first", name MCP tools
D3Process IssuesTool loops 3+, retry storms, dead ends, wrong targetsSKILL.md phases — decompose
D4Script ExtractionAd-hoc bash/python scripts written each runreferences/scripts/
D5Hook & PermissionHook blocks, permission denials, built-in instead of MCPHook config, allowed-tools
D6CommunicationOver-explaining, missing status, unnecessary confirmationsCLAUDE.md prefs, skill output notes
D7Decision QualityDead ends before pivot, trial-and-error, slow error detectionSKILL.md decision trees, step clarity
D8Context PressureRe-reading same files, re-asking resolved, thread lossCaching notes, compact instructions
D9Subagent QualityEmpty results, timeouts, overbroad promptsAgent prompts, timeout settings
D10Scope DriftDeviation from goal, accidental expansion, pivot without reasonScope guards, goal gates

Phase 1: Collect Session Data

Determine source based on $ARGUMENTS:

Current session (empty args)

Scan conversation context directly. You have access to all tool call results, errors, and messages.

Recent sessions (recent arg)

Find latest session per agent:

echo "=== LATEST SESSIONS ==="

echo "## Claude"
CLAUDE_LATEST=$(stat -c '%Y %n' ~/.claude/projects/*/*.jsonl 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-)
[ -n "$CLAUDE_LATEST" ] && echo "  $CLAUDE_LATEST ($(wc -l < "$CLAUDE_LATEST") lines)" || echo "  No sessions found"

echo "## Claude Active Sessions"
for f in "$HOME/.claude/sessions"/*.json; do
  [ -f "$f" ] || continue
  PID=$(basename "$f" .json)
  kill -0 "$PID" 2>/dev/null && echo "  ACTIVE: $(cat "$f")" || echo "  STALE: PID=$PID"
done

echo "## Codex"
CODEX_LATEST=$(stat -c '%Y %n' ~/.codex/sessions/????/??/??/rollout-*.jsonl 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-)
[ -n "$CODEX_LATEST" ] && echo "  $CODEX_LATEST ($(wc -l < "$CODEX_LATEST") lines)" || echo "  No sessions found"

Extract raw data from JSONL session

Run for each found session file ($F):

echo "=== TOOL CALLS ==="
grep -oE '"name"\s*:\s*"[^"]*"' "$F" 2>/dev/null | sed 's/"name"\s*:\s*"//;s/"//' | sort | uniq -c | sort -rn | head -30

echo "=== ERRORS ==="
grep -oE 'NOOP_EDIT|TEXT_NOT_FOUND|FILE_NOT_FOUND|HASH_HINT|DANGEROUS|out of range|mismatch|tool_use_error|permission denied' "$F" 2>/dev/null | sort | uniq -c | sort -rn

echo "=== TOOL LOOPS (3+ consecutive) ==="
grep -oE '"name"\s*:\s*"[^"]*"' "$F" 2>/dev/null | sed 's/"name"\s*:\s*"//;s/"//' | uniq -c | sort -rn | awk '$1 >= 3'

echo "=== BUILT-IN vs MCP ==="
grep -oE '"name"\s*:\s*"(Read|Edit|Write|Grep|mcp__hex-line__\w+)"' "$F" 2>/dev/null | sed 's/.*"name"\s*:\s*"//;s/"//' | sort | uniq -c | sort -rn

echo "=== HOOK EVENTS ==="
grep -oE 'hook_progress|blocking error|PreToolUse|PostToolUse|hex-confirmed|Obligatory use|Use mcp__hex-line' "$F" 2>/dev/null | sort | uniq -c | sort -rn

echo "=== SKILL/COMMAND INVOCATIONS ==="
grep -oE '"display":\s*"/[a-z-]+' "$F" 2>/dev/null | sed 's/"display":\s*"//' | sort | uniq -c | sort -rn

Treat keyword-based error counts as heuristic only. Confirm that reported matches come from actual tool failure/result events, not from prompts, templates, or referenced docs that contain the same strings.

Extract token statistics from Claude JSONL

Run for Claude session file ($F) to get real token usage:

echo "=== TOKEN STATS ==="
TOTAL_IN=$(grep -oE '"input_tokens":[0-9]+' "$F" | grep -oE '[0-9]+' | paste -sd+ | bc 2>/dev/null)
TOTAL_OUT=$(grep -oE '"output_tokens":[0-9]+' "$F" | grep -oE '[0-9]+' | paste -sd+ | bc 2>/dev/null)
CACHE_CREATE=$(grep -oE '"cache_creation_input_tokens":[0-9]+' "$F" | grep -oE '[0-9]+' | paste -sd+ | bc 2>/dev/null)
CACHE_READ=$(grep -oE '"cache_read_input_tokens":[0-9]+' "$F" | grep -oE '[0-9]+' | paste -sd+ | bc 2>/dev/null)
echo "in=${TOTAL_IN:-0} out=${TOTAL_OUT:-0} cache_create=${CACHE_CREATE:-0} cache_read=${CACHE_READ:-0}"

Phase 2: Analyze by Dimensions

Apply D1-D10 to collected data. Classify each finding:

SeverityDimensionsMeaning
ErrorD1, D5Something broke — tool failed, permission denied
WasteD2, D4, D8Unnecessary work — redundant reads, ad-hoc scripts, re-gathering
PatternD3, D6, D7, D9, D10Improvable behavior — loops, communication, decisions

D1: Tool Errors

Count by type: NOOP_EDIT, TEXT_NOT_FOUND, hash mismatch, out of range, FILE_NOT_FOUND. For each, identify which step/phase caused it.

D2: Tool Waste

  • Reads without preceding outline (file >100 lines)
  • Same file read 3+ times
  • Bash cat/grep/head/sed when MCP equivalent exists

D3: Process Issues

  • Tool loops: same tool on same file 3+ times without progress
  • Retry storms: 3+ attempts with different parameters
  • Dead ends: approach explored then abandoned
  • Wrong target: looked at file X when needed Y

D4: Script Extraction

  • Bash/Python scripts written during session
  • If script would be needed on every run of the skill → candidate for references/scripts/

D5: Hook & Permission

  • Hook blocks (PreToolUse/PostToolUse blocking errors)
  • Built-in Read/Edit/Write/Grep used when MCP enforced
  • hex-confirmed bypasses — were they justified?

D6: Communication

  • Message length distribution (over-explaining vs terse)
  • Unnecessary confirmations ("shall I proceed?")
  • Missing status updates at milestones
  • Redundant summaries

D7: Decision Quality

  • Time to detect error and pivot (tool calls between error and correction)
  • Trial-and-error sequences vs targeted approach
  • Tool selection reasoning (used wrong tool first)

D8: Context Pressure

  • Same file read multiple times across phases
  • Information re-gathered that was already available
  • Signs of thread loss (re-asking resolved questions)

D9: Subagent Quality

  • Agent tool invocations with empty or low-value results
  • Agent timeouts
  • Overbroad prompts (agent did too much or too little)

D10: Scope Drift

  • Initial goal vs actual deliverables — any deviation?
  • Unplanned additions during execution
  • Pivots without explicit reason

Phase 3: Map to Fixes

For each finding, determine specific target and fix:

Target typeExample
SKILL.md step"ln-400 Step 2: add file path src/config.ts"
SKILL.md phase"ln-300 Phase 3: decompose into 3a-3c sub-steps"
allowed-tools"ln-400: add mcp__hex-line__edit_file"
Hook config"settings.json: add exception for npm test"
references/scripts/"ln-520: move test_harness.sh to references/scripts/"
CLAUDE.md"Add preference: terse responses, no trailing summaries"
MCP tool"hex-line edit_file: hash mismatch on concurrent edits"
Agent prompt"ln-310 Agent A: narrow scope to security-only"
Scope guard"ln-400: add Goal Articulation Gate at Phase 1"

Phase 4: Report

Output to chat per shared/references/meta_analysis_protocol.md format.

### Session Analysis: {session identifier}

#### Improvements
| # | Dim | Finding | Target | Fix |
|---|-----|---------|--------|-----|
| 1 | D1 | 3 edit failures Phase 4 | ln-400 Step 2 | Add file path |
| 2 | D4 | test.sh written ad-hoc | ln-520 | Move to references/scripts/ |
| 3 | D6 | Over-explained 5 times | CLAUDE.md | Add "terse" pref |
| 4 | D5 | Hook blocked Read 4x | settings.json | Add MCP permission |

#### Session Errors
| Problem Type | Count | Examples |
|-------------|-------|---------|
| Retry storm | 4 | 3x edit_file on config.ts |
| Wrong target | 2 | Read utils.ts not helpers.ts |

#### Subagent Errors: {Agent Name}  (per agent, if any)
| Problem Type | Count | Examples |
|-------------|-------|---------|
| {type} | {N} | {brief} |

IF no findings AND no errors: "Session analysis: clean run."

Anti-Patterns

Do NOTInstead
Define own output templateReference protocol format
Analyze files not in sessionOnly analyze what was actually used
Generic recommendationsEach fix tied to specific file + location
Report OK dimensionsOnly findings with issues

Phase 5: Meta-Analysis

MANDATORY READ: Load shared/references/meta_analysis_protocol.md

Analyze this session per protocol §7. Output per protocol format.


Definition of Done

  • D1-D10 dimensions checked
  • JSONL scanning works (recent mode)
  • Each finding has specific Target + Fix
  • Output per protocol format (improvements-only)
  • No template duplication
  • Meta-Analysis run

Version: 1.1.0 Last Updated: 2026-04-05

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.7%
按下载量换算250

Claude

29.13%
按下载量换算198

Cursor

19.41%
按下载量换算132

Gemini CLI

8.42%
按下载量换算57

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills