code-hygiene

code-hygiene is a skill for Claude Code, Codex from sjarmak/coding-agent-workflows. It costs 124 tokens per session (1,426 once invoked), scanned A, original, MIT.

A read-only audit and optional cleanup process for accumulated code and test clutter. It looks for weak tests, dead code, temporary workarounds, swallowed errors, stale references, commented-out history, and oversized units, using repository evidence before changes.

In plain words
What is it for?
Use it to create an evidence ledger of hygiene issues and, when cleanup is requested, apply one focused batch and verify that coverage was not lost. It can cover both tests and production code.
Why use it?
Code that looks unused or unnecessary may still be reached through plugins, configuration, reflection, generated code, or scheduled jobs. The audit reduces accidental removal by checking callers, tests, CI, and history first.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: mentions CLAUDE.md; mentions AGENTS.md; built for openclaw.

Good fit Use it to create an evidence ledger of hygiene issues and, when cleanup is requested, apply one focused batch and verify that coverage was not lost. It can cover both tests and production code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sjarmak/coding-agent-workflows/code-hygiene
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.

Any agent
npx skills add sjarmak/coding-agent-workflows --skill code-hygiene
Clone the repo
git clone --depth 1 https://github.com/sjarmak/coding-agent-workflows

Made for: Claude Code, Codex.

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-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/code-hygiene/github.svg)](https://agentmods.dev/skills/sjarmak/coding-agent-workflows/code-hygiene)
Your own site
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/code-hygiene"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/code-hygiene/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/code-hygiene"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/code-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,426 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.
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.00124 $0.01426
Opus 5.5 $0.00050 $0.00570
Sonnet 5.5 $0.00025 $0.00285
Haiku 4.5 $0.00012 $0.00143

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

Security

Grade A, and why

code-hygiene 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 14d 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.

source/skills/code-hygiene/SKILL.md · 121 lines

How it starts

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

Code Hygiene

A periodic sweep for the cruft that accumulates between reviews. It has one value bar and two modes. Audit is read-only and ends in a ledger with evidence for every candidate. Cleanup applies one coherent batch from an audited ledger, proves nothing lost coverage, and stops. Run audit alone unless cleanup was asked for.

The test half is adapted from OpenClaw's test-audit skill (github.com/openclaw/openclaw, .agents/skills/test-audit, MIT). The production half applies the same evidence discipline to non-test code.

When the audit includes performance, combine this skill with perf-audit. Both can use the same ledger shape; a hygiene-only audit does not need a benchmark.

Before judging anything

Read the repository's root and scoped AGENTS.md / CLAUDE.md files first; they may declare contracts, generated files, or deliberate holds. Then, for each candidate, read the complete unit and its owner: entry points, callers, callees, siblings, overlapping tests, CI routing, and git log -L / git blame history. A thing that looks dead may be reached by reflection, a CLI entry point, a plugin registry, a config string, a cron/order file, or another repository. Search the whole workspace for the name, not just the package.

What to hunt

Tests

  • assertion-free coverage probes; tests that only check "did not throw";
  • self-comparisons: the expected value is produced by the code under test;
  • copied fixtures, manifests, or export lists that restate the source;
  • exact source, import, or string greps where a behavior check exists;
  • private helper or call-shape tests duplicated at a real boundary;
  • the same contract asserted at every layer it crosses;
  • mocks that implement the behavior being asserted, or one mock standing in for several different APIs;
  • fixtures that supply what the owner should produce (ordering, receipts, persistence into a store the real path never writes);
  • negative controls that pass for an unrelated reason (a different guard rejects first; the rejected path is unreachable);
  • names that promise more than the assertions check;
  • regression tests that never demonstrably failed on the unfixed code;
  • skipped, xfail, or quarantined tests with no named clearing condition.

Read the full file on GitHub · 121 lines

Files

What ships with it

1 file 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. 14d ago First seen · 121 lines · 124 tokens per session scan A e1a77cc81708

Subscribe to this mod's changes

code-hygiene is a skill published in the GitHub repository sjarmak/coding-agent-workflows (6 stars, last pushed 14d ago), licensed MIT. It adds 124 tokens to every session and 1,426 once invoked, about $0.0005 per session on Opus 5.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-10-02.

Related

Other skills, from other repositories

code-review

Review .NET changes for bugs, regressions, architectural drift, missing tests, incorrect async or disposal behavior, and platform-specific pitfalls before you approve or merge them. USE FOR: reviewing a pull request or patch in a .NET repository; checking for behavioral regressions, API misuse, or missing tests…

managedcode/dotnet-skills · 118 tokens

pre-pr-audit

Pre-PR confidence audit with 5-dimension scoring. Use when: final check before commit/push/PR, evaluating PR readiness, assessing test quality + risk + coverage holistically. Triggers: pre-pr, readiness check, confidence audit, final verification, ready to PR, how confident. Not for: code review (use…

sd0xdev/sd0x-harness · 95 tokens

vibe-spec-sync

Keeps specification documents and code in agreement. Audit mode finds every divergence when an implementation is claimed complete; sync mode detects spec drift in staged changes and updates the spec after user approval, so each commit is a reconciled snapshot of spec, tests, and code. Use when an implementation is…

ash1794/vibe-engineering · 90 tokens

vibe-gap-analysis

Assesses production readiness or audits a codebase against its specs. Supports quick static mode, deep 17-dimension audit, or single-dimension focus. Use before a production launch, after a major refactor, when inheriting a codebase, or when someone asks how done the project is.

ash1794/vibe-engineering · 65 tokens

walkthrough

Generate a Phase-2 Walkthrough artifact (walkthrough.md) once implementation and verification are complete. Captures a Change Summary, Verification Steps (commands + unit tests + automated browser testing outcomes), Visual Proof (screenshots/recordings embedded directly in the file), and a Review Gate (final diff + PR…

smallnest/goal-workflow · 131 tokens

vibe-quality-loop

Runs the Implement→Review→Test→Fix cycle until the work is actually clean, with evidence. Use after any non-trivial implementation and before claiming it is done.

ash1794/vibe-engineering · 39 tokens