agentleFS
tsubasaogawatsubasaogawa/skills/finding-unused-customizations/SKILL.md

finding-unused-customizations

Skill0 starsChanged 32 days agoMITView on GitHub

List the custom skills and subagents defined for Claude Code (user-level ~/.claude and the current project's .claude), count how often each was used in recent Claude Code transcripts, and report the ones not used in the last N days (default 14) as a table with a one-line description of each. Use when the user asks which custom skills or agents have gone unused, are stale, or are candidates for cleanup. Claude Code only. Not for unused code, plugins, MCP servers, hooks, or other tools' logs, and it never deletes or disables anything.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the value is not a positive integer, say so in one line and stop.

    line 22
  2. Very specific:

    If the user mentions running Claude Code in another environment too, ask whether to include that environment's projects directory and pass …

    line 25
  3. Very specific:

    Use python -I instead where python3 does not exist.

    line 34
  4. Distinctive:

    If the script fails, show the error as-is and stop.

    line 45
  5. Distinctive:

    If the issue says the file is unreadable, try reading it once more with Read.

    line 61
  6. Distinctive:

    If nothing is unused, say so in one line instead of the table.

    line 63
  7. Distinctive:

    After the table, add only the items below that apply, one line each:

    line 67
  8. Distinctive:

    Use outside Claude Code transcripts is not counted: other tools such as Codex or Copilot CLI, Claude Code on other machines, and cloud …

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Finding Unused Customizations

Find the custom skills and subagents that were not used recently. The only deliverable is the report in chat. Do not delete, move, disable, or edit any definition.

Arguments

$ARGUMENTS takes the form [<days>] [--projects-dir <dir> ...].

  • <days>: length of the period in days.
    • Defaults to 14.
    • The period starts at local midnight <days> days before today.
    • If the value is not a positive integer, say so in one line and stop.
  • --projects-dir <dir>: an extra directory of Claude Code transcripts to scan, repeatable. ~/.claude/projects is always scanned.

If the user mentions running Claude Code in another environment too, ask whether to include that environment's projects directory and pass it with --projects-dir. Examples of such an environment: Windows and WSL, or a second home directory.

1. Run the script

python3 -I ~/.claude/skills/finding-unused-customizations/scripts/find_unused.py --days <days> [--projects-dir <dir> ...]

Use python -I instead where python3 does not exist. Run it from the project root, because project-level definitions are read from ./.claude.

The script prints one JSON document:

  • definitions: every agent (*.md in agents/) and skill (each directory in skills/) at the user and project scope, with description, uses, and issues
  • unmatched_invocations: names that were invoked in the period but match no definition. Plugin-qualified names (plugin:name) are left out
  • period_utc, projects_dirs, missing_projects_dirs, transcript_files: what was scanned

Usage is counted from three kinds of records in the period: Skill tool calls, Agent tool calls by subagent_type, and slash commands the user typed. A skill matches by its directory name or its frontmatter name.

If the script fails, show the error as-is and stop. Do not fall back to grepping the transcripts by hand.

2. Build the table

List every definition whose uses is 0, agents first, then skills, each in alphabetical order. Use these columns, with headers in the user's language:

ColumnContent
Kindagent or skill
Namethe directory name for a skill, the file name without .md for an agent
Scopeuser or project
Descriptionwhat it does, in one short phrase in the user's language, written from the frontmatter description

For a definition whose description is null, read the issues instead and say what is wrong in the Description cell, for example:

  • that the directory has no SKILL.md and is probably not a skill.

If the issue says the file is unreadable, try reading it once more with Read; if that also fails, say it could not be read.

If nothing is unused, say so in one line instead of the table.

3. Report what else was found

After the table, add only the items below that apply, one line each:

  • Definitions with issues, whether used or not:
    • unreadable files or broken links
    • a missing SKILL.md
    • a frontmatter that is not closed or whose closing --- is indented
    • a frontmatter name that differs from the directory name
  • unmatched_invocations that look like custom skills or agents that were renamed or removed.
    • Ignore built-in slash commands (compact, model, and so on) and built-in agents (Explore, general-purpose, and so on).
  • missing_projects_dirs, if any

4. State the coverage

End with the period and the transcript directories that were scanned, then the blind spots, so the user does not delete something that is in use:

  • Use outside Claude Code transcripts is not counted: other tools such as Codex or Copilot CLI, Claude Code on other machines, and cloud sessions
  • A skill followed by reading its SKILL.md directly, without the Skill tool or a slash command, is not counted
  • Claude Code deletes transcripts older than cleanupPeriodDays (30 days by default). If <days> is longer than that setting, older use may already be gone

What to avoid

  • Deciding for the user that something should be deleted. Report the facts; the user decides
  • Listing used definitions in the table, or listing built-in agents and plugin skills as custom ones
  • Saying a definition is unused when its file could not be read and the reason is unclear. Say it could not be checked

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.