← 返回 Skills 市场
tanktechnology

Ai Session Analysis

作者 TankTechnology · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ⚠ suspicious
70
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install ai-session-analysis
功能描述
Use when the user wants to analyze local AI coding assistant session data (Claude Code, Codex, Kimi Code). Triggers on requests like "analyze my coding sessi...
使用说明 (SKILL.md)

AI Session Analysis

Overview

Analyze session data from local AI coding tools. Three bundled scripts extract raw data. You (the agent) read the output and form your own observations — there are no hardcoded rules or thresholds in the scripts.

Data Sources

Scripts read directly from these paths, no copying needed:

Tool Path Content
Claude Code ~/.claude/projects/*.jsonl Full transcripts with tool_use blocks
Claude Code ~/.claude/history.jsonl User input history
Claude Code ~/.claude/sessions/*.json Session metadata
Codex ~/.codex/sessions/*/*.jsonl Structured events
Kimi Code ~/.kimi/sessions/*/wire.jsonl Wire protocol with ToolCall entries

How to Run

# Text-based analysis (terminal output)
python3 ~/.claude/skills/ai-session-analysis/scripts/analyze.py
python3 ~/.claude/skills/ai-session-analysis/scripts/tool_analysis.py

# HTML report with charts (opens in browser)
python3 ~/.claude/skills/ai-session-analysis/scripts/generate_report.py [output.html]

Zero dependencies, Python 3 stdlib only. All scripts are pure data extractors — they present numbers, distributions, and timelines without any interpretation.

What Each Script Extracts

analyze.py — Overview:

  • Per-tool: session count, message volume, tool distribution, project ranking, daily activity timeline, date range
  • Cross-tool comparison table
  • Recent 7-day activity: daily tool calls, active projects, tool mix, per-session timeline

tool_analysis.py — Deep dive:

  • Shell command categories per tool (git, grep/find, npm/yarn, python, etc.)
  • File operation counts (Read/Write/Edit) and file type distribution
  • Project-level tool usage breakdown
  • Codex: token usage, web search topics, errors
  • Kimi: domain-specific tools beyond the standard set

generate_report.py — HTML report:

  • Self-contained HTML file with embedded data and Chart.js visualizations
  • Summary cards, daily activity timeline, tool distribution doughnut, project breakdown
  • Shell command comparison across all three tools
  • File operations, token usage, session timeline scatter plot
  • Session duration distribution, hour-of-day activity heatmap
  • Codex deep dive (patches, web searches, exit codes)
  • Kimi domain tools

After Running

Read both outputs carefully. Then tell the user what you see. Consider:

  • What are they actually doing? (exploring code vs building features vs debugging vs reviewing)
  • Which projects are getting attention, which ones went quiet?
  • Tool use patterns: are they leaning heavily on one tool? is the tool mix appropriate for their work?
  • Cross-tool: did they try one tool then switch? what might that say?
  • Recent vs historical: any shifts in behavior, intensity, or focus?
  • Anything that looks like friction: lots of failed commands, retries, errors?

Do not apply fixed thresholds or rules ("if bash > 40% then warn"). Look at the whole picture and use judgment. If something stands out, mention it. If nothing does, say so.

Security Note

The HTML report (generate_report.py) embeds your session data directly — file paths, shell commands, project names, and tool usage patterns. This is safe for personal use on your own machine, but do not share the generated HTML file with others or host it publicly. The terminal-based scripts (analyze.py, tool_analysis.py) only print aggregate statistics and are safe to share.

Common Issues

  • Claude Code shows few tools: Tools are in ~/.claude/projects/*.jsonl (assistant → content blocks with "type": "tool_use"), not in history.jsonl.
  • Codex sessions empty: Check ~/.codex/sessions/2026/ subdirectories (organized by year/month/day).
  • Kimi tool names missing: ToolCall entries are in wire.jsonl via payload.function.name.
安全使用建议
Use this skill only if you are comfortable letting the agent analyze your local Claude Code, Codex, and Kimi Code session logs. Do not assume terminal output is safe to share; inspect and redact it just like the HTML report. The artifacts do not show exfiltration or destructive behavior, but the privacy wording should be corrected before broad use.
功能分析
Type: OpenClaw Skill Name: ai-session-analysis Version: 0.1.1 The skill is a local analytics utility designed to aggregate and visualize usage statistics from AI coding assistants (Claude Code, Codex, and Kimi Code). It reads session logs and transcripts from local directories (~/.claude, ~/.codex, ~/.kimi) to generate terminal reports and a self-contained HTML dashboard using Chart.js. While it accesses sensitive conversation history and shell logs, all processing is performed locally, and the scripts (analyze.py, generate_report.py, tool_analysis.py) contain no network exfiltration logic or unauthorized execution capabilities. The SKILL.md includes appropriate security warnings advising the user not to share the generated HTML report due to the sensitive data it contains.
能力评估
Purpose & Capability
The capability is coherent with the stated purpose: it reads Claude Code, Codex, and Kimi Code local session files to produce usage summaries. Those files can contain private prompts, commands, project names, and file paths.
Instruction Scope
SKILL.md says terminal outputs are aggregate statistics and safe to share, but the provided tool_analysis.py prints sample shell commands, web search queries, errors, and project names.
Install Mechanism
There is no dependency install step and the scripts use Python stdlib, but the submitted metadata lists the source as unknown and no homepage, so provenance is limited for code that reads private local logs.
Credentials
The recursive reads are limited to disclosed AI-tool session directories under the user home directory, which is purpose-aligned, but still privacy-sensitive.
Persistence & Privilege
No credentials, privilege escalation, or background persistence are shown. The generated HTML report is a persistent local file that embeds session data, and SKILL.md warns not to share it.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ai-session-analysis
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ai-session-analysis 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
Fix timezone (UTC→local), generalize paths with strip_home_prefix(), dedup classify_shell_cmd to shared.py, fix bare except clauses, add --days/--no-open flags, fix Session Timeline scatter chart, add Combined 24-Hour Activity chart, fix XSS via </ escaping, add parse error tracking throughout
v0.1.0
Initial release of AI Session Analysis skill. - Analyze session data from Claude Code, Codex, and Kimi Code tools with bundled scripts. - Scripts provide raw metrics: session counts, tool usage, project activity, file operations, and timelines. - Supports terminal outputs and a self-contained HTML report with interactive charts. - No dependencies outside Python 3 standard library; scripts perform no interpretation or judgment. - Includes guidance for summarizing user activity and patterns after viewing the script outputs.
元数据
Slug ai-session-analysis
版本 0.1.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Ai Session Analysis 是什么?

Use when the user wants to analyze local AI coding assistant session data (Claude Code, Codex, Kimi Code). Triggers on requests like "analyze my coding sessi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 70 次。

如何安装 Ai Session Analysis?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ai-session-analysis」即可一键安装,无需额外配置。

Ai Session Analysis 是免费的吗?

是的,Ai Session Analysis 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ai Session Analysis 支持哪些平台?

Ai Session Analysis 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ai Session Analysis?

由 TankTechnology(@tanktechnology)开发并维护,当前版本 v0.1.1。

💬 留言讨论