Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计通过

session-token-ledger会话令牌分类账

Agent Skill

session-token-ledger 用于处理数据库查询、表结构、迁移和数据维护任务,适合在 OpenClaw 中需要分析 schema、编写 SQL 或排查数据问题时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

7,030

周安装

290

GitHub Stars

公开资料未说明

下载量

2,297
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:session-token-ledger(会话令牌分类账)
来源仓库:https://github.com/zgjq/session-token-ledger
安装命令:
openclaw skills install session-token-ledger
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install session-token-ledger

简介

分析本地 OpenClaw 会话的令牌使用情况,生成 SQLite 分类账和 Markdown 摘要用于审计。

  • 适用于代币消耗监控、上下文管理优化和会话成本分析等效率相关任务。
  • 通过 openclaw skills install session-token-ledger 安装,需确认数据库读写权限。
  • 依赖本地 SQLite 数据库,建议检查文件系统和存储路径配置。
  • 使用前请核实是否允许访问本地数据、执行查询及导出报告,避免影响系统稳定性。

SKILL.md

name
session-token-ledger
description
Analyze local OpenClaw session token usage from a generated SQLite ledger and markdown summaries. Use when the user asks for a token audit, token体检报告, context-bloat diagnosis, session efficiency review, largest sessions, daily token trends, input/output ratio analysis, cache-read heavy sessions, or wants SQL/SQLite-based inspection of local OpenClaw session usage.

Session Token Ledger

Analyze local OpenClaw session-token usage from a generated ledger stored under this skill.

What lives here

  • scripts/rebuild_sqlite.py — rebuild the local ledger from OpenClaw session transcripts
  • scripts/report.py — generate markdown reports for all sessions or one session
  • references/overview.md — schema, views, and design notes
  • references/queries.sql — canned SQLite queries for common audits
  • references/hook-setup.md — optional OpenClaw hook setup for automatic rebuilds
  • references/ANOMALIES.md — populated after rebuild with suspicious or bad transcript lines
  • assets/session_tokens.db — populated after rebuild; SQLite ledger
  • assets/index.json — populated after rebuild; machine-readable session index
  • assets/TOTAL_TOKENS.txt — populated after rebuild; quick aggregate summary
  • assets/YYYY-MM-DD_N.md — populated after rebuild; one markdown file per completed session

Default workflow

  1. Rebuild the ledger with python3 scripts/rebuild_sqlite.py if data looks stale.
  2. Start with assets/index.json for session list and top-level totals.
  3. If the user wants trends or rankings, inspect assets/session_tokens.db.
  4. If the user wants a narrative for one session, read the matching assets/YYYY-MM-DD_N.md file.
  5. If the user wants root-cause analysis, inspect these views first:

- largest_sessions - usage_efficiency - bloated_sessions - top_context_hogs - daily_efficiency

  1. If something looks wrong, read references/ANOMALIES.md.

Read these references only when needed

  • Read references/overview.md when you need schema or view meaning.
  • Read references/queries.sql when you need canned SQL.
  • Read references/hook-setup.md when you want automatic rebuilds after /new, /reset, /stop, or gateway startup.

Quick path

Generate reports:

python3 scripts/report.py
python3 scripts/report.py --session SESSION_ID
python3 scripts/report.py --save
python3 scripts/report.py --session SESSION_ID --save

Use read-only SQLite queries when available:

sqlite3 -readonly assets/session_tokens.db "SELECT * FROM overall_summary;"
sqlite3 -readonly assets/session_tokens.db "SELECT * FROM largest_sessions LIMIT 10;"
sqlite3 -readonly assets/session_tokens.db "SELECT * FROM bloated_sessions LIMIT 10;"
sqlite3 -readonly assets/session_tokens.db "SELECT * FROM top_context_hogs LIMIT 10;"
sqlite3 -readonly assets/session_tokens.db "SELECT * FROM daily_efficiency ORDER BY date DESC;"

For one session:

sqlite3 -readonly assets/session_tokens.db "SELECT * FROM usage_efficiency WHERE session_id='SESSION_ID';"

If sqlite3 CLI is unavailable, use the bundled Python scripts instead.

Reporting rules

  • Lead with the plain-English conclusion.
  • Separate total tokens, input tokens, output tokens, and cache read.
  • Call out whether waste came from long context, too many topic switches, long outputs, or repeated tool/doc loading.
  • For subscription-style billing, emphasize token totals and efficiency, not fake precision on dollar cost.
  • When giving recommendations, prefer a short ranked list over a long essay.

Boundaries

  • Treat this ledger as local analysis data, not ground truth for provider billing.
  • Do not modify the database unless the user explicitly asks to rebuild or update the ledger.
  • Rebuilds skip the currently active live .jsonl session when a matching .lock file exists, so the ledger defaults to completed sessions only.
  • Prefer querying the DB over manually re-deriving totals from raw session logs unless the ledger appears stale or broken.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenClaw

74.75%
按下载量换算1,717

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills