Agent skill

Loop Clean

by getlago in getlago/lago-front

Cleanup phase of the loop pipeline for lago-front, for the worktree layout only.

AGPL-3.0Auto-check passedDevelopment

Install Loop Clean

skills CLI
$ npx skills add getlago/lago-front --skill loop-clean -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install getlago/lago-front loop-clean --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/getlago/lago-front.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/loop-clean .claude/skills/loop-clean && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
loop-clean
GitHub stars
163
Token cost
~816 tokens
SKILL.md length
352 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Cleanup phase of the loop pipeline for lago-front, for the worktree layout only.

  • Works in 6 steps: List candidates: worktree names from… → Check merge state for each candidate → Safety check on each merged candidate —… → …
  • User says /loop-clean
  • SKILL.md covers Steps and Hard rules
  • Calls git and gh

What it does

Loop Clean is an agent skill from getlago/lago-front. Cleanup phase of the loop pipeline for lago-front, for the worktree layout only. Finds local worktrees in front-worktrees/ whose PR is merged and destroys them via lago-worktree destroy, after user confirmation. Use when user says "/loop-clean", asks to clean up merged worktrees, or the loop-run orchestrator runs its sweep step.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: Open Source Metering and Usage Based Billing. The licence is AGPL-3.0.

When your agent uses it

  • User says /loop-clean
  • Asks to clean up merged worktrees
  • The loop-run orchestrator runs its sweep step

Example prompts

  • “/loop-clean”
  • “/loop-clean”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. List candidates: worktree names from front-worktrees/ starting with a Linear issue ID — pattern ^[A-Z]+-\d+(-.*)?$ (any team prefix, with…
  2. Check merge state for each candidate
  3. Safety check on each merged candidate — skip WITH a warning if
  4. Confirm with the operator (ALWAYS — destroy is irreversible: deletes containers, volumes, local branches front+API, all files): show the…
  5. Destroy each confirmed name, answering the script's own y/N prompt
  6. Report: destroyed / skipped-with-reason / nothing-to-do.

What it can do on your machine

Read from SKILL.md and the folder at commit 79b5b3d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Loop Clean loads about 816 tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 352 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~816

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from getlago/lago-front at commit 79b5b3d, republished under its AGPL-3.0 licence (© getlago). 352 words, ~816 tokens.

Download SKILL.mdSave it as .claude/skills/loop-clean/SKILL.md (or your agent's skills folder).
name
loop-clean
description
Cleanup phase of the loop pipeline for lago-front, for the `worktree` layout only. Finds local worktrees in front-worktrees/ whose PR is merged and destroys them via lago-worktree destroy, after user confirmation. Use when user says "/loop-clean", asks to clean up merged worktrees, or the loop-run orchestrator runs its sweep step.

Loop Clean — sweep worktrees of merged PRs

Repo: the lago monorepo root; worktrees in front-worktrees/, slot registry in .worktree-slots.

Scope: the worktree layout only. Runs made with loop-run --in-place (a Conductor workspace, a plain git worktree, a second clone) own no front-worktrees/ entry and are invisible here — their cleanup belongs to whoever owns the checkout, which under Conductor means archiving the workspace. loop-run skips the sweep entirely in that layout; invoked directly from a Conductor workspace, report "nothing to do — in-place layout" and stop.

Steps

  1. List candidates: worktree names from front-worktrees/ starting with a Linear issue ID — pattern ^[A-Z]+-\d+(-.*)?$ (any team prefix, with or without the topic slug suffix, e.g. <TEAM>-<N>-swap-customer-overview-connection). Cross-check .worktree-slots.

  2. Check merge state for each candidate:

    bash
    gh pr view <name> --repo getlago/lago-front --json state,mergedAt
    • "state": "MERGED" → cleanup candidate.
    • "state": "CLOSED" (closed WITHOUT merge — abandoned PR) → candidate too, but flagged separately in the confirmation list as "closed without merge — work was never shipped, destroy anyway?".
    • "state": "OPEN" or no PR found → NEVER a candidate, skip silently. Pending work is untouchable.
  3. Safety check on each merged candidate — skip WITH a warning if:

    • Worktree dirty: git -C front-worktrees/<name> status --porcelain non-empty (uncommitted work — never destroy it).
    • Unpushed commits: git -C front-worktrees/<name> log origin/<name>..HEAD --oneline non-empty.
  4. Confirm with the operator (ALWAYS — destroy is irreversible: deletes containers, volumes, local branches front+API, all files): show the list of names about to be destroyed plus the skipped ones with reasons. Proceed only on explicit yes.

  5. Destroy each confirmed name, answering the script's own y/N prompt:

    bash
    printf 'y\n' | lago-worktree destroy <name>

    (lago-worktree = front/scripts/lago-worktree.sh if the alias is unavailable.)

  6. Report: destroyed / skipped-with-reason / nothing-to-do.

Show full SKILL.md (92 more words)Show less

Hard rules

  • NEVER destroy without the operator's explicit confirmation in this session.
  • NEVER destroy a dirty worktree or one with unpushed commits — skip and warn instead.
  • Only names starting with a Linear issue ID (^[A-Z]+-\d+): never touch other worktrees (base-app, admin-ui, ...).
  • Nothing on the remote is ever touched.
  • Two communication registers: messages to humans (chat report, notifications) = short, direct, plain language, no deep-tech jargon. Internal state files (spec.md, review.md, histories, working notes) = written for the AI of a later iteration: dense, precise, full paths/symbols/error strings — optimize for machine effectiveness, not human readability.

© getlago, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/loop-clean of getlago/lago-front.

Open the folder on GitHubat commit 79b5b3d

Compare with similar skills

Loop Clean next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Loop Clean compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Loop Clean this skillgetlago/lago-front163—~816Automated safety check: PassAGPL-3.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k33 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 33 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from getlago/lago-front

All 17 skills in this repo
  • Babysit

    getlago/lago-front

    A skill your agent uses when asked to babysit, monitor, shepherd, or keep working on a GitHub pull request until it is green, review-ready, approved, mergeable, or ready to merge.

    163 GitHub stars~5.2k tokensUpdated today
    Auto-check passed
  • Cve Doctor

    getlago/lago-front

    Triage a CVE / Dependabot alert in a JS/TS project and recommend the least-invasive fix.

    163 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Extract Section To Drawer

    getlago/lago-front

    Extract a Formik form section into a TanStack Form drawer with Zod validation, following the plan form migration pattern.

    163 GitHub stars~4k tokensUpdated today
    Auto-check: notes
  • Loop Build

    getlago/lago-front

    Phase 2 of the loop pipeline for lago-front. An agent skill from getlago/lago-front.

    163 GitHub stars~3.5k tokensUpdated today
    Auto-check: notes
  • Loop Flywheel

    getlago/lago-front

    Harvest phase of the loop pipeline for lago-front. An agent skill from getlago/lago-front.

    163 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Docker Expert

    getlago/lago-front

    You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production…

    163 GitHub starsUsed in 9 repos~3.6k tokens
    Auto-check passed

Works with

Categories

Questions about Loop Clean

What does Loop Clean do?

Cleanup phase of the loop pipeline for lago-front, for the worktree layout only. Loop Clean is an agent skill from getlago/lago-front. Cleanup phase of the loop pipeline for lago-front, for the worktree layout only.

When should I use Loop Clean?

Loop Clean fits situations like: user says /loop-clean; asks to clean up merged worktrees; the loop-run orchestrator runs its sweep step.

How do I install Loop Clean in Claude Code?

Run `npx skills add getlago/lago-front --skill loop-clean -a claude-code`. Or copy the skill folder (.agents/skills/loop-clean in getlago/lago-front) into .claude/skills/loop-clean in your project. Claude Code loads it when a task matches its description.

How do I install Loop Clean in Codex?

Run `npx skills add getlago/lago-front --skill loop-clean -a codex`. Or copy the skill folder (.agents/skills/loop-clean in getlago/lago-front) into .agents/skills/loop-clean in your project. Codex loads it when a task matches its description.

Can I use Loop Clean in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getlago/lago-front --skill loop-clean -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loop-clean, .gemini/skills/loop-clean, .github/skills/loop-clean and .opencode/skills/loop-clean in your project.

What does Loop Clean need to run?

Going by SKILL.md and its folder, Loop Clean needs the command-line tools its instructions call (git and gh).

Does Loop Clean access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Loop Clean safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Loop Clean use?

Loop Clean is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Loop Clean use?

About 816 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Loop Clean?

Skills that share tags, products or a category with Loop Clean: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Loop Clean?

getlago (a GitHub organization) maintains it in getlago/lago-front, which has 163 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: getlago/lago-front on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.