Unbloat
Remove dead code, duplicate files, and unused dependencies with user approval at each step. Backs up before deleting.
- Type
- Slash Command
- Repository
- athola/claude-night-market
- GitHub stars
- 339
- License
- MIT
- Repo last updated
- Sep 24, 2026
- Source file
- plugins/conserve/commands/unbloat.md
What Unbloat is
Unbloat is a slash command published in the athola/claude-night-market repository on GitHub, which has about 339 stars. The repository describes itself as: “23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context optimization, research, and multi-LLM delegation. 186 skills, 128 commands, 54 agents.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Unbloat gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Unbloat
Claude Code
- Download unbloat.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
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 plugins/conserve/commands/unbloat.md, shared under the repository's MIT license. Read the full file on GitHub.
Execute safe bloat remediation workflows with user approval at each step.
When To Use
Use this command when you need to:
- After bloat-scan identifies remediation targets
- Preparing for release
- Reducing codebase complexity
When NOT To Use
- Quick fixes that don't need structured workflow
- Already know the specific issue - fix it directly
Philosophy
- Safety First: Every change requires explicit approval (no auto-changes without review)
- Progressive: Start with high-confidence, low-risk changes first
- Reversible: Creates backup branches with clear rollback instructions
Usage
# Integrated workflow: scan + remediate
/unbloat
# Use existing bloat-scan report
/unbloat --from-scan bloat-report.md
# Auto-approve low-risk changes (still shows preview)
/unbloat --auto-approve low
# Preview changes without executing
/unbloat --dry-run
# Focus on specific area
/unbloat --focus codeOptions
Workflow Overview
- Scan/Load: Run integrated Tier 1 scan or load from --from-scan report
- Prioritize: Group by type (DELETE, REFACTOR, CONSOLIDATE, ARCHIVE) and risk
- Backup: Create timestamped backup branch
- Remediate: Interactive approval for each finding with preview
- Verify: Run tests after each change, rollback on failure
- Summary: Report actions, token savings, rollback instructions
For remediation type definitions and risk assessment, see: @module:remediation-types
Interactive Prompts
Each finding shows:
- File path, action type, confidence level
- Token impact estimate and rationale
- Content preview
Responses: [y]es / [n]o / [d]iff / [s]kip rest / [q]uit
Example Session
$ /unbloat --auto-approve low
Phase 1: Scanning (Tier 1, quick scan)
[################] 847 files (4.2s)
Found 24 bloat items
Phase 2: Backup created: backup/unbloat-20251231-021500
Phase 3: Remediation
[1/10] src/deprecated/old_handler.py
Action: DELETE | Confidence: 95% (LOW risk)
Impact: ~3,200 tokens | Rationale: 0 refs, stale 22mo
Auto-approved
[2/10] src/utils/helpers.py
Action: REFACTOR | Confidence: 76% (MEDIUM risk)
Impact: ~2,800 tokens
…Safety Features
- Always backup (unless --no-backup)
- Git operations only (git rm, not rm - reversible)
- Test after each change - auto-rollback on failure
- Detailed logging to .unbloat-log
Rollback
# Undo entire unbloat session
git reset --hard backup/unbloat-YYYYMMDD-HHMMSS
# Restore specific file
git checkout backup/unbloat-YYYYMMDD-HHMMSS -- path/to/fileIntegration
# Two-step workflow (review findings first)
/bloat-scan --level 2 --report findings.md
/unbloat --from-scan findings.md
# With git workflows
git checkout -b cleanup/unbloat-Q1
/unbloat
/pr "Unbloat: Reduce codebase by 14%"Unified Cleanup Mode
When invoked with --cleanup or as /unbloat --cleanup, this command orchestrates a full codebase cleanup (formerly the standalone /cleanup command), combining bloat removal, code quality refinement, and AI hygiene auditing.
Cleanup Usage
# Full cleanup scan (all dimensions, Tier 1)
/unbloat --cleanup
# Quick pass (fastest possible)
/unbloat --cleanup --quick
# Focus on specific area
/unbloat --cleanup --focus bloat # bloat-scan + unbloat
/unbloat --cleanup --focus quality # refine-code
/unbloat --cleanup --focus hygiene # ai-hygiene-audit
# Deep analysis with report
/unbloat --cleanup --level 3 --report cleanup-report.md
# Apply fixes interactively
/unbloat --cleanup --applyCleanup Orchestration Workflow
/unbloat --cleanup
|
+-- Phase 1: Bloat Scan (/bloat-scan)
| Dead code, unused files, stale dependencies
|
+-- Phase 2: Code Refinement (/refine-code) [if pensive installed]
| Duplication, algorithms, clean code, architecture
|
+-- Phase 3: AI Hygiene Audit (/ai-hygiene-audit)
| Git patterns, tab-completion bloat, test gaps, doc slop
|
+-- Phase 4: Consolidated Report
| Unified findings, quality score, prioritized actions
|
+-- Phase 5: Remediation (if --apply)
Interactive approval for each findingPlugin Availability
Cleanup Options
See Also
- /bloat-scan - Detect bloat before remediation
- unbloat-remediator agent - Orchestration implementation
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 Unbloat?
Unbloat is a slash command for Claude Code and Claude Cowork from the athola/claude-night-market repository on GitHub. Remove dead code, duplicate files, and unused dependencies with user approval at each step. Backs up before deleting.
How do I install Unbloat in Claude Code?
Download unbloat.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Unbloat in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Unbloat 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
- Elegant Code Review Review the current working diff against the elegant-code decision ladder and propose deletions, honoring the negligence floor. Slash Command · athola/claude-night-market
- Extractor Autonomous knowledge extraction agent. Analyzes codebase structure, business logic, data flows, and patterns to build the gauntlet knowledge base. Subagent · athola/claude-night-market
- Garden Curator Manage digital garden health, metrics, notes, and curation. Use for knowledge base maintenance and garden tending tasks. Subagent · athola/claude-night-market
- Fix Pr Address PR/MR review feedback by reading comments, implementing fixes, and resolving threads. GitHub and GitLab support. Slash Command · athola/claude-night-market
- Uninstall Watchdog Remove the egregore watchdog daemon and clean up files Slash Command · athola/claude-night-market
- Test Skill Test Claude Code skills using RED/GREEN/REFACTOR TDD phases in fresh subagents to prevent priming bias. Slash Command · athola/claude-night-market
- Update All Plugins Update all installed Claude Code plugins from all marketplaces. Slash Command · athola/claude-night-market
- Summon Summon the egregore to autonomously process work items through the full development lifecycle. Runs indefinitely by default until dismissed. Slash Command · athola/claude-night-market