claude-code-audit

A forensic method for examining recent Claude Code sessions to find major improvements to an AI-assisted development workflow.

In plain words
What is it for?
Use it to analyze coding habits and produce concrete skills, project instructions, hooks, or settings changes based on session evidence.
Why use it?
It focuses on a few changes with measurable impact instead of producing a long list of minor suggestions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/petekp/claude-code-setup/claude-code-audit
Any agent
npx skills add petekp/claude-code-setup --skill claude-code-audit
Clone the repo
git clone --depth 1 https://github.com/petekp/claude-code-setup

Made for: Claude Code, Codex.

Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,339 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00174 $0.02339
Opus 5 $0.00087 $0.01170
Sonnet 5 $0.00035 $0.00468
Haiku 4.5 $0.00017 $0.00234

Measured 2d ago against content hash 97c6bb72a409, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-code-audit scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/extract.py, scripts/inventory.py, scripts/render.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- The user's current skills dir (`~/.claude/skills`), CLAUDE.md (`~/.claude/CLAUDE.md`), and settings.json (`~/.claude/settings.json`), for cross-reference.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Enumerates other installed skillslowAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

- The user's current skills dir (`~/.claude/skills`), CLAUDE.md (`~/.claude/CLAUDE.md`), and settings.json (`~/.claude/settings.json`), for cross-reference.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/claude-code-audit/SKILL.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Code Audit

What this is

A disciplined framework for auditing a large sample of the user's Claude Code sessions to find step-change improvements — the 2–3 changes that would transform their workflow, not the 20 that would polish it.

The default behavior when asked "how can I improve my workflow" is to produce a long list of marginal suggestions. That output is worse than useless: it buries real leverage under pleasant-sounding noise, and the user does nothing with it. This skill exists to prevent that outcome.

The guarantee

By the end of this audit you will have produced:

  1. A short prioritized report — the few findings that would actually move the needle, with quantified evidence.
  2. Drafted implementations — ready-to-install skills, CLAUDE.md rules, hook scripts, or settings diffs for the top recommendations. Not suggestions. Actual drafts.
  3. A paper trail — the extracted data, sampled session list, and subagent findings, so the user can verify the synthesis and revisit it later.

If you end the audit having produced only observations, you have failed.

Step-change vs marginal — hold this distinction the whole way

Marginal Step change
"You should use skill X more often" "Skill X never triggers on prompts like these — its description excludes the phrasing you actually use. Here's a new description."
"You correct Claude a lot about testing style" "You've given the same correction 14 times in 30 days. The root pattern is Claude defaults to unit tests when you want integration tests. Here's a CLAUDE.md paragraph that eliminates the correction loop."
"Consider adding tests earlier" "19 of your 60 sessions have a 'test afterward' → 'fix regression' → 'fix another regression' loop that averages 35 min and 80k tokens. A pre-commit hook that runs your existing test script would short-circuit it."

The left column is observation. The right column is diagnosis plus prescription plus evidence. You produce the right column.

Read the full file on GitHub · 156 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 156 lines · 174 tokens per session scan A 97c6bb72a409

Subscribe to this mod's changes

claude-code-audit is a skill published in the GitHub repository petekp/claude-code-setup (45 stars, last pushed 26d ago), licensed MIT. It adds 174 tokens to every session and 2,339 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 2 findings (reads agent configuration directories, enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

forget

Delete specific observations from agentmemory after showing them and getting explicit confirmation. Use when the user says "forget this", "delete memory", "remove that note", or wants to scrub specific data for privacy.

rohitg00/agentmemory · 43 tokens

handoff

Resume the most recent agent session for the current working directory, leading with any unanswered question. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.

rohitg00/agentmemory · 55 tokens

lesson

Save a correction or hard-won rule as a confidence-weighted lesson that resurfaces before similar work. Use when the user corrects your approach, says "learn this", "always" or "never do X", or you notice yourself repeating a past mistake.

rohitg00/agentmemory · 55 tokens

memory-discipline

The session loop that makes agentmemory pay off, recall before starting work, save at decision points, learn from corrections. Use when starting a nontrivial task, after settling a decision or debugging a gotcha, or whenever deciding if something belongs in memory.

rohitg00/agentmemory · 56 tokens

remember

Save an insight, decision, or learning to agentmemory's long-term storage with searchable concept tags. Use when the user says "remember this", "save this", "note that", "don't forget", or wants to preserve knowledge for future sessions.

rohitg00/agentmemory · 52 tokens

agentmemory-hooks

The agentmemory plugin hooks that capture observations automatically across the agent session lifecycle. Use when explaining how memory gets captured without manual saves, when debugging missing observations, or when tuning what gets recorded.

rohitg00/agentmemory · 42 tokens