delete

delete is a command for Claude Code from Marcel-Bich/marcel-bich-claude-marketplace. It costs 10 tokens per session (731 once invoked), scanned A, original, MIT.

A command for safely removing a secondary Git worktree, which is a separate working folder linked to the same repository.

In plain words
What is it for?
Listing matching worktrees, checking their branches and changes, and deleting an eligible secondary worktree with safeguards.
Why use it?
It helps avoid deleting the main project folder or losing uncommitted work by mistake.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the hydra plugin — 9 commands shipped together

Good fit Listing matching worktrees, checking their branches and changes, and deleting an eligible secondary worktree with safeguards.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/marcel-bich/marcel-bich-claude-marketplace/delete
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.

Clone the repo
git clone --depth 1 https://github.com/Marcel-Bich/marcel-bich-claude-marketplace

Made for: Claude Code.

Or install hydra, the plugin that ships this one along with the rest of its 9 commands.

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 delete

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/delete/github.svg)](https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/delete)
Your own site
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/delete"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/delete/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 delete

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcel-bich/marcel-bich-claude-marketplace/delete"><img src="https://agentmods.dev/badge/commands/marcel-bich/marcel-bich-claude-marketplace/delete.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 731 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.00010 $0.00731
Opus 5 $0.00005 $0.00365
Sonnet 5 $0.00002 $0.00146
Haiku 4.5 $0.00001 $0.00073

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

Security

Grade A, and why

delete 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 10d 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.

plugins/hydra/commands/delete.md · 144 lines

How it starts

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

Worktree Delete

You are executing the /hydra:delete command. Safely remove a Git worktree with data loss protection.

Arguments

  • $ARGUMENTS - Name of the worktree to delete (required)

Process

1. Check if Worktree Exists

IMPORTANT: The main worktree (first in list, usually main/master branch) must NEVER be deleted. When listing available worktrees, always exclude the main worktree (first line of git worktree list).

# List only secondary worktrees (skip first line = main worktree)
git worktree list | tail -n +2 | grep -E "$ARGUMENTS|hydra/$ARGUMENTS"

If user tries to delete main/master:

ERROR: Cannot delete the main worktree. This is your project root.

If not found:

Worktree '{name}' not found.

Available worktrees:
{list}

Tip: Use /hydra:list for an overview.

2. Determine Path and Branch

# Find exact path
WORKTREE_PATH=$(git worktree list --porcelain | grep -A2 "worktree.*$ARGUMENTS" | grep "worktree " | cut -d' ' -f2-)

# Find branch
WORKTREE_BRANCH=$(git worktree list --porcelain | grep -A2 "worktree.*$ARGUMENTS" | grep "branch " | sed 's/branch refs\/heads\///')

3. Check for Uncommitted Changes

cd "$WORKTREE_PATH"
git status --porcelain

If uncommitted changes exist, use AskUserQuestion:

WARNING: Worktree '{name}' has unsaved changes:

{git status output}

These changes will be lost!

Question: Delete anyway?
Options:
- Yes, delete (discard changes)
- No, cancel

4. Remove Worktree

# Return to main directory
cd "$(git worktree list | head -1 | awk '{print $1}')"

# Remove worktree
git worktree remove "$WORKTREE_PATH"

If locked:

# With --force if locked
git worktree remove --force "$WORKTREE_PATH"

5. Optional: Delete Branch

Ask if the branch should also be deleted:

Worktree removed.

The branch '{branch}' still exists.
Should it also be deleted?

Options:
- Yes, delete branch (git branch -d {branch})
- No, keep branch

Read the full file on GitHub · 144 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. 10d ago First seen · 144 lines · 10 tokens per session scan A e2b3453fb211

Subscribe to this mod's changes

delete is a command published in the GitHub repository Marcel-Bich/marcel-bich-claude-marketplace (13 stars, last pushed yesterday), licensed MIT. It adds 10 tokens to every session and 731 once invoked, about $0.0001 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.