sweeping-local-state

sweeping-local-state is a skill for Claude Code, Codex from bostonaholic/team. It costs 25 tokens per session (872 once invoked), scanned C, original, MIT.

A cleanup procedure for machine-local resources left after a pull request is merged, closed, or reviewed. A pull request is a proposed code change; these resources can include databases, containers, queues, buckets, caches, and temporary files.

In plain words
What is it for?
Use it after pull-request work to remove the resources assigned to this procedure, including local services, test storage, caches, and recorded temporary scratch files.
Why use it?
Removing a Git branch or worktree does not remove the supporting resources created during development, so they can remain on the machine unnoticed.

Skill for Claude CodeCodex

Written for Claude Code and Codex: user-invocable in frontmatter, but also agents/openai.yaml present.

Part of the team plugin — 92 skills, 13 agents, 2 hooks shipped together

Good fit Use it after pull-request work to remove the resources assigned to this procedure, including local services, test storage, caches, and recorded temporary scratch files.

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

Made for: Claude Code, Codex.

Or install team, the plugin that ships this one along with the rest of its 92 skills, 13 agents, 2 hooks.

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 sweeping-local-state

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bostonaholic/team/sweeping-local-state"><img src="https://agentmods.dev/badge/skills/bostonaholic/team/sweeping-local-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 872 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00025 $0.00872
Opus 5 $0.00013 $0.00436
Sonnet 5 $0.00005 $0.00174
Haiku 4.5 $0.00003 $0.00087

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

Security

Grade C, and why

sweeping-local-state scanned grade C with 1 finding 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 5d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "${P:?}"
skills/sweeping-local-state/SKILL.md · 81 lines

How it starts

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

Sweeping Local State

Remove only provisioned resources and recorded temp paths. Read references/procedure.md. skills/pr-cleanup/SKILL.md and worktree-isolation own git state.

Ownership boundary

This skill owns databases, containers, queues, buckets, caches, and recorded temp paths. Never re-run a step the caller owns: worktrees, branches, refs, docs/plans/<id>/, or stale worktree directories.

Inputs: validated absolute PRIMARY_ROOT, DEFAULT, BRANCH, and optional WORKTREE. Derive missing repo/default values through pr-cleanup steps 0/1.

.teamteardown

Only the default-branch copy can run. Never read .teamteardown from the working tree or from the finished branch. Try:

git -C "${PRIMARY_ROOT:?}" show "origin/${DEFAULT:?}:.teamteardown" 2>/dev/null ||
  git -C "${PRIMARY_ROOT:?}" show "refs/heads/${DEFAULT:?}:.teamteardown" 2>/dev/null

Guard and execute in one shell invocation:

: "${PRIMARY_ROOT:?refusing: primary clone unresolved}"
: "${DEFAULT:?refusing: default branch unresolved}"
cd "$PRIMARY_ROOT"
DECL="$(git -C "$PRIMARY_ROOT" show "origin/$DEFAULT:.teamteardown" 2>/dev/null ||
        git -C "$PRIMARY_ROOT" show "refs/heads/$DEFAULT:.teamteardown" 2>/dev/null)"
[ -n "$DECL" ] || { echo "No .teamteardown on $DEFAULT — nothing declared."; exit 0; }
printf '%s\n' "$DECL" |
  while IFS= read -r line; do
    case "$line" in ''|'#'*) continue ;; esac
    printf 'teardown: %s\n' "$line"
    TEAM_REPO_ROOT="$PRIMARY_ROOT" TEAM_BRANCH="$BRANCH" TEAM_WORKTREE="$WORKTREE" \
      sh -c "$line" </dev/null ||
      printf 'teardown FAILED (exit %s): %s\n' "$?" "$line" >&2
  done

Run lines verbatim in file order. Report failures and continue. Kill and report TIMEOUT after roughly 120 seconds. Never invent a teardown command. Never edit, re-quote, or interpolate a declared line (principle-never-interpolate). Never guess credentials.

Recorded temp paths

For each recorded absolute P, run these guards before removal:

Read the full file on GitHub · 81 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago Changed · -152 lines · -83 tokens per session bf07ac77b3d6
  2. 7d ago Changed · +1 lines 989f51c9feb9
  3. 10d ago First seen · 232 lines · 108 tokens per session scan C b32ebfe35837

Subscribe to this mod's changes

sweeping-local-state is a skill published in the GitHub repository bostonaholic/team (11 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 872 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.