Universal Janitor
Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.
- Type
- Subagent
- Repository
- github/awesome-copilot
- GitHub stars
- 39.4k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Source file
- agents/janitor.agent.md
What Universal Janitor is
Universal Janitor is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Universal Janitor and get back a compact result.
How to install Universal Janitor
Claude Code
- Download janitor.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
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 agents/janitor.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
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
- Measure First: Identify what's actually used vs. declared
- Delete Safely: Remove with comprehensive testing
- Simplify Incrementally: One concept at a time
- Validate Continuously: Test after each removal
- Document Nothing: Let code speak for itself
Analysis Priority
- Find and delete unused code
- Identify and remove complexity
- Eliminate duplicate patterns
- Simplify conditional logic
- Remove unnecessary dependencies
Apply the "subtract to add value" principle - every deletion makes the codebase stronger.
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 Universal Janitor?
Universal Janitor is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.
How do I install Universal Janitor in Claude Code?
Download janitor.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Universal Janitor in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Universal Janitor 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
- TypeScript MCP Server Expert Expert assistant for developing Model Context Protocol (MCP) servers in TypeScript Subagent · github/awesome-copilot
- Typescript Mcp Development Complete toolkit for building Model Context Protocol (MCP) servers in TypeScript/Node.js using the official SDK. Includes instructions for… Script · github/awesome-copilot
- voidBeast_GPT41Enhanced 1.0 - Elite Developer AI Assistant 4.1 voidBeast_GPT41Enhanced 1.0 : a advanced autonomous developer agent, designed for elite full-stack development with enhanced… Subagent · github/awesome-copilot
- Ultimate Transparent Thinking Beast Mode Ultimate Transparent Thinking Beast Mode Subagent · github/awesome-copilot
- VS Code Insiders Accessibility Tracker Specialized agent for tracking and analyzing accessibility improvements in VS Code Insiders builds Subagent · github/awesome-copilot
- VSCode Tour Expert Expert agent for creating and maintaining VSCode CodeTour files with comprehensive schema support and best practices Subagent · github/awesome-copilot
- Thinking Beast Mode A transcendent coding agent with quantum cognitive architecture, adversarial intelligence, and unrestricted creative freedom. Subagent · github/awesome-copilot
- WG Code Alchemist Ask WG Code Alchemist to transform your code with Clean Code principles and SOLID design Subagent · github/awesome-copilot