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.
curl -O https://raw.githubusercontent.com/0xSoftBoi/suwappubot/main/.claude/commands/worktree-check.mdgit clone --depth 1 https://github.com/0xSoftBoi/suwappubotWrote 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.
[](https://agentmods.dev/commands/0xsoftboi/suwappubot/worktree-check)<a href="https://agentmods.dev/commands/0xsoftboi/suwappubot/worktree-check"><img src="https://agentmods.dev/badge/commands/0xsoftboi/suwappubot/worktree-check/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.
<a href="https://agentmods.dev/commands/0xsoftboi/suwappubot/worktree-check"><img src="https://agentmods.dev/badge/commands/0xsoftboi/suwappubot/worktree-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.00496 |
| Opus 5.5 | $0.00014 | $0.00198 |
| Sonnet 5.5 | $0.00007 | $0.00099 |
| Haiku 4.5 | $0.00003 | $0.00050 |
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 1mo 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.
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:
- Stop. Do not run the destructive command yet.
- Offer rescue: in that worktree,
HUSKY=0 git commit -am "wip: rescue <worktree>"then push to arescue/<worktree>-<branch>branch. - 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>.
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.
- 1mo ago First seen · 41 lines · 34 tokens per session scan A 260aa6a25fc9
worktree-check is a command published in the GitHub repository 0xSoftBoi/suwappubot (4 stars, last pushed 4d ago), licensed Apache-2.0. It adds 34 tokens to every session and 496 once invoked, about $0.0001 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-08-30.
Other commands, from other repositories
debug-order
Debug why a CoW Protocol order failed to match.
recreate-pr
Create a copy of an existing PR with review comments summarized as fixes. This allows Gemini (or other reviewers) to re-review the changes.
audit
Full security audit of a Solidity/Vyper/Rust contract or directory. Runs the entire vuln-skills library and dispatches DeFi specialist subagents based on detected protocol type.
README
Command "README" from hiromaily/go-crypto-wallet, covering claude code commands, commands, btc e2e commands, workflow and related.
fix-issue
Work on a GitHub issue using the label-context-mapping skill.
exploit
Generate a working Foundry PoC that exploits a specific finding. Compiles and passes.