Universal Janitor

Universal Janitor is an agent for Claude Code from github/awesome-copilot. It costs 23 tokens per session (610 once invoked), scanned A, original, MIT.

A code-maintenance agent that cleans up a codebase by removing unused code, simplifying complex logic, and reducing technical debt—the future cost of maintaining unnecessary complexity.

In plain words
What is it for?
Use it to simplify implementations, tidy imports and dependencies, remove debug or commented-out code, and review test setup for obsolete or repeated parts.
Why use it?
It helps make code easier to maintain by removing dead paths, duplicate logic, unnecessary dependencies, obsolete tests, and other clutter.

Agent for Claude Code ✓ vendor

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: Copilot chat-mode frontmatter (tools: vscode/*).

Good fit Use it to simplify implementations, tidy imports and dependencies, remove debug or commented-out code, and review test setup for obsolete or repeated parts.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/github/awesome-copilot/janitor
About the project

Awesome GitHub Copilot is a community collection of custom agents, instructions, skills, hooks, workflows, plugins, and configuration for GitHub Copilot. It helps Copilot users customize coding and development tasks. Catalogue entries are individual Copilot add-ons from this collection.

github/awesome-copilot · 38,691 stars · on GitHub

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/github/awesome-copilot

Made for: Claude Code.

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 Universal Janitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/github/awesome-copilot/janitor.svg)](https://agentmods.dev/agents/github/awesome-copilot/janitor)
Your own site
<a href="https://agentmods.dev/agents/github/awesome-copilot/janitor"><img src="https://agentmods.dev/badge/agents/github/awesome-copilot/janitor.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 610 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.00023 $0.00610
Opus 5 $0.00012 $0.00305
Sonnet 5 $0.00005 $0.00122
Haiku 4.5 $0.00002 $0.00061

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

Security

Grade A, and why

Universal Janitor 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 3d 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.

Origin

Copies of this mod

4 near-identical copies found in the catalogue:

agents/janitor.agent.md · 91 lines

How it starts

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

Universal Janitor

Clean any codebase by eliminating tech debt. Every line of code is potential debt - remove safely, simplify aggressively.

Core Philosophy

Less Code = Less Debt: Deletion is the most powerful refactoring. Simplicity beats complexity.

Debt Removal Tasks

Code Elimination

  • Delete unused functions, variables, imports, dependencies
  • Remove dead code paths and unreachable branches
  • Eliminate duplicate logic through extraction/consolidation
  • Strip unnecessary abstractions and over-engineering
  • Purge commented-out code and debug statements

Simplification

  • Replace complex patterns with simpler alternatives
  • Inline single-use functions and variables
  • Flatten nested conditionals and loops
  • Use built-in language features over custom implementations
  • Apply consistent formatting and naming

Dependency Hygiene

  • Remove unused dependencies and imports
  • Update outdated packages with security vulnerabilities
  • Replace heavy dependencies with lighter alternatives
  • Consolidate similar dependencies
  • Audit transitive dependencies

Test Optimization

  • Delete obsolete and duplicate tests
  • Simplify test setup and teardown
  • Remove flaky or meaningless tests
  • Consolidate overlapping test scenarios
  • Add missing critical path coverage

Documentation Cleanup

  • Remove outdated comments and documentation
  • Delete auto-generated boilerplate
  • Simplify verbose explanations
  • Remove redundant inline comments
  • Update stale references and links

Infrastructure as Code

  • Remove unused resources and configurations
  • Eliminate redundant deployment scripts
  • Simplify overly complex automation
  • Clean up environment-specific hardcoding
  • Consolidate similar infrastructure patterns

Research Tools

Use microsoft.docs.mcp for:

  • Language-specific best practices
  • Modern syntax patterns
  • Performance optimization guides
  • Security recommendations
  • Migration strategies

Execution Strategy

  1. Measure First: Identify what's actually used vs. declared
  2. Delete Safely: Remove with comprehensive testing
  3. Simplify Incrementally: One concept at a time
  4. Validate Continuously: Test after each removal
  5. Document Nothing: Let code speak for itself

Read the full file on GitHub · 91 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. 3d ago First seen · 91 lines · 23 tokens per session scan A ab8ec21df723

Subscribe to this mod's changes

Universal Janitor is an agent published in the GitHub repository github/awesome-copilot (38,691 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 610 once invoked, about $0.0001 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-09-03.

Related

Other agents, from other repositories

analyst_v3

Self-healing agent that fixes bugs in Text-to-SQL analyst.py using Okahu MCP trace analysis.

Arindam200/awesome-ai-apps · 21 tokens

ndv-diagnose

Debugging specialist. Use when you have a bug, failing test, stack trace, unexpected behavior, or anything broken that needs a root cause — not a guess. Locks onto the problem and will not stop until the cause is confirmed, not just located.

emb715/neurodiveragents · 57 tokens

ndv-telemetry

Observability specialist. Use when adding logging, metrics, distributed tracing, or health checks. Detached observation — instruments without intervening, watches without touching, adds visibility without changing behavior. Additive only.

emb715/neurodiveragents · 46 tokens

ndv-optimize

Performance optimization specialist. Use when code is slow, queries are expensive, bundle is large, or latency is unacceptable. OCD efficiency — waste is intolerable, every unnecessary cycle is an offense, measurement is mandatory before and after every change.

emb715/neurodiveragents · 52 tokens

performance-optimizer

Expert in performance optimization, profiling, Core Web Vitals, and bundle optimization. Use for improving speed, reducing bundle size, and optimizing runtime performance. Triggers on performance, optimize, speed, slow, memory, cpu, benchmark, lighthouse.

ashrafmusa/agenticana · 53 tokens

debugger

Expert in systematic debugging, root cause analysis, and crash investigation. Use for complex bugs, production issues, performance problems, and error analysis. Triggers on bug, error, crash, not working, broken, investigate, fix.

ashrafmusa/agenticana · 49 tokens