unbloat-remediator

unbloat-remediator is an agent for Claude Code from athola/claude-night-market. It costs 41 tokens per session (1,304 once invoked), scanned A, original, MIT.

An agent that finds codebase bloat and coordinates safe cleanup with approval, backups, tests, and rollback instructions.

In plain words
What is it for?
Use it after a bloat scan to prioritize findings, preview deletions or refactors, apply approved changes, and verify the result.
Why use it?
It reduces the risk of deleting or changing useful code while removing unnecessary code, duplicate files, or other identified waste.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the conserve plugin — 15 skills, 6 commands, 5 agents shipped together

Good fit Use it after a bloat scan to prioritize findings, preview deletions or refactors, apply approved changes, and verify the result.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/athola/claude-night-market/unbloat-remediator
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/athola/claude-night-market

Made for: Claude Code.

Or install conserve, the plugin that ships this one along with the rest of its 15 skills, 6 commands, 5 agents.

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 unbloat-remediator

README.md
[![agentmods](https://agentmods.dev/badge/agents/athola/claude-night-market/unbloat-remediator/github.svg)](https://agentmods.dev/agents/athola/claude-night-market/unbloat-remediator)
Your own site
<a href="https://agentmods.dev/agents/athola/claude-night-market/unbloat-remediator"><img src="https://agentmods.dev/badge/agents/athola/claude-night-market/unbloat-remediator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unbloat-remediator

Your own site · 80×15
<a href="https://agentmods.dev/agents/athola/claude-night-market/unbloat-remediator"><img src="https://agentmods.dev/badge/agents/athola/claude-night-market/unbloat-remediator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,304 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.00041 $0.01304
Opus 5 $0.00020 $0.00652
Sonnet 5 $0.00008 $0.00261
Haiku 4.5 $0.00004 $0.00130

Measured 9d ago against content hash 6ac188bfebaa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

unbloat-remediator 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 9d 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.

plugins/conserve/agents/unbloat-remediator.md · 165 lines

How it starts

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

Unbloat Remediator Agent

Orchestrates safe bloat remediation with progressive risk mitigation and user approval.

Core Responsibilities

  1. Load/Scan: Use existing bloat-scan report or run integrated scan
  2. Prioritize: Group by type and risk level
  3. Backup: Create timestamped backup branch
  4. Remediate: Interactive approval with preview for each finding
  5. Verify: Test after each change, rollback on failure
  6. Report: Summary with token savings and rollback instructions

For remediation types (DELETE, REFACTOR, CONSOLIDATE, ARCHIVE) and risk assessment, see: @module:remediation-types

Implementation

Phase 1-2: Initialize and Prioritize

def initialize_unbloat(args):
    config = {
        "from_scan": args.get("from_scan"),
        "auto_approve": args.get("auto_approve", "none"),
        "dry_run": args.get("dry_run", False),
        "focus": args.get("focus", "all"),
        "backup_branch": args.get("backup_branch") or f"backup/unbloat-{timestamp()}",
    }

    findings = (
        load_from_report(config["from_scan"])
        if config["from_scan"]
        else run_bloat_scan(level=1)
    )

    # Sort by risk (LOW first) then priority score
    findings.sort(key=lambda f: (risk_order(f.risk), -f.priority_score))
    return config, findings

Phase 3: Create Backup

def create_backup(config):
    if config.get("no_backup") or config["dry_run"]:
        return config["backup_branch"]

    run_bash(f"git checkout -b {config['backup_branch']}")
    run_bash("git add -A && git commit -m 'Backup before unbloat'")
    run_bash("git checkout -")  # Return to working branch
    return config["backup_branch"]

Phase 4: Interactive Remediation

def remediate_interactive(findings, config):
    results = {"applied": [], "skipped": [], "failed": []}

    for idx, finding in enumerate(findings, 1):
        print(f"[{idx}/{len(findings)}] {finding.file}")
        print(
            f"  Action: {finding.action} | Confidence: {finding.confidence}% ({finding.risk})"
        )
        show_preview(finding)

        if should_auto_approve(finding, config["auto_approve"]):
            action = "y"
            print("  Auto-approved")
        else:
            action = prompt_user("Approve? [y/n/d/s/q]: ")

        if action == "y":
            if execute_remediation(finding) and run_tests_quick():
                results["applied"].append(finding)
            else:
                rollback_change(finding)
                results["failed"].append(finding)
        elif action in ["s", "q"]:
            results["skipped"].extend(findings[idx:])
            break
        else:
            results["skipped"].append(finding)

    return results

Read the full file on GitHub · 165 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. 9d ago First seen · 165 lines · 41 tokens per session scan A 6ac188bfebaa

Subscribe to this mod's changes

unbloat-remediator is an agent published in the GitHub repository athola/claude-night-market (337 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 1,304 once invoked, about $0.0002 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

scout

A read-only codebase investigator in the Octopus workflow that examines architecture, conventions, dependencies, Git history, and project progress.

SatoruoGojoo/octopus · 85 tokens

git-historian

Use this agent for git archaeology, when the user asks "why does this code exist", "when did this break", "what introduced this behavior", mentions "git blame", "git bisect", "pickaxe", "regression", "who changed this", or "find the commit that". Examples.

sigistry/marketplace · 0 tokens

qa-lead

The QA Lead owns test strategy, bug triage, release quality gates, and testing process design. Use this agent for test plan creation, bug severity assessment, regression test planning, or release readiness evaluation.

TraftG/opencode-game-studio · 41 tokens

remediation-agent

Generates concrete, ready-to-apply fix suggestions for issues found by review agents. Reads only the flagged files and lines — never re-scans the full codebase. Outputs fix suggestions to stdout only (no disk report — suggestions are ephemeral and become stale once applied).

mantacron/manta · 58 tokens

test-writer

Use this agent to write new Playwright E2E tests from scratch by interactively exploring the application. Navigates pages, discovers user flows, and creates production-grade tests with POM/business-layer architecture. Runs in a worktree for parallel safety. Examples: Context: User needs tests for a new feature. user…

kaizen-yutani/playwright-autopilot · 0 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens