brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
lov-codex-thread-usage从本地 Codex deeplink 或 thread UUID 核算整个线程与最新快照的 token usage;适用于“查这个 Codex 任务消耗”“统计 thread tokens”和 inspect Codex thread usage。
Independent GitHub snapshot · Automated classification · Original documentation governs
把一个本地 Codex deeplink 解析成 thread ID,以只读方式检查 SQLite 快照和 rollout JSONL,给出整个线程、最新计数段和 token 类型的可核验统计。
codex://threads/<uuid> 或 Codex thread UUID,并要求 token 明细或统计口径。Read skill.yaml on every run and resolve the shared user-profile/v1 context.
Current request and explicit flags take precedence over Skill records and shared
preferences. Persist only direct durable user statements through
scripts/profile_store.py; never persist thread IDs, transcripts, credentials,
or inferred private paths.
Read references/skill-composition.md before composing adjacent capabilities.
This Skill owns the local deeplink-to-usage result and has no required sibling
Skill dependency.
SKILL_DIR from the active Skill context.skill.yaml, references/token-semantics.md, and
references/skill-composition.md completely.scripts/codex_thread_usage.py are available.Distinguish these values before reporting:
historical.total_tokens: processed input plus output across all detected
monotonic counter segments in the rollout.state_snapshot.tokens_used: the most recent SQLite cumulative snapshot;
it can reset after resume or a new Codex process.cached_input_tokens: a subset of input, not an additional quantity.reasoning_output_tokens: a subset of output, not an additional quantity.tui_style_total_tokens: non-cached input plus output; useful for parity with
the Codex TUI display, but not a billing estimate.Text report:
python3 "$SKILL_DIR/scripts/codex_thread_usage.py" \
'codex://threads/<uuid>' --details
Machine-readable report:
python3 "$SKILL_DIR/scripts/codex_thread_usage.py" \
'<thread-uuid>' --json
Use --codex-home <directory> only when the user explicitly supplies a
non-default Codex data directory. The script reads message envelopes and token
fields but never emits message bodies.
session_meta.payload.id matches the deeplink UUID.state_snapshot.tokens_used with the last segment total.estimated_segments is nonzero, label the total as accumulated or
estimated rather than exact billing usage.raw_response_completed.events is nonzero, report it separately; it is
exact per event but may be incomplete for older or provider-specific runs.Lead with historical processed tokens, then show input, cached input, output,
reasoning output, the latest SQLite snapshot, segment/reset count, and quality.
Never add cached or reasoning subsets to total_tokens. Do not infer money or
subscription quota from these fields.
PYTHONDONTWRITEBYTECODE=1 python3 "$SKILL_DIR/scripts/test_codex_thread_usage.py"
python3 "$SKILL_DIR/scripts/validate_skill.py" "$SKILL_DIR"
The documented activation phrase must route here; “查看 Codex 账户剩余额度” must remain outside this Skill.
jq, or SQLite CLI required at runtime.