Sponsor Suno AI Music arrow_forward
Slash Command

Unbloat

Remove dead code, duplicate files, and unused dependencies with user approval at each step. Backs up before deleting.

Type
Slash Command
GitHub stars
339
License
MIT
Repo last updated
Sep 24, 2026

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

  1. Download unbloat.md from the repository.
  2. 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.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. 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 code

Options

Workflow Overview

  1. Scan/Load: Run integrated Tier 1 scan or load from --from-scan report
  2. Prioritize: Group by type (DELETE, REFACTOR, CONSOLIDATE, ARCHIVE) and risk
  3. Backup: Create timestamped backup branch
  4. Remediate: Interactive approval for each finding with preview
  5. Verify: Run tests after each change, rollback on failure
  6. 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

  1. Always backup (unless --no-backup)
  2. Git operations only (git rm, not rm - reversible)
  3. Test after each change - auto-rollback on failure
  4. 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/file

Integration

# 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 --apply

Cleanup 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 finding

Plugin 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.