agentleFS
HighwayofLifeHighwayofLife/agent-kaizen/skills/audit/SKILL.md

audit

Skill1 starsChanged 33 days agoMITView on GitHub

Measure where Claude Code and Codex tokens, turns and time go for this project, and rank the biggest savings.

190 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use delight, teach-impeccable and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HK-hubSkill

    delight

    Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

    Also in 32 projects that use this

  • HK-hubSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 20 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 19 projects that use this

  • ww-w-aiSkill

    qa-phase

    Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.

    Also in 3 projects that use this

  • SkillPilotCHSkill

    level-up

    Eine Automatisierung pro Woche finden, scopen, shippen. Output landet als proposed-Eintrag in cadence.md mit konkreten Implementations-Schritten.

    Also in 13 projects that use this

  • +7 more from HK-hub

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not in Claude Code?: Read docs/hosts.md in the plugin root first.

    line 11
  2. Very specific:

    Use the token-audit report for usage and cost sections.

    line 36
  3. Distinctive:

    Not measured by the script: Bash commands of the main session, files read whole, URLs fetched more than once, who read each image, and the …

    line 58
  4. Very specific:

    Write docs/kaizen/audit-<yyyy-mm-dd>.md: a headline (3 lines), the tables above, and a ranked list of the 10 biggest savings, each with …

    line 63
  5. Very specific:

    Run python3 ${CLAUDE_PLUGIN_ROOT}/scripts/token-audit --cwd .

    line 73

“Common” is measured: kept by at least 6 in 10 of the 168 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Usage audit

Plugin root: ${CLAUDE_PLUGIN_ROOT}. If that is still a ${...} placeholder, use the folder that contains skills/ (this file is skills/<name>/SKILL.md), and substitute that path, in quotes, wherever this skill uses CLAUDE_PLUGIN_ROOT. Not in Claude Code? Read docs/hosts.md in the plugin root first. Skip steps that only work in Claude Code, and follow its propose-only rule before changing any host configuration.

Measure where tokens, turns and time actually go, so the changes you make target real costs and not guesses.

Changes: writes a report under docs/kaizen/. Changes no configuration.

Autonomy: follow ${CLAUDE_PLUGIN_ROOT}/docs/autonomy.md. The mode comes from the skill argument (propose, safe, auto or yolo), else docs/kaizen/config.json, else agent-kaizen.json in your Claude config dir ($CLAUDE_CONFIG_DIR or ~/.claude), else propose. In safe and auto, read every "wait for my OK" below as: apply it yourself if the mode allows (backup, verify, roll back on failure, ledger row), otherwise list it as a proposal. Hard stops always ask. At most maxChangesPerRun changes (default 3). End with a summary of what was applied, skipped and rolled back.

Task

Audit my Claude Code and Codex usage for this project. Don't change any configuration.

Data sources (check which exist):

  • Claude Code transcripts: <Claude config dir>/projects/<this project's folder>/.jsonl, plus subagent transcripts in <Claude config dir>/projects/<folder>/<session-id>/subagents/.jsonl.
  • Codex sessions: <Codex home>/sessions/**/*.jsonl.

Rules:

  • Parse with the bundled token-audit script (see Bundled resources), never by reading transcripts yourself; they are huge.
  • Token usage lives in assistant messages (message.usage: input_tokens, cache_creation_input_tokens, cache_read_input_tokens, output_tokens). One message can appear on several lines; de-duplicate by message id before summing.
  • Cost is roughly context size × number of turns, so report both.

Use the token-audit report for usage and cost sections. When present, use this project's project-report-*.md for outcomes, calibration proposals, shadow reviews, slow tests, speed and pending project-ledger rows. Use the global audits folder's checks-*.md for drift, stale rules and notes-ledger measurements due.

Report, for the last 14 days, the sections token-audit prints:

  1. Totals by model (calls, context, cache-read share, output) and main sessions (calls, average and peak context; flagged sessions).
  2. By agent type: spawns, median and max tool calls, context, minutes, brief sizes (Claude and Codex), cost share, models and effort. Orchestrator turns by trigger.
  3. Main-session tool results (count and characters per tool) and image blocks read in the main session; top Bash command heads per heavy agent.
  4. Codex by model, and by kind, model and effort (sessions, minutes, tokens). Changes since the last audit with the same scope, and flagged regressions.
  5. Cost (API-equivalent): cache-aware cost by agent type and model, using published prices in scripts/pricing.json, with shares for cache reads, writes, uncached input and output. This is a comparison weight, not a bill; most users have subscriptions.
  6. Stuck turns: repeated failures (same tool, command or file, and first error line) at least 3 times in a turn, with count, share, tool calls, cost and top signatures.
  7. Repeated failures across sessions: failures in at least 3 sessions per project, with a "worked instead" hint when a later command variant succeeded; these are repo-fact candidates.
  8. Unused tools and MCP servers: per project, unused over at least 10 prompts across 2 sessions, or at least 5 sessions; mark deferred or loaded in full when known.

Not measured by the script: Bash commands of the main session, files read whole, URLs fetched more than once, who read each image, and the waste patterns (sessions that never compact, relay wrappers, grep-read loops, many small spawns). Say so in the report where it matters; rank only what the numbers show.

Write docs/kaizen/audit-<yyyy-mm-dd>.md: a headline (3 lines), the tables above, and a ranked list of the 10 biggest savings, each with estimated tokens saved per week, effort (S/M/L), risk, and which prompt or change addresses it. If docs/kaizen/LEDGER.md exists, fill in "measured effect" for earlier rows that this audit can now measure. Rank findings from all sections by API-equivalent dollars where available, and tokens otherwise. Finish by recommending the first 3 changes.

Bundled resources

Run python3 ${CLAUDE_PLUGIN_ROOT}/scripts/token-audit --cwd . --days 14 --out docs/kaizen/. --cwd uses the project path. --project filters by substring. On exit 4, use the report and relay the extract warning.

Done when

a dated audit with numbers. For us, the largest items were:

  • main-session context of 450k–560k tokens;
  • about 150 relay-agent spawns at roughly 80k tokens each;
  • planners making 150–200 tool calls each;
  • the same history sources fetched hundreds of times.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.