Skip to content
Agentmart
Submit a tool

cleanup

Discover and remove local development artifacts that belong to finished or abandoned work, including worktrees, branches, stashes, processes, watchers…

Skill by jesse-merhi

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jesse-merhi-cleanup

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Discover and remove local development artifacts that belong to finished or abandoned work, including worktrees, branches, stashes, processes, watchers, containers, volumes, build outputs, and simulator state. Use when asked to clean up after a task, PR, branch, worktree, or dev environment; not for source-code refactoring or remote resource deletion.

Use cases: productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cleanup

What's inside

Skill name
cleanup
Description
Discover and remove local development artifacts that belong to finished or abandoned work, including worktrees, branches, stashes, processes, watchers, containers, volumes, build outputs, and simulator state. Use when asked to clean up after a task, PR, branch, worktree, or dev environment; not for source-code refactoring or remote resource deletion.
License
MIT
Instructions
101 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • files: referenced but missing: references/artifact-discovery.md

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Cleanup

Treat cleanup as an ownership problem, not a keyword search. Find the complete
local footprint of the target work, remove what is proven disposable, preserve
saved or shared state, and verify the footprint is gone.

## Scope and authority

A request to clean up authorizes removal of clearly target-owned, local,
disposable artifacts. It does not authorize deletion of remote branches or
resources, user-authored work, credentials, shared infrastructure, or
machine-wide caches.

Before mutating anything, identify:

- the target repository, worktree, branch or stack, and whether it is merged or
  explicitly abandoned
- exact identity signals such as absolute paths, Git refs, project names,
  Compose labels, process working directories, ports, bundle IDs, and simulator
  or emulator names
- a stable checkout or directory from which cleanup can continue if the target
  worktree disappears

If the target is not clear, infer it from the current task, repository state,
and recent commands. Ask only when multiple live targets remain plausible or a
choice changes what data will be lost.

## Discover the footprint

Read repository instructions and cleanup scripts before inventing commands.
Inspect the tools and services the work actually used, then read
[the artifact discovery guide](references/artifact-discovery.md) for the
relevant categories.

Build one inventory with each item classified as:

- **remove**: exact target ownership and disposable state are established
- **keep**: shared, active, reusable, remote, or unrelated
- **decision**: ownership or data value is ambiguous

Use native ownership metadata first: Git worktree records, Compose project
labels, Watchman roots, process working directories, pidfiles, service
manifests, and platform identifiers. A matching substring alone is not proof.

Discovery is complete when every artifact category implied by the repository,
task history, and running tools has been inspected and every found item is
classified. Report the inventory before deletion only when it contains a
decision item or the user asked for a dry run.

## Protect recoverable work

Stop and request a decision before removing:

- uncommitted or untracked files that may be user-authored
- a branch with unique commits that is neither merged nor explicitly abandoned
- a stash that cannot be tied unambiguously to the target
- a volume, database, simulator, emulator, or cache that may contain reusable
  data or serve another checkout
- infrastructure whose ownership is shared or unclear

Prefer ordinary Git deletion after proving ancestry. Force-delete a local
branch only after squash/rebase merge or abandonment is independently
confirmed. Remote deletion remains a separate, explicit action.

## Remove in dependency order

Keep the target worktree available until it has supplied the configuration and
identity evidence needed for cleanup. Then:

1. Stop target-owned processes, dev servers, and task runners gracefully when
   possible.
2. Use each tool's scoped teardown operation for services, containers,
   databases, networks, volumes, watchers, and platform state.
3. Remove target-owned temporary files, logs, sockets, pidfiles, generated
   outputs, and non-shared caches that remain.
4. Remove the Git worktree, matching local branch, target-specific stashes, and
   stale worktree metadata.

Run from the stable location, use exact paths or ownership selectors, and keep
shared services running. Broad commands such as global container pruning,
deleting every Watchman watch, generic `pkill`, shutting down every simulator,
or repository-wide forced `git clean` are outside scoped cleanup.

When the target is the agent's current worktree, finish all reads from it first,
run removal from the stable checkout, and make worktree deletion the final
filesystem mutation. Continue verification only from the stable location.

## Verify and report

Repeat the discovery queries using the same exact identities. Cleanup is
complete when every discovered item is either absent, deliberately retained,
or awaiting an explicit user decision, and the stable checkout is healthy.

Report:

- what was removed
- what was intentionally retained and why
- anything unresolved, including the exact decision needed
- whether remote branches or resources were left untouched

From jesse-merhi/skills, MIT.

More from jesse-merhi/skills

Signals

Stars
4
Forks
2
Open issues
0
Last commit (this folder)
Sep 4, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jesse-merhi

Cite this page

cleanup skill. Agent Mart. https://agentmart.dev/skills/jesse-merhi-cleanup (last updated 2026-10-24)