Sponsor Suno AI Music arrow_forward
Slash Command

Ai Hygiene Audit

Audit codebase for AI-generated code quality issues (vibe coding, Tab bloat, slop)

Type
Slash Command
GitHub stars
339
License
MIT
Repo last updated
Sep 24, 2026

What Ai Hygiene Audit is

Ai Hygiene Audit is a slash command published in the athola/claude-night-market repository on GitHub, which has about 339 stars. The repository describes itself as: “23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context optimization, research, and multi-LLM delegation. 186 skills, 128 commands, 54 agents.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Ai Hygiene Audit gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Ai Hygiene Audit

Claude Code

  1. Download ai-hygiene-audit.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/conserve/commands/ai-hygiene-audit.md, shared under the repository's MIT license. Read the full file on GitHub.

Detect AI-specific code quality issues that traditional bloat detection misses.

When To Use

Use this command when you need to:

  • Suspected AI-generated code quality issues
  • Before major releases to check for hidden debt
  • Reviewing PRs with suspected AI generation
  • After rapid AI-assisted development sprints

When NOT To Use

  • Quick fixes that don't need structured workflow
  • Already know the specific issue - fix it directly

Why This Exists

AI coding creates different problems than human coding:

  • 2024: First year copy > refactor in git history (GitClear)
  • Tab-completion bloat: Similar code repeated instead of abstracted
  • Happy path bias: Tests verify success, miss failures
  • Slop: Documentation that sounds right but lacks depth

Usage

# Full AI hygiene audit
/ai-hygiene-audit

# Focus on specific area
/ai-hygiene-audit --focus git          # Git history patterns
/ai-hygiene-audit --focus duplication  # Tab-completion bloat
/ai-hygiene-audit --focus tests        # Happy-path-only detection
/ai-hygiene-audit --focus docs         # Documentation slop
/ai-hygiene-audit --focus code-debt    # Code-level AI debt signals

# Generate report file
/ai-hygiene-audit --report ai-hygiene-report.md

# Set pass/fail threshold (0-100)
/ai-hygiene-audit --threshold 70

Options

What It Detects

Git History Patterns

  • Massive single commits: 500+ line additions (vibe coding signature)
  • Refactoring deficit: <5% of commits involve refactoring
  • Churn spikes: Code revised within 2 weeks of creation

Duplication (Tab-Completion Bloat)

  • Repeated blocks: 5+ line duplicates across files
  • Similar functions: Near-identical function signatures
  • Copy-paste patterns: Same logic with minor variations

Detection uses built-in detect_duplicates.py script (no external dependencies):

python3 plugins/conserve/scripts/detect_duplicates.py . --min-lines 5
python3 plugins/conserve/scripts/detect_duplicates.py . --format json --threshold 15

Test Quality

  • Happy path only: Tests without error/exception assertions
  • Test deficit: <30% test-to-code ratio by lines
  • Trivial coverage: Tests that verify nothing meaningful

Documentation Slop

  • Hedge word density: "worth noting", "arguably", "to some extent"
  • Formulaic structure: Generic patterns without depth
  • Surface insights: Describes WHAT without explaining WHY

Code-Level AI Debt

  • Comment ratio: >30% comment lines signals restating/narrating code
  • Log density: >3.0 log calls per function signals debug leftovers
  • Guard density: >2.0 null/undefined checks per function signals defensive overengineering
  • Generic naming: handle_data, process_item in domain code where specific terms exist
  • Pass-through wrappers: Functions that delegate without adding logic
  • Docstring bloat: Multi-line docstrings on trivial 2-3 line functions

See the ai-hygiene-auditor agent for thresholds and false-positive exclusions.

Dependency Verification

  • Hallucinated packages: Imports for non-existent modules
  • Slopsquatting risk: Plausible-sounding fake packages

Example Output

=== AI Hygiene Audit ===
Score: 62/100 (MODERATE CONCERN)

FINDINGS:

[HIGH] Tab-Completion Bloat
  src/handlers/*.py: 4 near-identical classes
  Recommendation: Extract to shared base class
  Impact: ~2,400 duplicate tokens

[HIGH] Happy Path Tests
  tests/test_api.py: 0 error assertions in 847 lines
  Recommendation: Add pytest.raises tests

[MEDIUM] Refactoring Deficit
  2.3% of commits mention refactoring (target: >10%)
  Recommendation: Add refactoring to sprint goals
…

CI Integration

# GitHub Actions example
- name: AI Hygiene Check
  run: |
    claude "/ai-hygiene-audit --threshold 60 --json" > hygiene.json
    if [ $(jq '.score' hygiene.json) -lt 60 ]; then
      echo "AI hygiene score below threshold"
      exit 1
    fi

Relationship to Other Commands

Workflow:

/bloat-scan --level 2              # Traditional bloat
/ai-hygiene-audit                  # AI-specific issues
/unbloat                           # Address both

See Also

  • ai-hygiene-auditor agent - Implementation details
  • @module:ai-generated-bloat - Detection patterns
  • imbue:scope-guard/anti-overengineering - Agent psychosis warnings
  • Knowledge corpus: agent-psychosis-codebase-hygiene.md

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Ai Hygiene Audit?

Ai Hygiene Audit is a slash command for Claude Code and Claude Cowork from the athola/claude-night-market repository on GitHub. Audit codebase for AI-generated code quality issues (vibe coding, Tab bloat, slop)

How do I install Ai Hygiene Audit in Claude Code?

Download ai-hygiene-audit.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Ai Hygiene Audit in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Ai Hygiene Audit safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.