Skip to content
BeClaude

janitor

New
GitHub TrendingGeneralby Swellshinider

Behavior-preserving codebase cleanup: removes dead code, splits oversized files and classes, and merges duplicated logic without changing behavior.

Summary

The janitor skill automatically cleans up codebases by removing dead code, splitting oversized files and classes, and merging duplicated logic—all without altering behavior.

  • It helps developers maintain a lean, readable, and maintainable codebase by performing safe, behavior-preserving refactoring.

Install & Usage

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file

Add the configuration to .claude/skills/janitor.md

3
Invoke in Claude Code
/janitor

Use Cases

Remove unused imports, variables, functions, and classes from a legacy codebase.
Split a monolithic 2000-line file into smaller, focused modules based on logical boundaries.
Merge duplicate utility functions scattered across multiple files into a single shared location.
Eliminate dead code paths in a large application before adding new features.
Refactor a god class by extracting cohesive methods into separate classes.
Clean up redundant conditional branches and unreachable code after a major refactor.

Usage Examples

1

/janitor remove dead code in src/

2

/janitor split src/utils.py into smaller files based on function domains

3

/janitor merge duplicate logic in models/ and services/

View source on GitHub

Security Audits

LicenseUnknownSourceWarnRepositoryPass

Frequently Asked Questions

What is janitor?

The janitor skill automatically cleans up codebases by removing dead code, splitting oversized files and classes, and merging duplicated logic—all without altering behavior. It helps developers maintain a lean, readable, and maintainable codebase by performing safe, behavior-preserving refactoring.

How to install janitor?

To install janitor: create the skills directory (mkdir -p .claude/skills), then add the config to .claude/skills/janitor.md. Finally, /janitor in Claude Code.

What is janitor best for?

janitor is a other categorized under General. Created by Swellshinider.

What can I use janitor for?

janitor is useful for: Remove unused imports, variables, functions, and classes from a legacy codebase.; Split a monolithic 2000-line file into smaller, focused modules based on logical boundaries.; Merge duplicate utility functions scattered across multiple files into a single shared location.; Eliminate dead code paths in a large application before adding new features.; Refactor a god class by extracting cohesive methods into separate classes.; Clean up redundant conditional branches and unreachable code after a major refactor..