360 Secure SkillHub
360 安全技能中心
当前公开展示的是 Codex Usage Widget。本作品已批准的版本仍可按原地址安装和更新。

Codex Usage Widget Minpublish2

该 Skill 说明如何在 macOS 上安装、更新和卸载一个 Uebersicht 桌面小组件,由本地脚本读取 ~/.codex 下的 SQLite 与 JSONL 数据,按根会话聚合展示最近会话、来源标签和上下文窗口压力。不调用外部 API、不需要模型密钥、不上传数据,并给出安装后运行校验命令的说明。

tinadu-ai
tinadu-ai
热度 0.00
最近更新 2026-07-08 07:26:13
分类:数据依赖:代码执行 / 读写文件应用场景:报告撰写 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add codex-usage-widget-minpublish2
Metadata
name
codex-usage-monitor-doc
description
Install and maintain a local desktop widget for monitoring Codex usage and session context pressure.

Codex Usage Widget

What This Skill Provides

Use this skill to install or maintain a lightweight macOS Uebersicht widget for Codex. The widget reads only local Codex files under ~/.codex:

  • state_5.sqlite for thread metadata.
  • logs_2.sqlite for local log byte totals.
  • sessions/**/*.jsonl and archived_sessions/*.jsonl for token-count events, origin labels, and context-window pressure.

It does not call external APIs, does not require a model key, and does not upload data.

For OpenClaw / Claw users, use this skill when the machine also runs Codex and the goal is to monitor Codex's local ~/.codex state from the desktop.

Install

Run:

scripts/install.sh

The script copies assets/codex-usage-widget/ to:

~/Library/Application Support/Uebersicht/widgets/codex-usage.widget/

Uebersicht should refresh automatically. If it does not, use the Uebersicht menu bar item to refresh all widgets.

Update

Run scripts/install.sh again. The script overwrites only this widget directory and does not touch Codex settings or other Uebersicht widgets.

Uninstall

Run:

scripts/uninstall.sh

This removes only:

~/Library/Application Support/Uebersicht/widgets/codex-usage.widget/

Behavior Notes

  • Recent rows are grouped by root session, so spawned subagents do not appear as separate sessions.
  • Source labels prefer rollout originator: codex_vscode becomes VSCode, Codex Desktop becomes Client, and terminal/CLI-like originators become Terminal.
  • The right-side row metric is context-window pressure, calculated from the latest input_tokens. It uses a 200K window until a session exceeds that level, then uses a 1M window.
  • A root session can be hidden from the recent list after a standard wrap-up prompt plus a short user confirmation such as 23, all, no, or similar local-language variants.
  • The widget is intentionally best-effort because Codex local storage fields may change between Codex releases.

Validate

After installing, run:

python3 "$HOME/Library/Application Support/Uebersicht/widgets/codex-usage.widget/codex-usage.py"

The command should print JSON with "ok": true.