unstale

unstale is a skill for Claude Code from dgilford/ai-science-toolkit. It costs 188 tokens per session (2,368 once invoked), scanned A, original, MIT.

A cleanup tool for Python library code and Jupyter notebooks. It looks for unused imports, unreachable code, outdated comments or docstrings, finished TODOs, and handoff blockers.

In plain words
What is it for?
Use it to inspect Python libraries or notebooks, choose report-only or automatic cleanup, and distinguish deliverable notebooks from exploratory working notebooks.
Why use it?
Refactors often leave behind notes and code that no longer match the project. This tool helps find that leftover material and can apply high-confidence fixes in its automatic mode.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ai-science-toolkit plugin — 21 skills, 4 agents shipped together

Good fit Use it to inspect Python libraries or notebooks, choose report-only or automatic cleanup, and distinguish deliverable notebooks from exploratory working notebooks.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add dgilford/ai-science-toolkit
Claude Code
/plugin install ai-science-toolkit

Made for: Claude Code.

Or install ai-science-toolkit, the plugin that ships this one along with the rest of its 21 skills, 4 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 unstale

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/dgilford/ai-science-toolkit/unstale"><img src="https://agentmods.dev/badge/skills/dgilford/ai-science-toolkit/unstale.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 188 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,368 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.00188 $0.02368
Opus 5 $0.00094 $0.01184
Sonnet 5 $0.00038 $0.00474
Haiku 4.5 $0.00019 $0.00237

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

Security

Grade A, and why

unstale 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 10d 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.

skills/unstale/SKILL.md · 202 lines

How it starts

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

Governing principle: deterministic where you can, LLM where you must — adapt to the repo, never dictate its structure.

Live state

git status --short 2>/dev/null || echo "(not a git repo)"

Mode overview

Invocation Target Edits?
/unstale Auto-detected .py library scope Report only
/unstale --auto Same Apply HIGH fixes
/unstale --artifact <nb.ipynb> Notebook as deliverable Report only
/unstale --artifact <nb.ipynb> --auto Same Apply HIGH fixes
/unstale --exploratory <nb.ipynb> Working notebook Report only (always)

--artifact and --exploratory are notebook-only. If a path ends in .py, warn and skip it.


Default mode — scope auto-detection

Signal Scope
pyproject.toml / setup.py / src/ / importable package dir Library → run both lanes
Top-level .py with no package structure Ambiguous → skip Lane A (dead-code)
Only .ipynb files No .py scope → nudge to --artifact / --exploratory

Check for a CLAUDE.md override line: unstale library scope: <path>; treat <glob> as exploratory. Use it if present.

Always state the detected scope in the report. If notebooks exist but weren't scanned, emit:

"N notebooks present — run /unstale --artifact <path> (clean as deliverable) or --exploratory <path> (tidy) to check them."


Default mode — two lanes

Lane A — Deterministic

Run on detected library scope. Tag findings DETERMINISTIC-LINT or DETERMINISTIC-DEADCODE.

ruff check --select F401 <library-scope>       # unused imports
vulture <library-scope> --min-confidence 80    # dead code

Lane B — LLM judgment

Do not re-detect dead code or unused imports — Lane A owns them. Scan for:

  • Comments describing logic that has since changed
  • Contradictory or outdated docstrings
  • Resolved TODOs (is the work actually done?)
  • Stale filepaths / README instructions (verify against repo tree)
  • Outdated .ai/HANDOFF.md blockers

Read the full file on GitHub · 202 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. 10d ago First seen · 202 lines · 188 tokens per session scan A e11f678e2a09

Subscribe to this mod's changes

unstale is a skill published in the GitHub repository dgilford/ai-science-toolkit (62 stars, last pushed 21d ago), licensed MIT. It adds 188 tokens to every session and 2,368 once invoked, about $0.0009 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

opencli-autofix

Automatically fix broken OpenCLI adapters when commands fail. Load this skill when an opencli command fails — it guides you through collecting a trace artifact, patching the adapter, retrying, and filing an upstream GitHub issue after a verified fix. Works with any AI agent.

jackwener/OpenCLI · 61 tokens

omh-failure-signal-audit

This is a Hermes-native failure-signal-audit workflow skill.

rlaope/oh-my-hermes · 74 tokens

report-issue-local

File a bug or feature request against this MCP server's own repo. Use for server-specific issues — tool logic, service integrations, config problems, or domain bugs that aren't caused by the framework.

cyanheads/obsidian-mcp-server · 44 tokens

thinking-five-whys-plus

When a fault is localized and the proximate cause is known but the systemic root is not, chain evidence-linked whys with a counterfactual stop and a countermeasure.

tjboudreaux/cc-thinking-skills · 41 tokens

thinking-map-territory

When a claim, doc, test, metric, or assumption conflicts with observed behavior, stop theorizing from the map and verify the live code or data; let territory overrule.

tjboudreaux/cc-thinking-skills · 42 tokens

unicli-repair

Evidence-driven repair workflow for a broken Uni-CLI adapter. Trigger on a failed unicli envelope, a quarantined adapter, or an explicit adapter-repair request. Classifies non-source failures, edits only the reported adapter path, and uses the original command as a bounded oracle.

olo-dot-io/Uni-CLI · 68 tokens