Claude-Pipeline: Command for Claude Code

.claude/commands/pipeline-undo.md

pipeline-undo is a command for Claude Code from TheAstrelo/Claude-Pipeline. It costs 0 tokens per session (730 once invoked), scanned A, original, MIT.

Instructions for an undo command that removes the isolated branch and worktree created by a pipeline run, rather than reverting the user’s current files.

In plain words
What is it for?
Use them when undoing the latest pipeline result or a specified run, checking its ledger, branch, commit, and whether it was pushed remotely.
Why use it?
They describe how to identify the correct run and show what will be removed before asking for confirmation.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is TheAstrelo/Claude-Pipeline's own configuration. It tells Claude Code how to work on Claude-Pipeline 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 Claude-Pipeline configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TheAstrelo/Claude-Pipeline. 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/TheAstrelo/Claude-Pipeline/main/.claude/commands/pipeline-undo.md
Clone the repo
git clone --depth 1 https://github.com/TheAstrelo/Claude-Pipeline

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 pipeline-undo

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/theastrelo/claude-pipeline/pipeline-undo"><img src="https://agentmods.dev/badge/commands/theastrelo/claude-pipeline/pipeline-undo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 730 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.00000 $0.00730
Opus 5.5 $0.00000 $0.00292
Sonnet 5.5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured 2mo ago against content hash 0a38a146c589, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pipeline-undo 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 2mo 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/pipeline-undo.md · 78 lines

How it starts

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

Pipeline Undo Command

Undo a pipeline run's result. With worktree isolation (the current engine), this is clean and low-risk: a run never touches your checkout — its result lives only on a pipeline/<session> branch (and, for a --push run, on the remote). "Undo" therefore means deleting that branch and its worktree, not reverting your working tree.

Arguments

  • $ARGUMENTS — optional session ID to undo. Defaults to the most recent run.

Instructions

1. Find the run

  • Read .pipeline/artifacts/current.txt for the most recent session directory (or resolve the directory matching the $ARGUMENTS session ID under .pipeline/artifacts/).
  • The session's ledger.jsonl is authoritative. Find:
    • the run_started event → the run's baseline and branch;
    • a commit_published event and commit.sha → whether a commit was made;
    • a branch_published event → whether it was pushed, and to which remote.
  • The run branch is pipeline/<session-id>.

2. Report what will be removed

Show the user, and ask to confirm (y/n):

  • Session ID and task (from the run_started payload).
  • The run branch pipeline/<session-id> and whether it holds a commit.
  • Whether a worktree exists at .pipeline/worktrees/<session-id>.
  • Whether the branch was pushed to a remote.
  • Confirm explicitly that your current checkout will not change — only the run branch/worktree are removed.

3. Execute (only after confirmation)

# Remove the run worktree if it is still present (review-only / halted runs).
git worktree remove --force ".pipeline/worktrees/<session-id>" 2>/dev/null || true
git worktree prune

# Delete the local run branch.
git branch -D "pipeline/<session-id>"

# Remove the per-run checkpoint ref, if any.
git update-ref -d "refs/pipeline-checkpoints/<session-id>" 2>/dev/null || true

If the branch was pushed and the user wants the remote branch removed too (ask separately — this affects shared state):

git push <remote> --delete "pipeline/<session-id>"

Read the full file on GitHub · 78 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. 2mo ago First seen · 78 lines · 0 tokens per session scan A 0a38a146c589

Subscribe to this mod's changes

pipeline-undo is a command published in the GitHub repository TheAstrelo/Claude-Pipeline (47 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 730 tokens. 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.