agentic-usage-ledger
Manages usage counters for agent activity, token consumption, and energy on a specific project site.
Install
mkdir -p .claude/skills/agentic-usage-ledger && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19177" && unzip -o skill.zip -d .claude/skills/agentic-usage-ledger && rm skill.zipInstalls to .claude/skills/agentic-usage-ledger
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Update, audit, and display Codex or agentic usage counters for this customized DylanTao/Sirui `dylantao.github.io` site. Use when touching account-lifetime or local Codex tokens, agent-hours, commits, energy, tree-equivalence, API-rate estimates, freshness hooks, `_data/agentic_usage.yml`, `docs/agentic-usage-ledger.md`, or the homepage usage counter, especially before committing or pushing site changes.Key capabilities
- →Read agentic usage data from specified files
- →Update visible homepage numbers from usage data
- →Refresh Scholar citations locally
- →Audit agentic usage to estimate pending commits
- →Format generated ledger files
- →Recompute energy equivalence and API cost estimates
How it works
The skill reads and updates agentic usage counters by auditing Codex and agentic activity, refreshing citations, estimating pending commits, and recomputing various metrics for site reporting.
Inputs & outputs
When to use agentic-usage-ledger
- →Update site usage stats
- →Audit agentic activity
- →Refresh citation data
About this skill
Agentic Usage Ledger
Use this skill when updating, auditing, or displaying Codex/agentic usage counters for this customized dylantao.github.io site.
Workflow
- Read
docs/agentic-usage-ledger.mdand_data/agentic_usage.yml. - Keep the visible homepage numbers powered by
_data/agentic_usage.yml; do not hardcode duplicate totals in templates.- The homepage contact ledger renders the quiet
Build ledger · since …caption above four compact stat cells for site-build tokens, agent-hours, commits, and estimated kWh; do not restore the former tree-sacrifice headline. - The token cell may carry one focusable price-replay disclosure sourced only from
total.api_cost_equivalence.usd_label. Keep the visible copy to the Sam-money punchline plus one plain footnote: it prices site-build tokens at public API rates and is not a real bill. Keep request-replay and unavailable cache-write methodology indocs/agentic-usage-ledger.md, not in the tooltip. - Never price or visually associate that disclosure with the independent rounded combined-lifetime heartbeat. Keep conversion detail and cutoff context in
docs/agentic-usage-ledger.mdand the compact disclosure, not as extra paragraphs or a fifth stat cell.
- The homepage contact ledger renders the quiet
- Before pushing this customized site, run the publish freshness gate:
- rely on the daily Google Scholar workflow for routine citation freshness;
- refresh Scholar locally with
python bin/update_scholar_citations.py --forceonly when_data/citations.ymlis more than one day stale or publication pages changed; - before the final commit, run
python bin/audit_agentic_usage.py --write --include-pending-commitso the helper can estimate the pending commit and update_data/agentic_usage.yml; - immediately format the generated ledger with
npx.cmd prettier _data/agentic_usage.yml --write, then review and stage only the intended files; - after committing, rerun
python bin/audit_agentic_usage.pyread-only and update the ledger again only if visible labels, commit counts, rounded hours, rounded energy/tree, or rounded cost labels changed.
- Recount commits after the relevant work is committed when possible. Prefer the read-only helper over ad hoc scripts:
python bin/audit_agentic_usage.py- The helper fails closed in a shallow checkout. Fetch complete history before checking or writing; never accept shallow
git rev-listcounts as ledger truth.
- Establish the source hierarchy, then estimate scoped Codex tokens:
- Direct account publication is one anonymous rounded combined lifetime total.
_data/direct_usage_tracker.jsonis primary for that surface; it exposes no source-level readings and is never added to retained-session estimates. - For repo-attributed usage, scan every retained year under
~/.codex/sessionsand include a JSONL file when its firstsession_meta.payload.cwdcontainsdylantao.github.io; the firstsession_meta.payload.idis the leaf session identity, while later copied parent metadata is ancestry. - read ordered
turn_contextrecords forturn_id,model, andeffortattribution; - globally dedupe copied ancestry by
(turn_id, full total_token_usage snapshot), keeping the earliest retained event; - sum unique
payload.info.last_token_usagedeltas; use positive cumulative deltas only as a conservative fallback for legacy events without additive usage; - keep missing-context usage visible as
unknown/unknownrather than inventing model attribution. - Publish
local_lifetimeas a separate fork-aware retained-device slice across every local leaf session since Jun 19, 2026. Treat this cumulative evidence as monotonic: preserve the last audited snapshot when a scan is empty or lower, and refresh only from a nondecreasing complete-enough retained archive. Its roughly 7.7B-token checkpoint is not account lifetime. - Never promote Win-CodexBar 0.42 raw 30-day totals to canonical evidence. They count files/forks and cumulative snapshots, which duplicates copied ancestry and intermediate totals.
- Direct account publication is one anonymous rounded combined lifetime total.
- Estimate active agent-hours from the globally unique context and token-event timeline for each leaf session. Cap each gap at 45 minutes, keep parallel leaf sessions additive, and attribute a gap to the model/effort active at its start.
- If logs are missing, use a conservative commit-density estimate and record that assumption in
docs/agentic-usage-ledger.md. - Round public labels for readability, but keep the evidence trail in markdown.
- Recompute energy equivalence whenever token totals change:
kWh = token_count * Wh_per_token / 1000kg_CO2e = kWh * 0.373tree_years = kg_CO2e / 60cut_tree_equivalent = kg_CO2e / 600- midpoint
Wh_per_token = 0.0006 - range
Wh_per_token = 0.0002-0.002 - cut-tree basis
600 kg CO2e, derived from EPA's urban-tree annual sequestration over 10 years.
- Recompute and keep the price estimates separate whenever token totals change:
- local
api_cost_equivalencereplays retained requests using current Standard API rates; any rendered amount comes from its generatedusd_labelrather than a hardcoded estimate; gpt-5.5andgpt-5.6-soluse the same short-context rates: $5 / 1M uncached input, $0.50 / 1M cached-read input, and $30 / 1M output;- when a request has more than 272,000 input tokens, use the long-context rates of $10 / 1M uncached input, $1 / 1M cached-read input, and $45 / 1M output;
xhighandultrado not add a separate price; they are effort labels, not pricing tiers;- the rounded combined lifetime checkpoint never receives an API-cost conversion;
- record the documented
gpt-5.6-solcache-write rates, but do not apply them because retained logs do not identify cache-write tokens; - retain the former
gpt-5.3-codexmath aslegacy_api_cost_equivalencefor historical comparison only; - retain
codexbar_cost_estimateonly as historical diagnostic provenance; never render it or use it to price current public stats. - Treat every dollar figure as an API-rate estimate, never an actual Codex product, subscription, or account bill.
-
Keep
model_trackingtied to the declared development defaultgpt-5.6-sol/ultrafrom2026-07-09T21:28:23.394Z. Build this policy check from the deduplicated all-local retained context inventory, even when repo-cwd session attribution is unavailable; site usage scopes remain repo-filtered and preserve their last audited nonzero snapshot. Render every deviation truthfully. Accept one only when its exact(turn_id, timestamp, model, effort)signature has a per-turn reason and provenance in the versioned in-repo acknowledgment mapping; never add a blanket flag or environment bypass.--checkmust fail onunobservedtracking or any unacknowledged deviation, so every new deviation fails closed. Keep the homepage model note data-driven frommodel_tracking.public_noteand treat it as the declared current default, not a claim of perfect historical alignment. -
Frame public environmental copy as a "tree-cut lens" only when it is a stored-carbon equivalence. Do not imply instant emissions from cutting a tree, and do not round small values up to one tree.
Scope Rules
- Full site revamp counter starts at May 22, 2026 6:05 PM Pacific.
_data/direct_usage_tracker.jsonis the only public direct-account surface and contains one rounded combined lifetime total plus terse provenance, with no source-level readings.- Retained local history starts at June 19, 2026 12:00 AM Pacific and spans every locally retained Codex session after global ancestry deduplication. Keep its session count and model mix visible in the data file, label its request-aware price replay as an estimate rather than a bill, and never present this retained slice as account lifetime.
- Win-CodexBar 0.42 raw 30-day aggregation is diagnostic provenance only, not a canonical usage or price source.
- 3D desk/vinyl counter starts at June 16, 2026 8:00 PM Pacific.
- Keep 3D commit counts path-scoped to the homepage vinyl/desk/coffee/3D-scene work. Its token and hour labels are explicitly an all-repo retained-session time-window estimate after the desk cutoff, not desk-only attribution.
- Keep energy/cut-tree copy understated and caveated; true Codex inference energy is not exposed in the logs, and tree carbon varies by species, age, wood fate, roots, soil, and future growth.
When not to use it
- →When not updating, auditing, or displaying usage counters for the dylantao.github.io site
- →When hardcoding duplicate totals in templates instead of using _data/agentic_usage.yml
- →When not needing to run the publish freshness gate before committing site changes
Limitations
- →Visible homepage numbers must be powered by _data/agentic_usage.yml
- →Conversion detail and cutoff context must be in docs/agentic-usage-ledger.md and the homepage info tooltip
- →The helper fails closed in a shallow checkout
How it compares
This skill provides a specific workflow for maintaining and reporting agentic usage data for a customized GitHub site, including detailed steps for data integrity and freshness, unlike general site updates.
Compared to similar skills
agentic-usage-ledger side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| agentic-usage-ledger (this skill) | 0 | 11d | No flags | Advanced |
| dbt-transformation-patterns | 6 | 2mo | No flags | Intermediate |
| skills | 0 | 4mo | Review | Beginner |
| MinerU Document Extractor | 0 | 2mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by DylanTao
View all by DylanTao →You might also like
dbt-transformation-patterns
wshobson
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
skills
second-state
Transcribe speech from audio files to text.
MinerU Document Extractor
opendatalab
>
price-check
wwilson1017
Verify and refresh AI model pricing in Chatty's pricing.py from official provider pricing pages, and regenerate PRICING.md. Run during any PR that touches providers or usage. Skips re-fetching if pricing was already verified earlier in the current chat. Only operates inside the Chatty repo.
hugging-face-evaluation
FISCFED9
Add and manage evaluation results in Hugging Face model cards. Supports extracting eval tables from README content, importing scores from Artificial Analysis API, and running custom model evaluations with vLLM/lighteval. Works with the model-index metadata format.
ai-dock-history-exporter-executor
Nepopams
Use for scoped AI Dock History Hub, exporter, source metadata, and safe history data workflow changes.