Skip to content
jcgruesomePublic

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

62 Commits

Folders and files

Repository files navigation

    β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
    β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•
    β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   
    β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   
    β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   
    β•šβ•β•     β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β•   β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•   β•šβ•β•   

Audit your Claude Code ecosystem for bloat, redundancy, and token waste

CI License: MIT Version

A Claude Code plugin that audits your ecosystem for bloat, redundancy, and token waste β€” with usage tracking, cost analysis, and ecosystem profiles.

Install

# From GitHub marketplace
claude plugin marketplace add https://github.com/jcgruesome/moltbloat
claude plugin install moltbloat

# From local path
claude plugin marketplace add /path/to/moltbloat
claude plugin install moltbloat

Usage

Core β€” audit, understand costs, clean up

/moltbloat:help                   # Show all available commands
/moltbloat:audit                  # Full scan with health score (0-100), includes compatibility
/moltbloat:audit --json           # Export audit as JSON for CI integration
/moltbloat:audit --export <path>  # Save audit results to file
/moltbloat:audit --deep           # Multi-agent forensic audit -> verified findings + report artifact
/moltbloat:token-budget           # Context cost breakdown + dollar estimates
/moltbloat:clean                  # Interactive cleanup with confirmation
/moltbloat:clean --dry-run        # Preview cleanup without making changes
/moltbloat:diagnose               # Self-diagnostic and health check

Intelligence β€” understand your ecosystem

/moltbloat:changelog      # Diff ecosystem against last snapshot
/moltbloat:depends        # Dependency graph + blast radius
/moltbloat:why <plugin>   # Quick "should I keep this?" card
/moltbloat:usage          # What you actually use vs installed β€” mined from native history

Management β€” control your ecosystem

/moltbloat:profile list            # See available profiles
/moltbloat:profile suggest         # Intelligent optimization based on usage + audit
/moltbloat:profile apply lean      # Switch to minimal config
/moltbloat:profile auto            # Auto-generate profile from usage data
/moltbloat:profile export <name>   # Share a profile as portable JSON
/moltbloat:profile import <path>   # Import a shared profile
/moltbloat:snapshot                # Save baseline, detect drift
/moltbloat:snapshot trends         # Show historical trends
/moltbloat:snapshot --export       # Export snapshot JSON
/moltbloat:team-report             # Aggregate findings across team

What makes this different

Usage tracking (retroactive)

/moltbloat:usage mines Claude Code's own session transcripts (~/.claude/projects/) to show exactly what you use vs what's just consuming context β€” immediately, from your first run, no waiting for data to accumulate. Every component is tiered by recency (active / stale / never used), and never-used MCPs, plugins, and agents come with the exact disable command. A silent PostToolUse hook supplements this with forward-looking corroboration.

Ecosystem profiles

Switch between lean (2-3 plugins) and full (everything) with one command; /moltbloat:token-budget measures what each costs on your machine. Or create custom profiles for frontend, backend, or project-specific work.

Real dollar costs

Token-budget shows the actual dollar cost of your ecosystem overhead:

  • Per message at Fable/Opus/Sonnet/Haiku rates
  • Per day (assuming 200 messages)
  • Per month
  • Caching-aware: shows both the turn-1 uncached ceiling and the realistic turn-2+ steady-state price once static ecosystem content (CLAUDE.md, rules, skill listings, MCP tool defs) is prompt-cached β€” pricing every message at full rate overstates real cost 5-10x past one turn
  • Context-window percentage is computed against the model's actual window (Haiku 4.5's 200K vs. 1M for Opus 5.5/Sonnet 5/Fable 5.1), not a flat 1M

Honest numbers

Every number moltbloat reports is one of three kinds, and the report says which:

  • Measured: read from Claude Code's own session transcripts by scripts/context-ledger.py (skill listing, deferred tool names, MCP instructions, agent listing, SessionStart hook output, instruction files). Rows show how many sessions they were sampled from.
  • Estimated: computed from file sizes or config values when no transcript data exists, marked est..
  • Assumed: inputs such as 200 messages a day or the response sizes in the effort table. These are illustrative, not observed.

Known limits:

  • The transcript records the ledger reads are undocumented Claude Code internals. If their format changes, the ledger fails with an error rather than guessing.
  • Automated SDK sessions are skipped by default.
  • Dollar figures are list-price estimates of fixed overhead, not a bill.
  • moltbloat does not claim savings it has not measured. A saving is only stated as the measured cost of the thing you would remove.

Retracted: before the context ledger, token-budget priced every MCP tool at ~350 tokens. With deferred tools only names are in context until a tool is used, so that figure overstated MCP cost; it is now used only when no measurement exists, and labeled est..

Compatibility detection

Finds plugin conflicts before they cause mysterious behavior: hook collisions, skill name shadowing, duplicate MCP tools. Smart duplicate detection identifies semantic overlaps (e.g., two Vercel deployment plugins) even with different names. Skill collision detection covers .claude/skills/ too β€” Claude Code auto-loads skills from there directly, no plugin install required, so a local skill silently shadowing a plugin's skill of the same name is caught, not just plugin-vs-plugin collisions.

Claude.ai connector overlap

Org-managed connectors from claude.ai (mcp__claude_ai_<Service>__*) are invisible to settings.json β€” injected per-session, not written to any local config. moltbloat mines session transcripts (like /moltbloat:usage does) to find which connectors are attached and flags local plugins/MCPs duplicating them, matched by shared tool names, not a hardcoded service list.

Org-managed MCP servers

Same blind spot, different source: managedMcpServers in a system managed-settings.json lets an org admin centrally push MCP servers to every user, outside .claude.json/settings.json/plugin .mcp.json entirely. moltbloat reads it and flags a managed server colliding with a global, per-project, or plugin-provided MCP.

Fully dynamic

All checks are structural β€” no hardcoded plugin names or curated opinion lists. The audit detects redundancy by analyzing what's actually installed and where things overlap, not by maintaining a database of "X replaces Y." The ecosystem evolves fast; moltbloat keeps up automatically.

CLAUDE.md / SKILL.md staleness

Anthropic recommends periodically rewriting CLAUDE.md because Claude Code itself changes fast enough to make old instructions stale. /moltbloat:audit cross-references your CLAUDE.md and SKILL.md files against a dated snapshot of Claude Code's own changelog (renamed/removed commands, removed config keys, capability changes) alongside verbosity and structure heuristics and slash-command references that no longer resolve. The deprecation table is a documented snapshot, not a live feed, and this check never rewrites your files, only reports.

Instruction quality

/moltbloat:audit finds every instruction file Claude Code loads for the project (user and project CLAUDE.md, ancestors, CLAUDE.local.md, AGENTS.md, rules, auto memory, @imports) and how each loads, then lints the always-loaded ones: two diverged copies of the same section (a conflict Claude may resolve either way), exact duplicates, emphatic wording written for older models, leftover claude import markers, placeholders, and files over a byte budget. For leftover import markers and sections repeated within one file it shows a suggested rewrite as a diff, and refuses any rewrite that would lose code, a URL, an @import, or a file path; emphasis and cross-file duplicates are reported for you to fix. It never edits your files.

Delegation cost

/moltbloat:usage prices every subagent run from its own recorded tokens (per-model rates, cache writes and reads, output) and shows spend by agent type and model, the fixed cost of spinning up a fresh subagent, and Opus/Fable runs that only read files and replied briefly, re-priced on a cheaper model as a candidate rather than a verdict. /moltbloat:audit flags agents with no model: pin that have real spend, and instruction prose that asks for a model tier an agent's pin contradicts.

Hook context

The context ledger records, for each SessionStart hook, how much text it injects, whether that text is identical in every sampled session, and how emphatic it is. /moltbloat:audit reports hooks that inject the same large block every session (a candidate for show-once) and hooks whose text shouts, naming the plugin that owns them.

Multiple Claude configs

moltbloat follows CLAUDE_CONFIG_DIR: it reads transcripts, plugins, agents, rules, and the user CLAUDE.md from the active config dir, and keeps its own data (usage log, snapshots, profiles, config, backups) separately per config, in ~/.moltbloat/configs/<config dir>/ for any config other than the default ~/.claude. Reports name the config they measured.

Guarded fixes

/moltbloat:clean can apply three instruction fixes, one confirmed change at a time: remove leftover import markers and exact duplicate sections, drop one side of a drifted duplicate you choose, or add a model: pin to an agent. Each shows the diff first, backs the file up to ~/.moltbloat/backups/, refuses if the file changed after you reviewed it, and never touches plugin-owned files.

Usage-aware recommendations

Cross-references audit findings with actual usage data. A plugin with zero usage that duplicates another plugin's functionality gets flagged as high priority for removal. Usage tracking is silent and automatic.

Smart cleanup

The profile suggest command analyzes your ecosystem + usage + audit findings to recommend an optimized profile. It states the saving as each disabled plugin's measured always-on context per session, from the context ledger (skill listing entries, deferred MCP tool names, MCP instructions, hook output); plugins with no measurement are shown as "not measured", not guessed.

Configuration

Customize thresholds, costs, and defaults in ~/.moltbloat/config.json:

  • Token warning/critical thresholds
  • Auto-compact usage data
  • Ignored findings (false positives)
  • Cost rates for new models

What it checks

  • Measured context: reads what each session actually loaded from Claude Code's transcripts (skill listing, deferred MCP tool names, MCP instructions, agent listing, SessionStart hook output, instruction files) instead of estimating, and flags skills whose descriptions were dropped because the listing hit its size budget.
  • Plugins: disabled, zero-skill, stale cache versions
  • MCP servers: duplicates of native features or other plugins, including org-managed managedMcpServers
  • Claude.ai connectors: org-managed connectors overlapping a local plugin/MCP
  • Skills: cross-plugin overlap and name collisions, including local .claude/skills/ shadowing a plugin skill
  • CLAUDE.md / SKILL.md: staleness against Claude Code's own changelog, verbosity, and bloat
  • Agents: local vs plugin-provided duplicates
  • Rules: language sets that don't match project languages
  • Hooks: conflicts, injection load, context bloat
  • Stale configs: orphaned sessions, old caches, dead project refs
  • Token cost: how much context each component consumes, in dollars
  • Usage: what's actually invoked vs just installed
  • Semantic duplicates: plugins with similar functionality (e.g., two Vercel plugins)
  • Usage correlation: zero-usage plugins flagged for priority removal

Health Score

The audit produces a 0-100 health score:

  • 90-100: Pristine β€” minimal bloat
  • 70-89: Healthy β€” some cleanup opportunities
  • 50-69: Bloated β€” significant redundancy
  • 0-49: Critical β€” major cleanup needed

Team Usage

  1. Each member installs moltbloat
  2. Each runs /moltbloat:snapshot to export their state
  3. Share snapshots in a shared directory or config repo
  4. Run /moltbloat:team-report to aggregate and standardize

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages