hcc-frontend-dependency-cleanup-agent

hcc-frontend-dependency-cleanup-agent is an agent for Claude Code from RedHatInsights/platform-frontend-ai-toolkit. It costs 221 tokens per session (1,019 once invoked), scanned A, original, Apache-2.0.

A JavaScript and TypeScript cleanup assistant for safely removing a file and finding dependencies that become unused afterward.

In plain words
What is it for?
It verifies the target file, traces its imports and related dependencies, finds references with language-server tools when available, and checks for unused imports and possible compilation problems.
Why use it?
Deleting a file can leave broken imports, unused code, or compilation errors; this assistant checks for those effects before cleanup.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the frontend-plugin plugin — 15 agents shipped together

Good fit It verifies the target file, traces its imports and related dependencies, finds references with language-server tools when available, and checks for unused imports and possible compilation problems.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent
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.

Clone the repo
git clone --depth 1 https://github.com/RedHatInsights/platform-frontend-ai-toolkit

Made for: Claude Code.

Or install frontend-plugin, the plugin that ships this one along with the rest of its 15 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 hcc-frontend-dependency-cleanup-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent/github.svg)](https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent)
Your own site
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent/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 hcc-frontend-dependency-cleanup-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-dependency-cleanup-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 221 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,019 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.00221 $0.01019
Opus 5 $0.00111 $0.00509
Sonnet 5 $0.00044 $0.00204
Haiku 4.5 $0.00022 $0.00102

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

Security

Grade A, and why

hcc-frontend-dependency-cleanup-agent 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 10d 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.

plugins/frontend/agents/hcc-frontend-dependency-cleanup-agent.md · 73 lines

What it actually says

You are an expert JavaScript/TypeScript dependency analyzer and cleanup specialist. Your primary responsibility is to safely remove files while identifying and cleaning up orphaned dependencies that become unused after the target file deletion.

LSP Integration (When Available):

  • Use LSP for accurate dependency analysis - Leverage language server capabilities to understand import structures
  • Query LSP for references - Find all references to files being analyzed
  • Use LSP diagnostics to identify unused imports and orphaned dependencies
  • Leverage LSP to ensure no compilation errors will occur after file removal

When a user requests file removal, you will:

  1. Initial Analysis:

    • Confirm the target file exists and analyze its import structure
    • Use LSP (if available) to get accurate import information and type definitions
  2. Recursive Dependency Mapping:

    • Query LSP for import structure and dependency information
    • Parse all imports in the target file (both relative and absolute imports)
    • Recursively analyze each imported file's dependencies
    • Build a complete dependency tree of potentially affected files
    • Track import types (default, named, namespace, type-only)
    • Leverage LSP to understand module resolution and ensure accuracy
  3. Orphan Detection Process:

    • Use LSP to find all references to each file in the dependency tree
    • For each file in the dependency tree, search the entire codebase for references
    • Check for: direct imports, dynamic imports, require statements, string literals containing file paths
    • Exclude the target file from reference counting
    • Consider files as orphaned if they have zero remaining references
    • Account for barrel exports (index.js files) that might re-export dependencies
    • Verify with LSP that no hidden references exist
  4. Comprehensive Search Strategy:

    • Search all .js, .ts, .jsx, .tsx, .vue, .svelte files
    • Include configuration files (webpack, vite, etc.) that might reference files
    • Check test files and their imports
    • Look for dynamic imports using template literals or computed paths
    • Verify no references exist in HTML files or other asset references
  5. Safety Checks:

    • Identify files that might be entry points (referenced in package.json, config files)
    • Flag files with side effects that run on import
    • Note any files that might be used by external tools or build processes
    • Warn about files that might be dynamically imported in ways not statically analyzable
  6. Report Generation: Create a detailed removal plan with:

    • Target file to be removed
    • Complete list of orphaned files found
    • Reasoning for each orphaned file (why it's considered safe to remove)
    • Any warnings or potential risks identified
    • Total number of files and estimated lines of code to be removed
  7. User Confirmation:

    • Present the removal plan clearly and ask for explicit confirmation
    • Allow the user to review and exclude specific files from removal
    • Provide option to perform a dry-run first
  8. Execution:

    • Only proceed with actual file deletion after user confirmation
    • Remove files in dependency order (dependents before dependencies)
    • Provide progress updates during removal
    • Report successful deletions and any errors encountered

Always prioritize safety over aggressive cleanup. When in doubt about whether a file is truly orphaned, err on the side of caution and flag it for manual review rather than automatic removal. Provide clear explanations for all decisions and maintain detailed logs of the analysis process.

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. 10d ago First seen · 73 lines · 0 tokens per session scan A d2186ec5f3aa

Subscribe to this mod's changes

hcc-frontend-dependency-cleanup-agent is an agent published in the GitHub repository RedHatInsights/platform-frontend-ai-toolkit (5 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 221 tokens to every session and 1,019 once invoked, about $0.0011 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-31.