factory-clean

factory-clean is a skill for Claude Code, Codex from tikalk/adlc-team-skills. It costs 41 tokens per session (908 once invoked), scanned A, original, MIT.

A project cleanup workflow that finds unused or abandoned worktrees, containers, dependencies, processes, locks, and other development leftovers. A worktree is a separate working copy of a Git repository.

In plain words
What is it for?
Use it to inspect what a project is using, identify safe cleanup candidates, and remove approved stale resources.
Why use it?
It helps reclaim disk space without deleting uncommitted or unpushed work or interrupting active agent runs.

Skill for Claude CodeCodex

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

Good fit Use it to inspect what a project is using, identify safe cleanup candidates, and remove approved stale resources.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tikalk/adlc-team-skills/factory-clean"><img src="https://agentmods.dev/badge/skills/tikalk/adlc-team-skills/factory-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 908 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.00041 $0.00908
Opus 5.5 $0.00016 $0.00363
Sonnet 5.5 $0.00008 $0.00182
Haiku 4.5 $0.00004 $0.00091

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

Security

Grade A, and why

factory-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 25d 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/factory/factory-clean/SKILL.md · 59 lines

How it starts

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

factory-clean

What this skill does

factory-clean is the resource-reclamation engine of the software factory. It answers two questions and acts on the second: what is this project costing this machine right now, and what can be reclaimed without destroying work or interrupting an agent that is still running?

It operates as a Kind-B control-plane skill that reads the run registry, identifies active worktrees, and cleans up discarded/stale artifacts.


When to use

  • After multiple parallel runs, to see which worktrees are safely removable and reclaim disk space.
  • To clean up abandoned or stale locks and leases.
  • To verify that no uncommitted or unpushed work is accidentally lost.

When NOT to use:

  • For routine code development or PR review (use factory-mission or factory-review).
  • To force-delete unpushed git commits or uncommitted files (this skill never deletes unsafe work).

Operating Process

1. Project Ingestion

Determine the project in scope (defaulting to the current repository). Identify its state root, run registry, and worktree root (.adlc/worktrees/).

2. Live-Work Classification

Before displaying any candidate for deletion, read the local state file and the comment bus (if tracker-integrated, via comment bus and lease markers). Classify every resource into one of these five liveness states:

  • in use — owned by a run whose lease is live (heartbeat_ts + ttl_seconds > now), or a path held open by an active process. Protected. Never offer for deletion.
  • holds work — a worktree with uncommitted changes or commits not on its remote, or a registry entry marked retained. Protected. Show exactly what it holds. Never delete.
  • stale — registered, lease is past its TTL, nothing is unsaved, and no running process holds its path or has it as a working directory. Candidate for deletion.
  • orphan — no registry entry exists, but canonical containment plus deterministic project, skill, and run ownership labels prove this skill family created it. Candidate for deletion.
  • unknown — ownership or liveness cannot be determined. Protected. Display to the user but do not offer for deletion.

Read the full file on GitHub · 59 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. 25d ago First seen · 59 lines · 41 tokens per session scan A 5586a2bf6cd8

Subscribe to this mod's changes

factory-clean is a skill published in the GitHub repository tikalk/adlc-team-skills (141 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 908 once invoked, about $0.0002 per session on Opus 5.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-09-21.

Related

Other skills, from other repositories