safe-fix-mcp

safe-fix-mcp is a skill for Claude Code, Codex from pamela-0/safe-fix-mcp. It costs 144 tokens per session (570 once invoked), scanned A, original, MIT.

A Python code-cleanup skill that finds unused imports, functions, classes, and dependencies using static analysis. Static analysis checks source code without running the whole application.

In plain words
What is it for?
Use it to scan a Python repository for bloat, review unused-code findings, or create a guarded branch and pull request for safely removable unused imports.
Why use it?
It separates likely dead code from code that is still used and only proposes removal after safety checks and tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to scan a Python repository for bloat, review unused-code findings, or create a guarded branch and pull request for safely removable unused imports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pamela-0/safe-fix-mcp/skill
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.

Any agent
npx skills add pamela-0/safe-fix-mcp --skill skill
Clone the repo
git clone --depth 1 https://github.com/pamela-0/safe-fix-mcp

Made for: Claude Code, Codex.

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 safe-fix-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/pamela-0/safe-fix-mcp/skill/github.svg)](https://agentmods.dev/skills/pamela-0/safe-fix-mcp/skill)
Your own site
<a href="https://agentmods.dev/skills/pamela-0/safe-fix-mcp/skill"><img src="https://agentmods.dev/badge/skills/pamela-0/safe-fix-mcp/skill/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 safe-fix-mcp

Your own site · 80×15
<a href="https://agentmods.dev/skills/pamela-0/safe-fix-mcp/skill"><img src="https://agentmods.dev/badge/skills/pamela-0/safe-fix-mcp/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 570 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.00144 $0.00570
Opus 5 $0.00072 $0.00285
Sonnet 5 $0.00029 $0.00114
Haiku 4.5 $0.00014 $0.00057

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

Security

Grade A, and why

safe-fix-mcp 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.

The scan reads SKILL.md. This mod also ships 1 executable file (__init__.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

src/safe_fix_mcp/skill/SKILL.md · 26 lines

What it actually says

safe-fix-mcp

Real static-analysis dead-code detection for Python repos — not a guess. vulture + deptry under the hood, wrapped in a safety-gated auto-PR flow.

When to use each tool

Always start with scan_dead_code (read-only, never modifies anything):

  • Call it whenever the user wants a dead-code/bloat report, before recommending any deletion.
  • Default min_confidence=60 is fine for a first pass; raise it (e.g. 80-90) if the user reports false positives — Pydantic/TypedDict fields and similar dynamic-access patterns commonly show up as false "unused" at low confidence.
  • Present findings grouped by kind (unused imports vs. unused functions/classes vs. unused dependencies) — only the first category is ever auto-removable by this tool.

Only call propose_removal_pr when the user explicitly wants the safe subset actually removed, not just reported:

  • It only touches unused imports on single-name import lines (import x — never from x import y, z, since removing the whole line would silently remove z too).
  • It refuses on a dirty working tree — tell the user to commit or stash first if it reports that.
  • It creates a branch, runs the repo's own real full test suite, and only commits/pushes/opens a PR if that suite actually passes. If gh isn't installed/authenticated, the branch still gets pushed for real — only PR creation degrades.
  • A human still merges the PR — never describe this tool as having merged anything itself.

What not to do

Don't hand-remove dead code yourself with Edit/Write once this tool is available — route removals through propose_removal_pr so they stay gated on the real test suite, not your own judgment of what's safe. Don't report unused functions, classes, or dependencies as "safe to auto-remove" — only single-name unused imports are; everything else needs a human decision.

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 26 lines · 144 tokens per session scan A c5f0c5c331ca

Subscribe to this mod's changes

safe-fix-mcp is a skill published in the GitHub repository pamela-0/safe-fix-mcp (1 stars, last pushed 18d ago), licensed MIT. It adds 144 tokens to every session and 570 once invoked, about $0.0007 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-08-31.

Related

Other skills, from other repositories

ai-development-guide

Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates. Use when reviewing general/backend implementation choices, code smells, failures, or implementation completeness.

shinpr/claude-code-workflows · 43 tokens

dorodango

Polishes working code through successive quality passes in fresh subagents. Use after tests pass when code needs multi-dimension refinement before release.

athola/claude-night-market · 31 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:test-driven-development

Enforcing the RED-GREEN-REFACTOR loop: write one failing test and watch it fail, write minimal code to pass, then refactor green. Use when starting implementation of a new feature or bugfix, or writing any new production code. Requires pasted failure output as proof of RED; code written before its test must be…

LerianStudio/ring · 89 tokens

code-confidence-map

Assesses code comprehensibility and maintainability risk. Use when the user asks about code confidence, risk, maintainability, tech debt, code health, or whether code is safe to change. Also use when the user asks to analyze code quality, scan for risks, check if code is messy or complex, audit code, do a code…

kanyun-inc/reskill · 104 tokens

time-bomb-radar

Finds deferred operations that crash on aged data -- code that passes every test but breaks weeks or months after release. Covers cascade deletes, cache expiry, trial paths, background accumulation, date-threshold transitions, and scheduled side effects. Triggers: "time bomb", "time-bomb", "/time-bomb-radar", "aged…

Terryc21/radar-suite · 80 tokens