code-audit

code-audit is a skill for Claude Code from EmpiricaAI/empirica. It costs 91 tokens per session (3,234 once invoked), scanned A, original, MIT.

A code-quality investigation that examines a project or selected files for problems such as duplication, dead code, and other maintainability issues. It produces findings and remediation plans but does not change the code.

In plain words
What is it for?
Use it to audit a whole project, directory, or file, or to focus an investigation on one quality concern such as duplicated code.
Why use it?
It helps identify quality problems systematically before someone has to fix them. Separating investigation from implementation gives another agent or developer a clear list of work.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/test_freshness_audit.py --human.

Part of the empirica plugin — 17 skills, 2 commands, 4 agents shipped together

Good fit Use it to audit a whole project, directory, or file, or to focus an investigation on one quality concern such as duplicated code.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/EmpiricaAI/empirica
agentmods
npx agentmods add skills/empiricaai/empirica/code-audit

Made for: Claude Code.

Or install empirica, the plugin that ships this one along with the rest of its 17 skills, 2 commands, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/empiricaai/empirica/code-audit.svg)](https://agentmods.dev/skills/empiricaai/empirica/code-audit)
Your own site
<a href="https://agentmods.dev/skills/empiricaai/empirica/code-audit"><img src="https://agentmods.dev/badge/skills/empiricaai/empirica/code-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,234 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00091 $0.03234
Opus 5 $0.00046 $0.01617
Sonnet 5 $0.00018 $0.00647
Haiku 4.5 $0.00009 $0.00323

Measured 8d ago against content hash bca9a1857971, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

code-audit scanned grade A with 0 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 8d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

empirica/plugins/claude-code-integration/skills/code-audit/SKILL.md · 375 lines

How it starts

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

Code Audit: Noetic Investigation Skill

Investigate code quality. Produce structured remediation plans.

This skill is purely noetic — it discovers, triages, and plans. It does NOT make changes. The output (findings, goals, decisions) feeds directly into the Empirica workflow for any praxic agent to pick up and execute.


How to Run

/code-audit                              # Audit entire project
/code-audit --target src/handlers/       # Audit specific directory
/code-audit --target src/auth.py         # Audit specific file
/code-audit --focus duplication          # Focus on one dimension

Phase 1: Scope

Determine what to audit. If the user specified a target, use it. Otherwise, audit the current project root.

# Determine scope
TARGET="${1:-.}"  # Default to current directory

# Quick size assessment
find "$TARGET" -name "*.py" | wc -l          # File count
find "$TARGET" -name "*.py" -exec wc -l {} + | tail -1  # Total LOC

Log the audit scope:

empirica finding-log --finding "Audit scope: $TARGET — N files, N LOC" --impact 0.1

Phase 2: Automated Tool Passes

Run external tools and parse results into findings. Each tool covers a different dimension. Skip any tool that isn't installed — the audit still works without it.

2a. Linting & Style (ruff)

ruff check "$TARGET" --statistics --output-format json 2>/dev/null

Parse results:

  • Group by rule category (import order, unused imports, complexity, etc.)
  • Log aggregates as findings, not individual violations
  • Impact scoring: unused imports = 0.2, complexity violations = 0.5, security = 0.8
# Example: aggregate finding
empirica finding-log --finding "ruff: 23 unused imports across 8 files (F401)" --impact 0.2
empirica finding-log --finding "ruff: 5 functions exceed complexity limit (C901)" --impact 0.5

2b. Dead Code (vulture)

vulture "$TARGET" --min-confidence 80

Parse results:

  • Filter out false positives (dynamically called functions, CLI entry points)
  • Log confirmed dead code as findings
  • Log uncertain cases as unknowns

Read the full file on GitHub · 375 lines

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. 8d ago First seen · 375 lines · 91 tokens per session scan A bca9a1857971

Subscribe to this mod's changes

code-audit is a skill published in the GitHub repository EmpiricaAI/empirica (247 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 3,234 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.