bastion: Command for Claude Code

.claude/commands/pipeline.md

pipeline is a command for Claude Code from JoakimCarlsson/bastion. It costs 67 tokens per session (2,411 once invoked), scanned A, original, MIT.

A command that coordinates a complete software delivery pipeline, a sequence of planning, coding, testing, and review stages. It runs the project's agents in order for a selected GitHub issue and passes structured results between them.

In plain words
What is it for?
Running an issue from planning through implementation, smoke testing, and review, including typed handoffs such as a plan, a fix request, or approval.
Why use it?
It removes the need to manually start each specialist and keeps failures moving back to the coding stage. It also records each stage and stops when repeated failures indicate the process needs attention.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/joakimcarlsson/bastion/pipeline"><img src="https://agentmods.dev/badge/commands/joakimcarlsson/bastion/pipeline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,411 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.00067 $0.02411
Opus 5 $0.00034 $0.01205
Sonnet 5 $0.00013 $0.00482
Haiku 4.5 $0.00007 $0.00241

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

Security

Grade A, and why

pipeline 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 9d 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.md · 165 lines

How it starts

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

/pipeline — hardened delivery loop

You are the pipeline orchestrator. Invoke each agent in turn via the Agent tool, parse the HANDOFF:* block in their final output against the schema in docs/pipeline-handoff-schema.md, and route to the next agent based on the verdict.

Issue number for this run: $ARGUMENTS

How chaining works in Claude Code

.cursor/agents/ and .github/agents/ use frontmatter handoffs: to fire the next agent automatically. Claude Code does not have that mechanism — subagents return a single summary and stop. This slash command bridges the gap.

Every agent in this pipeline ends with one of these typed blocks (full field list in docs/pipeline-handoff-schema.md):

  • HANDOFF:PLAN (planner → red-team → coder)
  • HANDOFF:IMPLEMENTATION (coder → smoke-tester)
  • HANDOFF:VERIFIED (smoke-tester → reviewer)
  • HANDOFF:FIX (smoke-tester or reviewer → coder)
  • HANDOFF:APPROVED (reviewer → user)

Treat the block as canonical — pass it verbatim to the next agent in the prompt.

Run setup (do this once at the very start)

  1. Pick a run_id: YYYYMMDD-HHMMSS-<6-hex> (UTC, e.g. 20260523-140812-a3f9b1). Use Bash to compute it.
  2. Create the log directory: .pipeline-runs/$ARGUMENTS/.
  3. Open an empty run.jsonl at .pipeline-runs/$ARGUMENTS/<run_id>.jsonl.
  4. Initialise counters in memory: tokens_total = 0, per-stage attempt = 0, signatures_seen = {}.
  5. Resolve the token budget: read $env:BASTION_PIPELINE_BUDGET (PowerShell) or $BASTION_PIPELINE_BUDGET (bash); default to 400000 if unset.

Validation contract (apply at every stage boundary)

Before invoking the next stage, run these checks against the block returned by the prior stage:

  1. Envelope: the block is fenced by ---HANDOFF:<TYPE>--- and ---END HANDOFF--- on their own lines.
  2. YAML: the body parses as YAML (use a tiny Bash one-liner with python -c or yq if needed).
  3. Common fields: schema_version, issue_number, issue_url, next_agent are all present.
  4. Type-specific fields: every required field for the block type per docs/pipeline-handoff-schema.md is present and non-empty.
  5. Cross-references: for HANDOFF:IMPLEMENTATION and beyond, every AC id from the originating HANDOFF:PLAN must appear in ac_mapping[] / spec_conformance[].

Read the full file on GitHub · 165 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. 9d ago First seen · 165 lines · 67 tokens per session scan A 996136b47659

Subscribe to this mod's changes

pipeline is a command published in the GitHub repository JoakimCarlsson/bastion (2 stars, last pushed 3mo ago), licensed MIT. It adds 67 tokens to every session and 2,411 once invoked, about $0.0003 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-31.