suwappubot: Command for Claude Code

.claude/commands/worktree-check.md

worktree-check is a command for Claude Code from 0xSoftBoi/suwappubot. It costs 34 tokens per session (496 once invoked), scanned A, original, Apache-2.0.

A read-only check for every Git worktree, which is a separate working directory connected to the same repository. It reports uncommitted files, committed changes that have not been pushed, branches, and stashes before risky Git operations.

In plain words
What is it for?
It helps review repository worktrees before resets, merges, removals, or cleanup, and identifies high-risk changes that should be rescued first.
Why use it?
It helps prevent deleting or resetting work that another coding session has created but not safely committed or pushed.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is 0xSoftBoi/suwappubot's own configuration. It tells Claude Code how to work on suwappubot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything suwappubot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to 0xSoftBoi/suwappubot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/0xSoftBoi/suwappubot/main/.claude/commands/worktree-check.md
Clone the repo
git clone --depth 1 https://github.com/0xSoftBoi/suwappubot

Made for: Claude Code.

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 worktree-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/0xsoftboi/suwappubot/worktree-check.svg)](https://agentmods.dev/commands/0xsoftboi/suwappubot/worktree-check)
Your own site
<a href="https://agentmods.dev/commands/0xsoftboi/suwappubot/worktree-check"><img src="https://agentmods.dev/badge/commands/0xsoftboi/suwappubot/worktree-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 496 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.00034 $0.00496
Opus 5 $0.00017 $0.00248
Sonnet 5 $0.00007 $0.00099
Haiku 4.5 $0.00003 $0.00050

Measured 8d ago against content hash 260aa6a25fc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

worktree-check 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 8d 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.

.claude/commands/worktree-check.md · 41 lines

What it actually says

Worktree Safety Check

Multiple Claude sessions run against this repo concurrently and share one stash stack. A past session lost agent changes to a worktree reset. Run this before any reset, checkout -f, worktree removal, or cleanup sweep.

Read-only. Never reset --hard, never git add -A, never bare git stash pop here.

Step 1 — Enumerate

git worktree list
git stash list --format='%gd %H %gs'

Step 2 — Per worktree, report what's at risk

For each path from git worktree list, run with -C <path>:

git -C <path> status --porcelain          # uncommitted / untracked
git -C <path> log --oneline @{u}..HEAD    # committed but UNPUSHED (ignore error if no upstream)
git -C <path> rev-parse --abbrev-ref HEAD

Step 3 — Verdict table

worktree branch uncommitted unpushed commits upstream risk

Risk = HIGH if uncommitted files exist or unpushed commits exist with no upstream; LOW if clean and pushed.

Step 4 — Rescue before destroying

If any worktree is HIGH risk and the user asked for a cleanup/reset:

  1. Stop. Do not run the destructive command yet.
  2. Offer rescue: in that worktree, HUSKY=0 git commit -am "wip: rescue <worktree>" then push to a rescue/<worktree>-<branch> branch.
  3. Only proceed after the user confirms, naming exactly which worktrees will be touched.

For stash entries: they may belong to another session. Never pop. Identify by message, git stash apply <sha>, then drop by re-finding the index by tag.

Step 5 — Output

A short table plus one line: SAFE TO PROCEED or WORK AT RISK IN: <paths>.

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. 8d ago First seen · 41 lines · 34 tokens per session scan A 260aa6a25fc9

Subscribe to this mod's changes

worktree-check is a command published in the GitHub repository 0xSoftBoi/suwappubot (3 stars, last pushed today), licensed Apache-2.0. It adds 34 tokens to every session and 496 once invoked, about $0.0002 per session on Opus 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-08-30.