aria-context-monitorlisted
Install: claude install-skill 10CG/aria-plugin
# aria-context-monitor
## 用途
让 AI 机读**当前会话的 context 占用**, 替代"凭感觉"估算 (实证 #104: 凭感觉 +22% 偏差导致不必要暂停)。
数据来自 Claude Code runtime 渲染 statusLine 时 pipe 的 stdin JSON (`context_window_size` /
`used_percentage` 等真实值), 经 statusLine relay 写入 `.aria/cache/context-window.json`, 由本 skill 读取。
底层数据层是 internal skill [aria-token-telemetry](../aria-token-telemetry/SKILL.md) (3 档 fallback)。
---
## 何时使用
- 十步循环 Phase B/C 实施期, AI 判断"当前会话继续 vs 暂停 (形成 commit boundary)"
- 用户问"还剩多少 context"/"该暂停吗"
- 长会话接近窗口上限前的主动预警
**不使用**: 本 skill **只提供数据, 不自动中断会话**。暂停决策由 AI / phase skill 判断 (DEC: 不自动暂停)。
---
## 执行
```bash
python3 "${CLAUDE_PLUGIN_ROOT:-aria}/skills/aria-token-telemetry/scripts/token_telemetry.py" --project-root .
```
读返回 JSON 后, AI 按 `source` 字段选对应口径解读 (见下)。
### 首次使用 / relay 未安装
若返回 `source=transcript_fallback` 或 `confidence=estimate` 且用户期望精确值, 引导安装 relay:
```bash
bash "${CLAUDE_PLUGIN_ROOT:-aria}/skills/aria-context-monitor/scripts/setup_relay.sh" # 幂等注入
bash "${CLAUDE_PLUGIN_ROOT:-aria}/skills/aria-context-monitor/scripts/setup_relay.sh --status" # 查状态
```
注入后需 statusLine **渲染一次** (任意交互) relay cache 才写入; 之后即走 `source=relay_cache` (runtime-truth)。
`setup_relay.sh` 退出码: `0` 成功 (injected / no-op / minimal-reference-created) / `2` 参数错 / `3` jq 缺失 / `4` 找不到 `input=$(cat)` 锚点 / `5` statusLine command 非脚本文件 (需手动注入)。
---
## 输出解读 (口径不混用)
| `source` | `confidence` | 读哪个占用字段 | 含义 |
|----------|-------------|----------------|------|
| `relay_cache` | `high` | **`used_percentage`** (pro