spectre-clean

spectre-clean is a skill for Claude Code from joenandez/spectre. It costs 85 tokens per session (1,180 once invoked), scanned A, original, MIT.

An end-to-end cleanup workflow for a completed software change. It coordinates removing unused code, running risk-based tests, reviewing the resulting changes, and committing the work through focused steps.

In plain words
What is it for?
Use it after finishing a feature or branch when you need coordinated pruning, testing, review, and commit hygiene.
Why use it?
It provides a repeatable final pass for finding leftover code and problems after implementation or validation.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions subagents.

Good fit Use it after finishing a feature or branch when you need coordinated pruning, testing, review, and commit hygiene.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joenandez/spectre/spectre-clean
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 joenandez/spectre --skill spectre-clean
Clone the repo
git clone --depth 1 https://github.com/joenandez/spectre

Made for: Claude Code.

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 spectre-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/joenandez/spectre/spectre-clean/github.svg)](https://agentmods.dev/skills/joenandez/spectre/spectre-clean)
Your own site
<a href="https://agentmods.dev/skills/joenandez/spectre/spectre-clean"><img src="https://agentmods.dev/badge/skills/joenandez/spectre/spectre-clean/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 spectre-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/joenandez/spectre/spectre-clean"><img src="https://agentmods.dev/badge/skills/joenandez/spectre/spectre-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,180 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00085 $0.01180
Opus 5 $0.00043 $0.00590
Sonnet 5 $0.00017 $0.00236
Haiku 4.5 $0.00009 $0.00118

Measured today against content hash 158413682d08, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

spectre-clean 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 today.

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/spectre-codex/skills/spectre-clean/SKILL.md · 66 lines

How it starts

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

clean

End-to-end cleanup utility. The primary owns scope, risk assessment, sequencing, and synthesis. It is not a Ship dependency; phase work uses spectre-prune, spectre-test, and spectre-sweep.

Inputs

  • $ARGUMENTS — optional scope hint: commit/SHA, unstaged/staged, context/session, task dir, files, or --orchestrated when a parent workflow owns the next step.
  • FEATURE_ROOT — explicit feature name/root or one descendant feature artifact.

Working Set

  • Reuse a managed FEATURE_ROOT only when explicit/current-thread evidence ties it to this work (physical directory wins; never branch/recency/lifecycle/scans); distinct work ignores ambient roots. Otherwise, including on collision, standalone MUST first load and follow Skill(spectre-feature-root) through DONE; orchestrated calls escalate. Keep writes beneath it and pass it unchanged.
  • Resolve the same full working set used by prune/test/sweep from committed changes, staged, unstaged, and untracked files. If a provided ref/scope is invalid or ambiguous, stop and ask.
  • Keep the resolved file set and primary's compact P0-P3 risk plan in-thread; write no working-set/lifecycle artifact.

Outputs + DONE

  • Parallel prune and one test-lead result; manual-review/cross-boundary items preserved.
  • Primary P0-P3 risk plan, compact check results, one Sweep verification/commit boundary, and CLEANED_THROUGH_SHA.
  • Final report: prune/manual review · risk tiers · tests/affected checks · routed findings · sweep commits · CLEANED_THROUGH_SHA · NEEDS_AUTHORITY, if any.
  • DONE when: every phase ran in its owning subagent, the primary supplied risk tiers, repairable findings were repaired/routed by their owner, manual-review items surfaced, and sweep committed or returned genuine NEEDS_AUTHORITY.

Method / guardrails

  1. Resolve scope once. Establish files and feature root. Keep dynamic details out of the prompt body; read them live.
  2. Primary risk assessment. Classify every resolved file P0-P3:
    • P0: auth/payment/security/crypto/session/token, PII/permissions/user-data mutation, external handlers, DB migrations, @critical.
    • P1: feature components, API/state/business logic, fetch/cache, user-visible errors.
    • P2: exported real-logic utilities, validators, transformers, adapters, hooks.
    • P3: docs/styles/config/types/constants/barrels/pass-throughs/generated files. Keep a compact plan in-thread: - [P{tier}] {file}: {behavior or SKIP reason}.
  3. Parallel phases. In one dispatch, start one prune lead for Skill(spectre-prune) and one test lead for Skill(spectre-test) with the unchanged resolved set, {FEATURE_ROOT}, and the risk plan. Each uses --orchestrated; the test lead owns any internal tester batching. They return compact changed-path/check results, manual-review items, and cross-boundary needs; neither stages nor commits.
  4. Sweep phase. Dispatch a sweep lead with the unchanged set and compact phase results. Skill(spectre-sweep) runs only stale/uncovered integrated checks, repairs attributable failures, and is the sole pre-rebase commit owner.
  5. Synthesize. Route repairable/cross-boundary findings to their owner; report final state, the Sweep commit CLEANED_THROUGH_SHA, routed findings, and genuine authority/safety impasses.

Read the full file on GitHub · 66 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. today Changed · +5 lines 158413682d08
  2. 5d ago Changed · -3 lines · -4 tokens per session c9b409b5c8ef
  3. 11d ago First seen · 64 lines · 89 tokens per session scan A e799792203e1

Subscribe to this mod's changes

spectre-clean is a skill published in the GitHub repository joenandez/spectre (161 stars, last pushed yesterday), licensed MIT. It adds 85 tokens to every session and 1,180 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

agent-merge-conflict-arbiter

Neutral arbiter for merge conflicts between two agents.

NousResearch/hermes-agent · 19 tokens

git-advanced-workflows

Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.

wshobson/agents · 54 tokens

bisect

Bisect regressions or broken builds in the Chromium repository using deterministic binary search, checking out midpoint commits, syncing dependencies with gclient sync, compiling the target with autoninja, and querying the user for test results until the culprit commit is isolated.

chromium/chromium · 52 tokens

mantis-critic

Assesses the production viability of findings, filtering out debug-only features and assertion traps. Use when findings have been validated and you need to confirm they are triggerable in production release builds (with assertions disabled). Don't use for writing reproduction scripts or patches.

google/mantis · 55 tokens

hotpath_bump

Bump the hotpath version number across the workspace and related files. Updates crate versions in Cargo.toml files (exact patch version) and version references in the backend middleware, hotpathinit skill, and README (major.minor only). Use when the user wants to bump, bump the version, or release a new hotpath…

pawurb/hotpath-rs · 73 tokens

comet-github-issue-fix

A workflow for fixing a confirmed Comet-related GitHub issue or review blocker within an isolated scope. It covers matching the work to the relevant workflow, testing the change, checking runtime results, and preparing a careful handoff.

rpamis/comet · 71 tokens