← 返回 Skills 市场
dunzhang

clawlens

作者 DunZhang · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ⚠ suspicious
280
总下载
2
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install clawlens
功能描述
What do you use Claw for most? Where do you get stuck? Clawlens analyzes your conversation history to surface usage patterns, friction points, and skill effe...
使用说明 (SKILL.md)

Clawlens - OpenClaw Usage Insights

Generate a comprehensive usage insights report by analyzing conversation history.

When to Use

User Says Action
"show me my usage report" Run full report
"analyze my conversations" Run full report
"how am I using Claw" Run full report
"clawlens" / "claw lens" Run full report
"usage insights" / "usage analysis" Run full report

How to Run

Execute the analysis script:

python3 scripts/clawlens.py [OPTIONS]

Options

Flag Default Description
--agent-id main Agent ID to analyze
--days 180 Analysis time window in days
--model auto-detect LLM model in litellm format (e.g. deepseek/deepseek-chat). If omitted, auto-detected from OpenClaw config.
--lang zh Report language: zh or en
--format md Output format: md (Markdown) or html (self-contained dark-themed HTML)
--no-cache false Ignore cached facet extraction results
--max-sessions 2000 Maximum sessions to process
--concurrency 10 Max parallel LLM calls
--verbose false Print progress to stderr
-o / --output stdout Output file path

Model Selection (Agent Interaction)

When the user requests a clawlens report without specifying a model, you must ask the user before running:

是否使用 OpenClaw 当前配置的模型来生成报告?如果不使用,请告诉我你想用的模型(litellm 格式,如 deepseek/deepseek-chat)。

  • User agrees to use OpenClaw model: Run without --model (the script auto-detects from ~/.openclaw/openclaw.json).
  • User specifies a different model: Run with --model \x3Cuser-choice>. The user must also set the corresponding API key env var (e.g. DEEPSEEK_API_KEY).

Note: Each user's OpenClaw model configuration may differ — some use API-key-based providers (e.g. openai-completions), others use OAuth-based providers (e.g. anthropic-messages). The script handles both transparently.

Examples

# Auto-detect model from OpenClaw config (simplest)
python3 scripts/clawlens.py --verbose

# Auto-detect, English, last 7 days
python3 scripts/clawlens.py --lang en --days 7

# Manually specify model (DeepSeek)
DEEPSEEK_API_KEY=sk-xxx python3 scripts/clawlens.py --model deepseek/deepseek-chat

# OpenAI, English, last 7 days
OPENAI_API_KEY=sk-xxx python3 scripts/clawlens.py --model openai/gpt-4o --lang en --days 7

# Verbose, save to file
ANTHROPIC_API_KEY=sk-xxx python3 scripts/clawlens.py --model anthropic/claude-sonnet-4-20250514 --verbose -o /tmp/clawlens-report.md

# HTML report (dark-themed, self-contained)
DEEPSEEK_API_KEY=sk-xxx python3 scripts/clawlens.py --model deepseek/deepseek-chat --format html -o /tmp/clawlens-report.html

Output

The script outputs a report to stdout (or to the file specified by -o). Progress messages go to stderr when --verbose is set.

  • Markdown (--format md, default): Plain Markdown report. Present it directly to the user.
  • HTML (--format html): Self-contained dark-themed HTML file with glassmorphism styling, animated stat cards, CSS bar charts, and interactive navigation. Opens directly in any browser — no external dependencies. Requires the markdown Python package for Markdown-to-HTML conversion.

The report includes all dimensions: usage overview, task classification, friction analysis, skills ecosystem, autonomous behavior audit, and multi-channel analysis.

Present the output directly to the user. Do not summarize or truncate it.

Model Configuration

--model is optional. If omitted, the model is automatically resolved from OpenClaw configuration:

  1. Reads primary model from ~/.openclaw/openclaw.json (agents.defaults.model.primary, e.g. kimi-code/kimi-for-coding)
  2. Looks up the provider's baseUrl and api type (e.g. openai-completions, anthropic-messages)
  3. Retrieves API key/token from ~/.openclaw/agents/{agentId}/agent/auth-profiles.json
  4. Maps to litellm format automatically (e.g. openai/kimi-for-coding with custom api_base)

If you prefer to specify a model manually, use --model with litellm's provider format:

Provider --model value Required env var
DeepSeek deepseek/deepseek-chat DEEPSEEK_API_KEY
OpenAI openai/gpt-4o OPENAI_API_KEY
Anthropic anthropic/claude-sonnet-4-20250514 ANTHROPIC_API_KEY
OpenAI-compatible openai/\x3Cmodel-id> + set OPENAI_API_BASE OPENAI_API_KEY

The format is always \x3Cprovider>/\x3Cmodel-id>. Refer to litellm docs for the full list of supported providers and their env var naming conventions.

Data Source

The script reads conversation data from:

  • ~/.openclaw/agents/{agentId}/sessions/sessions.json (session index)
  • ~/.openclaw/agents/{agentId}/sessions/*.jsonl (per-session logs, including unindexed historical files)
  • ~/.openclaw/skills/ (installed skills directory for ecosystem analysis)

Cache is written to ~/.openclaw/agents/{agentId}/sessions/.clawlens-cache/facets/ to avoid re-analyzing the same sessions.

Privacy Notice

This skill sends conversation transcript data to an external LLM provider (specified by --model) for analysis. Specifically:

  • Stage 2 (Facet Extraction): Each session's conversation transcript (truncated to ~80K chars) is sent to the LLM to extract structured analysis (task categories, friction points, etc.). Results are cached locally so each session is only sent once.
  • Stage 4 (Report Generation): Aggregated statistics and session summaries (not raw transcripts) are sent to the LLM to generate the report sections.

API key handling: When --model is omitted, this skill reads openclaw.json and auth-profiles.json to auto-detect the model and retrieve the API key. The API key is used only for LLM calls during report generation and is not stored or transmitted elsewhere. When --model is specified explicitly, the user must provide the API key via environment variables — no OpenClaw config files are accessed for credentials.

安全使用建议
This skill legitimately needs to read your OpenClaw session logs and (with your permission) use your configured LLM provider to analyze them. Before installing/running: 1) Review and confirm the script will prompt you before using the auto-detected model (SKILL.md requires asking the user). 2) Understand that session transcripts will be sent to the chosen LLM provider — if you care about privacy, use a provider and API key you trust or run with a dedicated key with limited scope. 3) If you prefer more control, run the script locally with --model and an explicit API key you provide at runtime rather than letting it auto-read auth-profiles.json. 4) Inspect scripts/clawlens.py yourself (or run it in an isolated environment) if you are concerned about accidental exfiltration. 5) Note the minor metadata mismatch: the registry lists no required env vars while SKILL.md documents optional provider keys — this is not a functional problem but worth being aware of.
功能分析
Type: OpenClaw Skill Name: clawlens Version: 1.0.5 The skill requires high-privilege access to the OpenClaw environment, specifically reading all historical conversation logs and extracting plaintext API keys or OAuth tokens from 'auth-profiles.json' (scripts/clawlens.py). It transmits truncated conversation transcripts to external LLM providers via litellm to perform 'facet extraction' and report generation. While these actions are documented in SKILL.md and aligned with the stated purpose of providing usage insights, the automated extraction of credentials and bulk exfiltration of private chat history to third-party APIs constitutes a significant security and privacy risk.
能力评估
Purpose & Capability
The skill claims to analyze conversation history and surface usage/fraction points; the code and SKILL.md access session files, the skills directory, and OpenClaw model config/auth profiles, and call an LLM for analysis — all of which are coherent with that purpose.
Instruction Scope
The runtime instructions and script read ~/.openclaw/agents/{agentId}/sessions/*.jsonl and ~/.openclaw/agents/{agentId}/agent/auth-profiles.json and send conversation summaries to an LLM provider. Reading transcripts is required for analysis, and reading auth-profiles.json is used to auto-detect and use the configured provider key. This is expected, but it is sensitive: transcripts and possibly API keys will be used to make external LLM calls. The SKILL.md also instructs the agent to prompt the user before using the auto-detected model, which mitigates surprise but requires that the agent implement that confirmation step correctly.
Install Mechanism
There is no install spec (no external downloads). The skill is a Python script that depends on litellm and markdown packages per SKILL.md. Running the script requires Python and those libraries to be present; nothing in the repository pulls code from untrusted URLs or performs opaque installs.
Credentials
Registry metadata lists no required env vars, while SKILL.md documents optional provider API keys (DEEPSEEK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY) when the user explicitly requests a manual model. The script also auto-reads auth-profiles.json to obtain stored API tokens for auto-detect — this is proportionate to the feature but is sensitive because it exposes stored provider credentials to the running script.
Persistence & Privilege
always is false and the skill writes only a cache folder under the agent's sessions directory (.clawlens-cache). It does not request permanent inclusion or modify other skills’ configs. Autonomous invocation is allowed by default (disable-model-invocation:false), which is normal for skills; combine this with the sensitive reads only if you plan to let it run without prompting.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawlens
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawlens 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.5
Clawlens 1.0.5 introduces auto-detection of the LLM model and improved integration with OpenClaw configuration: - Adds automatic model and API key resolution from `openclaw.json` and `auth-profiles.json` when `--model` is not specified. - Updates required environment variable logic: env vars are only needed if the user sets `--model` manually. - Expands file access: now also reads `openclaw.json` and `auth-profiles.json` for agent configuration and credentials. - On user invocation, if no model is specified, prompts the user whether to use the model from OpenClaw config or supply a custom one. - Retains all previous features for report generation and data privacy.
v1.0.4
- Added Markdown-to-HTML output: generate a dark-themed, self-contained HTML report with visualizations and interactive navigation, using the new --format html option. - Added dependency on the markdown Python package for HTML conversion. - Updated documentation to reflect support for both Markdown and HTML output formats. - No changes to functionality or code, only to documentation and build artifacts.
v1.0.3
- Added clear documentation of required environment variables and external data usage. - Listed all data paths read and written by the skill for transparency. - Noted that conversation transcripts are sent to the external LLM provider for analysis. - Described caching of analysis results to avoid redundant LLM calls. - Clarified that API keys must be set by the user and are not stored or read by the skill. - Included a privacy notice detailing exactly what data is sent externally and when.
v1.0.2
- The --model option is now required; automatic model detection from OpenClaw config has been removed. - Updated instructions and examples to reflect the need for explicit model and API key specification. - Clarified environment variable requirements for supported LLM providers. - No code changes; documentation only.
v1.0.0
Initial release of Clawlens: OpenClaw usage insights tool. - Provides a script to analyze OpenClaw conversation history and generate a comprehensive Markdown report. - Outputs include usage overview, task classification, friction analysis, skills ecosystem mapping, autonomous behavior audit, and multi-channel usage. - Supports user-invoked commands like "show me my usage report" to trigger a full analysis. - Offers flexible options: analysis window, language (Chinese/English), model selection (auto-detects from config or specified), session limit, concurrency, and output control. - Integrates with litellm for model and API key handling, compatible with multiple LLM providers. - Reads data directly from OpenClaw’s session and skills directories to power deep insights.
元数据
Slug clawlens
版本 1.0.5
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 5
常见问题

clawlens 是什么?

What do you use Claw for most? Where do you get stuck? Clawlens analyzes your conversation history to surface usage patterns, friction points, and skill effe... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 280 次。

如何安装 clawlens?

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

clawlens 是免费的吗?

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

clawlens 支持哪些平台?

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

谁开发了 clawlens?

由 DunZhang(@dunzhang)开发并维护,当前版本 v1.0.5。

💬 留言讨论