Agent skill

Audit Redundancy

by ben-manes in ben-manes/caffeine

Audit for provably redundant work or state, where clarity is the payoff and no defect or measured speedup is required

Apache-2.0Auto-check passed

Install Audit Redundancy

skills CLI
$ npx skills add ben-manes/caffeine --skill audit-redundancy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ben-manes/caffeine audit-redundancy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ben-manes/caffeine.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/audit-redundancy .claude/skills/audit-redundancy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
audit-redundancy
GitHub stars
18k
Token cost
~3.2k tokens
SKILL.md length
1,801 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Audit for provably redundant work or state, where clarity is the payoff and no defect or measured speedup is required

  • Works in 4 steps: Every consumer. Readers, writers,… → Every exit. Normal return, absence/null,… → When it is observed. A value read before… → …
  • SKILL.md covers Entry points, What a finding looks like, The proof and Shapes that look redundant and…, plus 1 more section
  • Calls node and git

What it does

Audit Redundancy is an agent skill from ben-manes/caffeine. Audit for provably redundant work or state, where clarity is the payoff and no defect or measured speedup is required

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A high performance caching library for Java. The licence is Apache-2.0.

Example prompts

  • “/audit-redundancy”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Every consumer. Readers, writers, callers, overrides, and generated variants. Check
  2. Every exit. Normal return, absence/null, early return, exception, and retry. Preserve
  3. When it is observed. A value read before a lock acquire, a user callback, a publication,
  4. Ownership and ordering. Lock ordering, VarHandle access modes, node lifecycle

What it can do on your machine

Read from SKILL.md and the folder at commit e972fb0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Audit Redundancy loads about 3.2k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 1,801 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ben-manes/caffeine at commit e972fb0, republished under its Apache-2.0 licence (© ben-manes). 1,801 words, ~3,152 tokens.

Download SKILL.mdSave it as .claude/skills/audit-redundancy/SKILL.md (or your agent's skills folder).
name
audit-redundancy
description
Audit for provably redundant work or state, where clarity is the payoff and no defect or measured speedup is required
argument-hint
[module or path to focus on, default: all source modules]
context
fork
agent
auditor
disable-model-invocation
true

Find work or state that can be removed, with a proof that behavior is preserved. The payoff is a clearer implementation: a correctness defect and a measured speedup are both optional here, and neither may be inferred from the fact that a deletion still compiles. /audit-performance owns the claim that something costs measurable time; this lens owns the claim that something does nothing. A shorter expression that makes ownership or control flow harder to follow is not an improvement, and neither is one that trades a cheap guard for an unconditionally expensive path, so a proposal argues its clarity rather than assuming it. A complete pass may find nothing.

Scope: $ARGUMENTS, otherwise the auditor's module map plus caffeine/src/javaPoet/. Trace outside that scope as far as a proof needs, without starting a second discovery sweep there.

Report-only. The transformation ships as a patch described in the report, never applied to the tree; see the auditor's Evidence Boundaries. Record the commit and whether the tree was dirty, since a proof is about one source snapshot.

Entry points

The suppression inventory is the cheapest entry point, and the one no other lens looks at. .claude/rules/errorprone.md keeps suppressions rare and prefers fixing over suppressing, so a redundancy-flavored suppression left in main source is a pre-built candidate. Grep @SuppressWarnings across the module for RedundantCollectionOperation, RedundantUnmodifiable, UnnecessaryLocalVariable, UnnecessaryReturnStatement, UnusedVariable, UnusedReturnValue, ConstantValue, EmptyMethod, StatementWithEmptyBody, FieldCanBeFinal and RedundantSuppression. A suppression is a candidate, not a finding, and not a rejection either. Adjudicate each one in the report from its own source, rather than taking the annotation's word for it or this skill's. Exactly one carries a standing ruling, the discardRefresh prescreen described below, and that ruling is in ruled-out.md where Phase 1.5 will reach it.

Do not seed from a prior report. .local/audits/ is off limits under the auditor's Evidence Boundaries, and that includes the performance reports whose unpriceable rows land in this lens. Rediscover them.

Then the shapes that survive a refactor in this codebase:

  • Flag-guarded branches that cannot disagree. These predicates are stable for the life of a cache, but only some are fixed by class selection. The generators emit return true for evicts(), expiresAfterWrite(), refreshAfterWrite(), collectKeys() and collectValues(). expiresAfterAccess() and expiresVariable() are emitted as timerWheel == null and timerWheel != null on the same class, and isAsync is a plain field on BoundedLocalCache, so those three vary per instance. A condition re-testing what the enclosing branch already implied is a candidate; one that is constant only in some variants, or only in some instances of one variant, is not. Reading the generator is what tells them apart.
  • Generator-emitted fields and methods with no reader in any variant. caffeine/src/javaPoet/java/.../Add*.java decides what each Node and cache subclass carries. Regenerate before concluding a member is unused: a search over caffeine/src/main/ alone cannot see a consumer that only exists in an emitted class.
  • Re-derivation of a result the frame already holds. A repeated node.getValue(), a key reference rebuilt from the node, a ticker read on a path that already carries now. A lock-free probe in front of a locking operation is a guard and not a duplicate, so read the next section first. Most other candidates of this shape fail proof item 3, which is the point of checking it.
  • Locals overwritten before use, values recomputed where the earlier one still holds, and mutable carriers duplicating what the operation already returned.
  • Adapter delegation that adds nothing. In guava/ and jcache/, a configured branch whose arms reach the same delegate call with the same arguments; in simulator/, a conversion or parse repeated per event that the settings object already holds.
  • Tautologies and unused private members, anywhere in scope.

What a finding looks like

Two from this codebase, both real, and neither one a defect.

A constructor argument every consumer overwrote. ComputeContext took now from expirationTicker().read() at construction, at every compute entry point, while the compute lambdas in remap and doComputeIfAbsent assign ctx.now from the ticker again before reading it. The parameter was dead: one ticker read per compute call that nothing observed. Dropping it also frees computeIfAbsent to move its own read inside the node != null branch, removing the read from the miss path outright. The proof is item 2 done exit by exit, and it is the whole finding: every path that reaches a read of ctx.now assigns it first, including the ones where the assignment rides inside a && operand so short-circuiting cannot skip it, and the paths that never assign it never read it. Letting the field default to zero is safe only because that enumeration is complete. The savings are path-specific, computeIfPresent keeps its own optimistic read, and no measured gain is required to justify any of it.

The same edit twice, needing two different proofs. Two discardRefresh call sites re-derived the key reference from a node while the enclosing frame already held it, once as a lambda parameter and once as a lookupKey. That reads as one transformation applied at two sites. In removeNode the lambda parameter is the object handed to computeIfPresent a line earlier, so the substitution is identity and the proof is one sentence. In put the lookup key is a different object from the node's WeakKeyReference, and the equivalence rests on LookupKeyReference using System.identityHashCode and reference equality, plus the lookup key holding its referent strongly so the weak reference cannot clear inside the frame. Write the proof per site: a transformation that repeats is not a proof that repeats.

The proof

Write the smallest before/after transformation, name the work or state it removes, and say what becomes easier to follow. Then establish all four:

  1. Every consumer. Readers, writers, callers, overrides, and generated variants. Check reflection, serialization, the generators' emitted references, initialization side effects, and external visibility before calling a definition unused. A search with no matches does not settle it when any of those can supply a consumer. Prefer LSP findReferences and goToImplementation over grep for this, against a populated caffeine/build/generated/.
  2. Every exit. Normal return, absence/null, early return, exception, and retry. Preserve callback count and order, exception identity and propagation, statistics, notifications, and cleanup obligations. Name the gate that makes the equivalence hold.
  3. When it is observed. A value read before a lock acquire, a user callback, a publication, or a future completion is not interchangeable with a later read of the same thing. Check weak and soft reference lifetime, obtrusion, reentrancy, coalescing, and supersession. A reference already returned into a local can be stable exactly where a fresh lookup would not be, which is what makes a "duplicate" lookup load-bearing.
  4. Ownership and ordering. Lock ordering, VarHandle access modes, node lifecycle transitions, reference-key representation, and registration ownership all survive. An outcome flag can identify which caller acted even when a second caller would compute the same value.
Show full SKILL.md (674 more words)Show less

Shapes that look redundant and are not

A cheap guard in front of an expensive operation is not duplicated work. BoundedLocalCache.discardRefresh tests containsKey before remove on the refresh map under @SuppressWarnings("RedundantCollectionOperation"), and the suppression is correct. ConcurrentHashMap.remove reaches replaceNode, which returns without locking only when the target bin is empty; a key that is absent but collides into an occupied bin still takes the bin monitor and walks the chain to find nothing. containsKey is a lock-free read. So the prescreen trades one cheap probe for a pessimistic lock the map would otherwise take on every miss, and on the hit path it is not wasted either, since it warms the bin that remove then touches. Doing one cheap thing that avoids later work beats unconditionally doing the expensive thing. Price a guard against what it skips, never against its line count, and treat a containsKey, get or isEmpty before a mutating call as a guard until the locking behavior of that call says otherwise.

A call that looks interchangeable with a plainer one may carry a side effect a distant guard reads. Pacer.schedule's reschedule arm must call cancel() rather than future.cancel(...), because the immediate-scheduler recursion guard is future == null && nextFireTime != 0L and only cancel() reaches it. ruled-out.md §Core records that one as "do not simplify it back". Expect more of this shape, and expect proof item 3 to be what catches it.

The auditor's Project-Specific Context lists further patterns that read as waste and are not. At Phase 1.5 take the module's rule file and its ruled-out.md section together; a standing "do not simplify" ruling lands directly on this lens, and the entry is the thing to argue past rather than rediscover. Use git log -L to explain a leftover, but blame alone does not establish that anyone intended it to be dead.

Phases, validation, and output

Run the auditor's phases unchanged. Phase 0's pre-mortem asks where a removal would change behavior, not where a defect hides. In Phase 3 the evaluator gets the transformation, the path table, the assumptions, and the evidence limits with no source access: ask it for one input, exceptional exit, or legal schedule under which the two forms differ, and whether the proposed code actually reads better. Resolve every substantive challenge by re-reading source.

Phase 3.5 does not fire, because these findings are low and the auditor's pricing gate is for high and critical. What substitutes is narrower: compile the transformed snapshot in isolation and report that as compilation, not as validation. Keep three kinds of evidence apart and never let one stand in for another: source equivalence, tests actually executed, and measured runtime effects. Existing tests are coverage pointers until run. Do not promise fewer allocations, a smaller object, or faster code from syntax alone. A performance or correctness claim is a separate finding in its own category and owes the full Phase 3.5 witness. For focused validation follow .claude/rules/testing.md, and prefer a public-API pin over a test that mirrors the implementation detail being removed.

Report to the auditor's Phase 4 path (AUDIT_REPORT_PATH, else .local/audits/<model>/audit-redundancy.md) and section headers, with these substitutions:

  • Category redundancy, severity low, confidence describing the proof's coverage rather than an assumed speedup (.claude/docs/finding-taxonomy.md).
  • Replace Invariant/contract violated with Equivalence proof: the assumptions, the gates the equivalence rests on, and the strongest counterexample attempted. Do not invent a broken contract to fill the field.
  • Replace Priced with Validated: whether the transformed snapshot compiled, which existing tests name the path and whether they were run, and what was not measured.
  • Keep proposed, rejected, and unresolved candidates in separate sections. A plausible unresolved counterexample belongs in the medium-confidence section with the missing fact and the next check, not among the proposals.
  • Report generator and construction cleanups separately from anything on a read, write, or drain path.

Leave the shared consolidated queue alone; this is a discovery run and consolidation is a separate pass. A zero-finding report still records the inspected scope, the work that survived the challenges with the property that keeps it necessary, and the coverage limits.

© ben-manes, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/audit-redundancy of ben-manes/caffeine.

Open the folder on GitHubat commit e972fb0

Compare with similar skills

Audit Redundancy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Audit Redundancy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Audit Redundancy this skillben-manes/caffeine18k—~3.2kAutomated safety check: PassApache-2.0
Image Redundant Altthedaviddias/Front-End-Checklist74k—~447Automated safety check: PassMIT
Redundant Entrythedaviddias/Front-End-Checklist74k—~520Automated safety check: PassMIT
Clarity Gatesickn33/agentic-awesome-skills47k3 repos~709Automated safety check: PassCC-BY-4.0
Strategic Clarityjeremylongshore/tons-of-skills-marketplace2.8k—~2.7kAutomated safety check: PassMIT
Pp Claritymvanhorn/printing-press-library2.1k—~2.6kAutomated safety check: NotesApache-2.0

Similar skills

  • Image Redundant Alt

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid redundant image alternative text.

    74k GitHub stars~447 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Redundant Entry

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing any process that spans multiple screens, steps, or modal stages.

    74k GitHub stars~520 tokensUpdated 3 days ago
    Product & Project ManagementAuto-check passed
  • Clarity Gate

    sickn33/agentic-awesome-skills

    Pre-ingestion verification for epistemic quality in RAG systems.

    47k GitHub starsUsed in 3 repos~709 tokens
    Knowledge ManagementAuto-check passed
  • Strategic Clarity

    jeremylongshore/tons-of-skills-marketplace

    Analyze and audit team context to establish identity, boundaries, and strategic clarity.

    2.8k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Pp Clarity

    mvanhorn/printing-press-library

    Generate and audit Microsoft Clarity browser instrumentation from the terminal.

    2.1k GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes
  • Redundancy Consultation

    mohitagw15856/pm-claude-skills

    Structure a redundancy consultation process and draft key communications (UK employment law focus).

    1.4k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

More from ben-manes/caffeine

All 33 skills in this repo
  • Runs controlled JMH experiments on the Caffeine cache to find shared contention and hot-path waste, then reviews correctness and returns a reviewable patch.

    18k GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Adversarial Codebase Audit

    ben-manes/caffeine

    Runs a hostile review of the Caffeine Java caching library with parallel subagents that get no design docs, then challenges and consolidates their findings.

    18k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check: notes
  • Caffeine Performance Audit

    ben-manes/caffeine

    Audits the Caffeine cache source for hot-path costs such as allocations, contention and memory layout, reporting only findings tied to specific lines.

    18k GitHub stars~559 tokensUpdated yesterday
    Auto-check passed
  • Audit Sibling Divergence

    ben-manes/caffeine

    Compares code paths that should behave the same, such as sync and async cache methods, and requires a concrete scenario where the two observably disagree.

    18k GitHub stars~4.3k tokensUpdated yesterday
    Auto-check: notes
  • Climber Step Minimization

    ben-manes/caffeine

    Prices each step of the window climber algorithm by disabling it in turn, to find steps that no longer earn their keep and branches that no longer fire.

    18k GitHub stars~3k tokensUpdated yesterday
    Auto-check: notes

Questions about Audit Redundancy

What does Audit Redundancy do?

Audit for provably redundant work or state, where clarity is the payoff and no defect or measured speedup is required. Audit Redundancy is an agent skill from ben-manes/caffeine.

How do I install Audit Redundancy in Claude Code?

Run `npx skills add ben-manes/caffeine --skill audit-redundancy -a claude-code`. Or copy the skill folder (.claude/skills/audit-redundancy in ben-manes/caffeine) into .claude/skills/audit-redundancy in your project. Claude Code loads it when a task matches its description.

How do I install Audit Redundancy in Codex?

Run `npx skills add ben-manes/caffeine --skill audit-redundancy -a codex`. Or copy the skill folder (.claude/skills/audit-redundancy in ben-manes/caffeine) into .agents/skills/audit-redundancy in your project. Codex loads it when a task matches its description.

Can I use Audit Redundancy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ben-manes/caffeine --skill audit-redundancy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/audit-redundancy, .gemini/skills/audit-redundancy, .github/skills/audit-redundancy and .opencode/skills/audit-redundancy in your project.

What does Audit Redundancy need to run?

Going by SKILL.md and its folder, Audit Redundancy needs the command-line tools its instructions call (node and git).

Does Audit Redundancy access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Audit Redundancy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Audit Redundancy use?

Audit Redundancy is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Audit Redundancy use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Audit Redundancy?

Skills that share tags, products or a category with Audit Redundancy: Image Redundant Alt (thedaviddias/Front-End-Checklist, 74k stars), Redundant Entry (thedaviddias/Front-End-Checklist, 74k stars), Clarity Gate (sickn33/agentic-awesome-skills, 47k stars) and Strategic Clarity (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Audit Redundancy?

ben-manes (a GitHub user) maintains it in ben-manes/caffeine, which has 17,881 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 9, 2026.

Source: ben-manes/caffeine on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.