send-agent-telemetry
它能做什么
这个技能把 Claude Code 或 Codex 连接到 Sazabi,使每次会话都可以被搜索。适合希望查看编程智能体做了什么,并追踪 token 用量和费用的团队。
适用场景
- ✓当你想知道你的编程智能体昨晚运行了什么的时候。
- ✓当你想追踪编程智能体会话的 token 用量或费用的时候。
- ✓当你需要审计团队中智能体的全部活动的时候。
技能链接
https://github.com/ParadevAI/Paradev/blob/main/plugins/sazabi/skills/send-agent-telemetry/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把 Claude Code 的会话遥测数据发送到 Sazabi,并且除非我选择加入,否则不要包含提示词内容。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先询问哪些内容可以离开这台电脑,因为提示词和工具输入可能包含敏感数据。然后它会为每个智能体设置接收地址。除非你选择包含,否则提示词导出默认关闭。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
See what your agents did
Claude Code and Codex have built-in OpenTelemetry exporters. Pointed at Sazabi,
every session becomes searchable: prompts, tool calls and results, model
requests with token counts and cost. Then "what did the agents run last night"
and "which sessions cost the most" are questions for sazabi/logs.ask.
0. How the tools work
The Sazabi MCP server lists only two tools, search and execute. Browse
Sazabi's operations with search and namespace: "sazabi" (an empty query
without a namespace lists connected connectors, not Sazabi operations). Before
calling one, repeat search with namespace: "sazabi", the hit's full name as
the query, and includeInputSchema: true to load its arguments. Then run it
with execute as { name, arguments }, the name copied from the hit (for
example sazabi/logs.ask).
1. Decide what may leave the machine
Ask before exporting prompt text. Prompts and tool inputs can contain code, customer data and credentials. Codex always exports tool-call arguments and truncated results, whatever the prompt setting, so say that plainly when the user picks Codex. Default to prompts off unless the user opts in.
2. Get an intake URL per agent
Run sazabi/logSources.list. If there is no source for this agent yet, create
one with sazabi/logSources.create in manual mode (one source per agent:
Claude Code, Codex) and use the intake endpoint it returns. Keep the URL out of
any committed file.
3. Configure the agent
Claude Code reads the env block of ~/.claude/settings.json (or a
project's .claude/settings.local.json, which must stay untracked):
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "<intake URL>",
"OTEL_LOG_USER_PROMPTS": "0",
"OTEL_LOG_ASSISTANT_RESPONSES": "0"
}
}
Set OTEL_LOG_ASSISTANT_RESPONSES explicitly: unset, it follows the prompts
setting. Do not set a metrics exporter; Sazabi does not store Claude Code
metrics.
Codex reads ~/.codex/config.toml. Use one [otel] table with an inline
exporter, and the full logs URL including /v1/logs (Codex does not add it):
[otel]
log_user_prompt = false
exporter = { otlp-http = { endpoint = "<intake URL>/v1/logs", protocol = "binary" } }
If [otel] already exists, edit it in place. A second [otel] header is a
TOML error that stops Codex from starting.
Merge into existing files; never overwrite a user's settings.
4. Prove it
Agents load settings at startup, so start a new session and run one prompt.
Then ask sazabi/logs.ask for claude_code.api_request or codex.api_request
events in the last 15 minutes. Report what is flowing, what is excluded, and a
first useful question, such as cost per session today.
Anti-patterns
- Turning on prompt export without asking. It is the user's data, and sometimes their customers'.
- Committing the settings file. It holds the intake URL.
- Assuming it works. A session that started before the change exports nothing new.
常见问题
默认会发送提示词吗?
不会。技能会保持提示词导出关闭,除非你选择加入。
无论提示词设置如何,Codex 都会发送工具细节吗?
技能说明 Codex 始终会导出工具调用参数和截断后的结果,因此在选择之前你应当知道这一点。
数据到达后我可以问什么?
你可以问哪些会话费用最高,或者某个时间段内智能体运行了什么。
详情
作者的原始描述
Stream coding-agent session telemetry (prompts, tool calls, model requests, tokens and cost) from Claude Code or Codex into Sazabi over OpenTelemetry, with privacy settings chosen on purpose. Use when the user wants observability for their coding agents or agent fleet, to track agent token usage or cost, to audit what agents ran, or to send agent telemetry to Sazabi.
repo: ParadevAI/Paradev
热度
- GitHub 星标
- 16k
- 排名
- #10845
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …