Agentsight
通过命令行或 Dashboard(前端) 查询 AgentSight 平台的 token 消耗数据、token 节省(优化)数据、审计事件和会话中断事件。当用户询问 token 用量、花费、消耗趋势、token 节省、优化效果、LLM 调用、进程行为审计,或询问会话中断、Agent 异常、LLM 错误等中断事件时使用此技能。
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Agentsight when an AI agent needs a reusable SKILL.md workflow for this job: 通过命令行或 Dashboard(前端) 查询 AgentSight 平台的 token 消耗数据、token 节省(优化)数据、审计事件和会话中断事件。当用户询问 token 用量、花费、消耗趋势、token 节省、优化效果、LLM 调用、进程行为审计,或询问会话中断、Agent 异常、LLM 错误等中断事件时使用此技能。
When not to use it
Skip Agentsight when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/agentsight # Save SKILL.md to ~/.claude/skills/agentsight/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/agentsight/SKILL.md. For a shared project, commit the folder at .claude/skills/agentsight/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Agentsight skill for this task: Use Agentsight when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
70/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 70/100
Model compatibility evidence
- claudeinferred
The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.
- chatgptinferred
The skill text mentions ChatGPT or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.
- geminiinferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
- copilotinferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
- llamainferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
- perplexityinferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
- mistralinferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
- grokinferred
The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# Dashboard(前端)
AgentSight 提供 Web Dashboard(前端) 用于可视化查看 token 消耗和会话历史。
**访问方式:** - 远程访问:`http://<server-ip>:7396`(需确保安全组已开放该端口) - 本地访问:`http://127.0.0.1:7396`
**功能:** - Token 消耗趋势图(按天/小时) - 会话历史浏览 - LLM 调用详情查看 - 支持按时间范围、进程过滤
**启动服务:** ```bash # 如果服务未运行,启动它 sudo systemctl start agentsight
# 查看服务状态 sudo systemctl status agentsight ```
---
# Token 查询
## 常用命令
| 命令 | 说明 | |------|------| | `/usr/local/bin/agentsight token --period today` | 今天消耗 | | `/usr/local/bin/agentsight token --period yesterday` | 昨天消耗 | | `/usr/local/bin/agentsight token --hours 3` | 最近 3 小时 | | `/usr/local/bin/agentsight token --period today --compare` | 今天 vs 昨天对比 |
## 返回示例
``` 今天共消耗 125,000 tokens,比昨天(98,000)增长 27%。
输入: 125,000 | 输出: 85,000 ```
---
# 审计查询
## 常用命令
| 命令 | 说明 | |------|------| | `/usr/local/bin/agentsight audit` | 最近 24 小时事件 | | `/usr/local/bin/agentsight audit --last 48` | 最近 48 小时 | | `/usr/local/bin/agentsight audit --pid 12345` | 指定进程 | | `/usr/local/bin/agentsight audit --type llm` | 仅 LLM 调用 | | `/usr/local/bin/agentsight audit --type process` | 仅进程行为 | | `/usr/local/bin/agentsight audit --summary` | 汇总统计 | | `/usr/local/bin/agentsight audit --summary --last 72` | 最近 72 小时汇总 | | `/usr/local/bin/agentsight audit --json` | JSON 格式 |
## 返回示例
**汇总输出:** ``` === Audit Summary (last 24 hours) ===
LLM calls: 42 Process actions: 128
Providers: OpenAI: 35 calls Anthropic: 7 calls
Top commands: python agent.py: 25 times node server.js: 17 times ```
**事件列表(JSON):** ```json {"event_type":"llm_call","pid":1234,"comm":"python", "extra":{"provider":"OpenAI","model":"gpt-4o","input_tokens":1500,"output_tokens":800}} ```
## 事件类型
| 类型 | 字段 | |------|------| | `llm_call` | provider, model, input_tokens, output_tokens, request_path, response_status, is_sse | | `process_action` | filename, args, exit_code |
---
# 会话中断查询
数据库:`/var/log/sysak/.agentsight/interruption_events.db`
中断类型:`llm_error`、`sse_truncated`、`context_overflow`、`agent_crash`、`token_limit` 严重级别:`critical` > `high` > `medium` > `low`
使用 `/usr/local/bin/agentsight interruption --help` 查看所有子命令和参数。
---
# Token 节省查询
`GET /api/token-savings` — 参数:`start_ns`、`end_ns`、`agent_name`;数据源:`genai_events.db` + `~/.tokenless/stats.db` `GET /api/agent-names` — 获取可选的 `agent_name` 值列表
---
# 注意事项
- 数据存储:`/var/log/sysak/.agentsight/agentsight.db`(SQLite) - 默认保留:7 天 - 时间戳:纳秒级 Unix 时间戳 - 权限:需要 root 运行 eBPF
Intended uses
- Use Agentsight when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.