Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Audit Usage

ASecurity

Reads the execution trail the `audit` hook writes into `.claude/audit-usage/` and consolidates it across runs — spend per skill and agent, duration, failure rate, permissions granted, and which report to open next. Answers "what has this project cost me so far", which no single report answers. Explicit invocation only.

3 stars
0 votes
0 copies
0 views
Added 9/19/2026
ai-agentsjavabashnodespringgit

Works with

terminal

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add ice-lfernandes/claude-spring-architect --skill audit-usage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Audit Usage?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Audit Usage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ice-lfernandes-audit-usage/badge)](https://www.skillsdirectory.com/skills/ice-lfernandes-audit-usage)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: audit-usage
description: >
  Reads the execution trail the `audit` hook writes into `.claude/audit-usage/` and
  consolidates it across runs — spend per skill and agent, duration, failure rate,
  permissions granted, and which report to open next. Answers "what has this project
  cost me so far", which no single report answers. Explicit invocation only.
argument-hint: "[empty for the consolidated view | last | <skill or agent> | <report name fragment>]"
disable-model-invocation: true
allowed-tools: Bash, Read
---

## Consolidated trail

!`java "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/ArchHook.java" audit summary 2>&1`

---

Everything below reads. This skill never writes into `.claude/audit-usage/` and never
edits project code — the trail is written by `ArchHook.java audit`, at `Stop`, and by
nothing else.

Answer in the language of the reports themselves (Portuguese), so the consolidated view
and the per-run report read as one document.

## When the block came back empty

The trail is off: `.claude/audit-usage/` does not exist, and `audit summary` prints
nothing at all. That is the switch, not a failure. Say so, and give the two commands that
turn it on — creating the directory is enough, the hook is already wired in
`.claude/settings.json`:

```bash
mkdir -p .claude/audit-usage
printf '.claude/audit-usage/.state/\n' >> .gitignore
```

Then stop. Do not create the directory yourself: switching a versioned audit trail on is
the user's decision, not a side effect of asking what it holds.

If the block says `execuções fechadas: 0`, no run has **finished** yet. Any report listed
under `⏳ Sem linha no ledger` is from a run in progress — report it as such and say the
ledger line is written only when the run closes.

## What the block already did

`ArchHook.java audit summary` reads `history.jsonl` (one line per top-level run) and
`nodes.jsonl` (one line per skill or agent that run chained) and does the arithmetic:
totals, spend per piece without double counting, failure rate, and the reports worth
opening. The aggregation is Java on purpose — the ledgers grow without bound, and
injecting them raw would cost tokens on every read and leave the sums to you.

**Never recompute a number the block printed, and never read the `.jsonl` files to
re-derive one.** Your job is rendering and judgment, not arithmetic.

What the block's vocabulary means:

- **Peça** — a skill (`📘`) or an agent (`🤖`) of this project. Plugin skills and runtime
  agents are not recorded.
- **Origem** — `usuário` typed `/<skill>`; `modelo` invoked the piece on its own, with no
  run open.
- **raiz · aninhada · pré-carregada** — the piece opened its own run; it was chained
  inside another run; or it was loaded through an agent's `skills:` frontmatter (no
  tokens of its own — they are its agent's).
- **tokens próprios** — a piece's own spend. A run's total minus its chained pieces is
  the root's own; that is why the per-piece bars add up to the totals instead of
  exceeding them.
- **`*` after a cost** — partial sum: some invocations had no price configured.

## Procedure

### 1 · Route on the argument

| Argument | Do this |
|---|---|
| empty | § 2 — consolidated view |
| `last` / `último` | § 3 for the `mais recente` report the block names |
| a skill or agent name (`new-feature`, `java-spring-boot-developer`, …) | § 2 reduced to that piece's line, then § 3 for its newest report: `ls -1t .claude/audit-usage/*--<name>.md` when it ran as a root; otherwise the newest `run` of its line in `grep '"skill":"<name>"' .claude/audit-usage/nodes.jsonl` — a chained piece's report is its parent's |
| any other text | treat it as a fragment of a report filename (`ls -1t .claude/audit-usage`); § 3 for the single match. Two or more matches: list them and ask which |

### 2 · Consolidated view

Present the block, in its order, keeping its tables and the `text` bar chart intact —
bars are proportional to billable tokens, not to duration, which is wall-clock and
includes time the user spent thinking. Then add what the block can't:

1. **One line of reading** above the tables — where the money went, in words.
2. **Health** — name the piece with the worst failure ratio. A piece that fails
   repeatedly is a bad spec, not bad luck.
3. **What to read next** — the single most relevant report, and the exact
   `/audit-usage <fragment>` that opens it.

If the block says `custo: não configurado`, say so and point at
`.claude/audit-usage/pricing.json` — never fill the gap with a price.

### 3 · Single run

`Read` the `.md` file. It is already a finished, icon-rich report — **do not re-render
it and do not paste it back in full.** Summarize in at most six lines: what was run, the
outcome, what it cost, the longest step, and anything that deserves attention
(`⏳ em andamento`, compaction incidents, permissions added, repeated tool failures).
Then give the path so the user can open the whole thing.

Point out `⏳ em andamento` when you see it: it means the run never closed — the session
was killed, or it is still open right now.

## What this skill will not do

- **Never edits or deletes anything under `.claude/audit-usage/`.** Pruning old reports
  is the user's call; if they ask, show the command and let them run it.
- **Never recomputes a cost from memory.** The numbers come from `audit summary`, which
  prices from `pricing.json`. If prices are `null`, the honest answer is "custo não configurado" plus
  the path to fill in — never an invented rate. A price written from memory is wrong the
  day after it changes, and it looks exactly as authoritative as a correct one.
- **Never reads `.state/`.** Those are the hook's open append-only logs; the rendered
  `.md` is the readable form.
- **Never quotes a redacted value.** The reports blank credential-shaped text on the way
  in. If something still looks like a live secret in a report, say so and point at
  `.claude/schemas/extensions.json`'s `audit.redact` block — a pattern is missing there.

## Why this is a skill, and why the hook ignores it

The hook already answers "what happened in **this** run", and `audit summary` does the
sums across runs. Nothing turns that into "which piece is eating the budget, and which
report should I open" — judgment over data, routed by an argument, which is a procedure,
not a norm and not enforcement.

`audit-usage` is one of the skills the trail does **not** record — the observers, listed
in `.claude/schemas/extensions.json` under `audit.exclude_skills` alongside
`arch-doctor`. Without that, reading the trail would append a report about reading the
trail, and every later read would be mostly reads.

Invoking it still **closes** whatever run is open, and that is the useful half: within a
single session a report stays stamped `⏳ em andamento` until something ends the run, so
asking for the report is what finalizes it.

## Contract

- **Reads** — the output of `ArchHook.java audit summary`; `.claude/audit-usage/*.md`;
  `.claude/audit-usage/nodes.jsonl` only to find the report of a chained piece
- **Writes** — nothing
- **Handoff** — none. Terminal skill: it reports and stops

Attribution

ice-lfernandesice-lfernandes
View sourceMore from ice-lfernandes →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

1023331 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3331 votes

catchup

Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.

611 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →