clawsights
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClawsights — Upload Your Claude Code Stats
Clawsights — 上传你的Claude Code统计数据
Before starting, create a task list with these items so the user can see progress:
- Get GitHub identity
- Generate insights report
- Read and preview report
- Confirm upload preferences
- Upload to Clawsights
- Show results
Mark each task as in_progress when you start it and completed when done. Follow these steps exactly:
开始之前,创建一个包含以下项的任务列表,以便用户可以查看进度:
- 获取GitHub身份信息
- 生成洞察报告
- 读取并预览报告
- 确认上传偏好设置
- 上传至Clawsights
- 展示结果
开始执行每个任务时标记为“进行中”,完成后标记为“已完成”。请严格按照以下步骤操作:
Step 1: Get GitHub Identity
步骤1:获取GitHub身份信息
Tell the user: "I'll grab your GitHub identity so Clawsights can create your profile at clawsights.dev/{handle}."
Run these commands to get the user's GitHub handle and auth token:
bash
gh api user --jq '.login'bash
gh auth tokenIf is not installed or the user is not logged in, tell them:
gh- Install: (or see https://cli.github.com)
brew install gh - Login:
gh auth login
Store the handle and token for later use. Do not show the token to the user.
告知用户:“我将获取你的GitHub身份信息,以便Clawsights在clawsights.dev/{handle}为你创建个人资料。”
运行以下命令获取用户的GitHub用户名和认证令牌:
bash
gh api user --jq '.login'bash
gh auth token如果未安装或用户未登录,请告知他们:
gh- 安装:(或查看https://cli.github.com)
brew install gh - 登录:
gh auth login
保存用户名和令牌以备后用,不要向用户展示令牌。
Step 2: Run /insights
步骤2:运行/insights
Run the skill to generate a fresh report. Wait for it to complete fully.
/insights运行技能以生成一份全新的报告,等待其完全完成。
/insightsStep 3: Read the Report
步骤3:读取报告
Read the file at .
~/.claude/usage-data/report.htmlAlso extract the subtitle line for the preview. It looks like:
<p class="subtitle">38,539 messages across 4769 sessions | 2025-12-19 to 2026-02-09</p>读取位于的文件。
~/.claude/usage-data/report.html同时提取副标题行用于预览,格式如下:
<p class="subtitle">38,539 messages across 4769 sessions | 2025-12-19 to 2026-02-09</p>Step 4: Show Preview and Ask About Narratives
步骤4:展示预览并询问叙事内容相关问题
Display a preview of what will appear on their profile. Extract these from the report HTML and show them:
=== Clawsights Upload Preview ===
GitHub: @{handle}
Date range: {date_from} to {date_to}
Messages: {totalMessages}
Sessions: {totalSessions}
Lines Changed: +{linesAdded} / -{linesRemoved}
Days Active: {daysActive}
Msgs/Day: {msgsPerDay}
Files Touched: {filesTouched}
Top Languages: {top 3 languages from the chart}
How You Use Claude Code:
{first 3 lines of the usage narrative, followed by "..."}
Impressive Things You Did:
{first 3 win titles, followed by "..."}
This will be publicly visible at clawsights.dev/{handle}Omit any section that has no data. Then use the AskUserQuestion tool to ask TWO questions:
Question 1: "Include narrative sections on your public profile?"
- Options:
- "Yes" — Include "How You Use Claude Code" and "Impressive Things You Did" sections on your profile
- "No" — Only show quantitative stats (messages, lines, languages, etc.)
Question 2: "Ready to upload?"
- Options:
- "Upload" — Upload stats to clawsights.dev
- "Cancel" — Don't upload anything
If they choose Cancel, stop here.
Store whether they chose to include narratives as (true/false).
include_narratives展示将出现在个人资料中的预览内容,从报告HTML中提取以下信息并展示:
=== Clawsights上传预览 ===
GitHub: @{handle}
日期范围: {date_from} 至 {date_to}
消息总数: {totalMessages}
会话总数: {totalSessions}
代码行数变更: +{linesAdded} / -{linesRemoved}
活跃天数: {daysActive}
日均消息数: {msgsPerDay}
涉及文件数: {filesTouched}
Top编程语言: {图表中的前3种语言}
你的Claude Code使用方式:
{使用叙事的前3行内容,后跟“...”}
你完成的亮眼成果:
{前3个成果标题,后跟“...”}
此内容将在clawsights.dev/{handle}公开可见省略任何无数据的部分。然后使用AskUserQuestion工具询问两个问题:
问题1: "是否在公开个人资料中包含叙事部分?"
- 选项:
- "是" — 在个人资料中包含“你的Claude Code使用方式”和“你完成的亮眼成果”部分
- "否" — 仅展示量化统计数据(消息数、代码行数、编程语言等)
问题2: "是否准备好上传?"
- 选项:
- "上传" — 将统计数据上传至clawsights.dev
- "取消" — 不进行任何上传
如果用户选择取消,在此处停止操作。
将用户是否选择包含叙事内容保存为(true/false)。
include_narrativesStep 5: Upload
步骤5:上传
First, determine the upload URL. Run this command and use the output as the base URL:
bash
echo ${CLAWSIGHTS_URL:-https://clawsights.dev}Then make a POST request using that base URL:
bash
curl -s -X POST BASE_URL/api/upload \
-H "Content-Type: application/json" \
-d "{\"github_token\": \"TOKEN_HERE\", \"report_html\": $(cat ~/.claude/usage-data/report.html | jq -Rs .), \"include_narratives\": BOOLEAN_HERE}"Replace with the output from the echo command above.
Replace with the actual token from Step 1.
Replace with or based on the user's choice in Step 4.
BASE_URLTOKEN_HEREBOOLEAN_HEREtruefalse首先确定上传URL,运行以下命令并将输出作为基础URL:
bash
echo ${CLAWSIGHTS_URL:-https://clawsights.dev}然后使用该基础URL发起POST请求:
bash
curl -s -X POST BASE_URL/api/upload \
-H "Content-Type: application/json" \
-d "{\"github_token\": \"TOKEN_HERE\", \"report_html\": $(cat ~/.claude/usage-data/report.html | jq -Rs .), \"include_narratives\": BOOLEAN_HERE}"将替换为上述echo命令的输出。
将替换为步骤1中获取的实际令牌。
将替换为用户在步骤4中选择的或。
BASE_URLTOKEN_HEREBOOLEAN_HEREtruefalseStep 6: Show Result
步骤6:展示结果
Parse the JSON response and display:
Uploaded! View your profile: https://clawsights.dev/{handle}
Your percentiles:
Messages: top {X}%
Sessions: top {X}%
Velocity: top {X}%
Scale: top {X}%
Multi-clauding: top {X}%If the upload fails, show the error message from the response.
解析JSON响应并展示:
上传完成!查看你的个人资料: https://clawsights.dev/{handle}
你的百分位排名:
消息数: 前 {X}%
会话数: 前 {X}%
处理速度: 前 {X}%
规模: 前 {X}%
多Claude协作: 前 {X}%如果上传失败,展示响应中的错误信息。