aria-token-telemetrylisted
Install: claude install-skill 10CG/aria-plugin
# aria-token-telemetry
## 用途
`aria-token-telemetry` 是一个 **internal skill**(复用 [git-remote-helper](../git-remote-helper/SKILL.md) US-012 Layer 3 "internal skill 作跨-skill 共享基础设施"先例),不直接被用户触发。它为以下消费方提供标准化的 Claude Code context/token 数据采集:
- **aria-context-monitor** (user-facing) — 消费实时 context 占用 (used%/remaining%/window)
- **aria-plugin #18 ai-native-estimator** (future) — 复用 raw token counts (per-turn input/output/cache),**独立于 window%** (Q2=a)
核心脚本: `scripts/token_telemetry.py` (stdlib-only Python)。
---
## 数据来源 (3 档 fallback)
数据 schema (statusLine stdin) 是**通用 Claude Code 特性**;relay 抓取依赖 statusLine 配置 + relay marker。
| 档 | 来源 | 何时 | confidence | window_source |
|----|------|------|-----------|---------------|
| 1 | `.aria/cache/context-window.json` (relay cache, fresh) | statusLine 已配 + relay marker + staleness≤阈值 | high (runtime-truth) | `runtime` |
| 2 | setup helper 检测无 relay marker → 提示注入 | 未注入 | — (引导) | — |
| 3 | transcript JSONL 解析 | 无 statusLine / cache 缺失/陈旧/corrupt | estimate | 4 档见下 |
---
## statusLine stdin schema 契约 (TASK-001 BLOCKING gate 固化, 2026-05-29)
> **证据**: 2026-05-29 重新 capture 实测 (`aria-plugin-benchmarks/context-monitor/statusline-stdin-sample.json`),
> 验证 `context_window_size` 真实存在且为 number → gate PASS, 不触发回退条款。
> Claude Code runtime version `2.1.156`。
Claude Code runtime 每次渲染 statusLine 时 pipe 一个 JSON 到 statusLine command 的 **stdin**。冻结契约字段:
```jsonc
{
"model": {
"id": "claude-opus-4-8[1m]", // ✅ 完整 ID 带 [1m] (transcript me