feature-00c-abort

feature-00c-abort is a command for Claude Code from JotJunior/cstk. It costs 54 tokens per session (1,875 once invoked), scanned C, original, MIT.

A command that stops a running feature-00C execution, allows time to save its state, marks it aborted, and creates a partial report.

In plain words
What is it for?
Aborting a feature by its short name, recording the reason, optionally removing backups, and committing the local result.
Why use it?
It provides a controlled way to end a feature run while preserving its recorded progress and making repeated abort requests safe.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cstk plugin — 21 skills, 7 commands, 7 agents, 1 MCP server shipped together

Good fit Aborting a feature by its short name, recording the reason, optionally removing…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jotjunior/cstk/feature-00c-abort
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/JotJunior/cstk

Made for: Claude Code.

Or install cstk, the plugin that ships this one along with the rest of its 21 skills, 7 commands, 7 agents, 1 MCP server.

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 feature-00c-abort

README.md
[![agentmods](https://agentmods.dev/badge/commands/jotjunior/cstk/feature-00c-abort.svg)](https://agentmods.dev/commands/jotjunior/cstk/feature-00c-abort)
Your own site
<a href="https://agentmods.dev/commands/jotjunior/cstk/feature-00c-abort"><img src="https://agentmods.dev/badge/commands/jotjunior/cstk/feature-00c-abort.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,875 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00054 $0.01875
Opus 5 $0.00027 $0.00937
Sonnet 5 $0.00011 $0.00375
Haiku 4.5 $0.00005 $0.00187

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

Security

Grade C, and why

feature-00c-abort scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf -- "$AGENTE_00C_STATE_DIR/backups"
plugins/cstk/commands/feature-00c-abort.md · 192 lines

How it starts

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

/feature-00c-abort

Voce vai abortar manualmente uma execucao feature-00c em andamento conforme contrato em docs/specs/_archived/feature-00c/contracts/cli-invocation.md

  • spec §FR-025 (SIGTERM + grace period).

Argumentos recebidos

$ARGUMENTS

Comportamento esperado

1. Parse de argumentos

short_name        = primeiro argumento posicional (OBRIGATORIO)
--motivo TEXTO    = default = "aborto manual"
--purge-backups   = flag opcional; apaga backups/ apos abort
--projeto PATH    = default = cwd

2. Localizar state dir

_proj=$(realpath "$PROJETO")
AGENTE_00C_STATE_DIR="$_proj/.claude/feature-00c-state/$SHORT"
export AGENTE_00C_STATE_DIR

# Backend-agnostico (state-db-runtime-parity, v6.3): sob backend SQLite o
# estado e state.db, nao state.json — exigir state.json aqui tornaria
# impossivel abortar uma execucao iniciada apos `cstk state enable-sqlite`.
if [ ! -d "$AGENTE_00C_STATE_DIR" ] \
   || { [ ! -f "$AGENTE_00C_STATE_DIR/state.json" ] \
        && [ ! -f "$AGENTE_00C_STATE_DIR/state.db" ]; }; then
  stderr "feature-00c-state inexistente para '$SHORT' em $_proj — nada para abortar"
  exit 1
fi

3. Idempotencia — status terminal ja?

_status=$(state-rw.sh get --state-dir "$AGENTE_00C_STATE_DIR" --field '.execution.status')

case "$_status" in
  abortada|concluida)
    echo "execucao ja em status terminal ($_status); nenhuma acao."
    exit 0
    ;;
esac

4. SIGTERM + grace period (FR-025 atualizado)

# Detectar se ha PID detentor do lock
_lock_dir="$AGENTE_00C_STATE_DIR/.lock"
_pid=""
if [ -d "$_lock_dir" ] && [ -f "$_lock_dir/pid" ]; then
  _pid=$(cat "$_lock_dir/pid" 2>/dev/null)
fi

if [ -n "$_pid" ] && kill -0 "$_pid" 2>/dev/null; then
  # Processo da onda vivo — enviar SIGTERM e aguardar grace
  kill -TERM "$_pid" 2>/dev/null || true

  # Grace period: aguardar ate 60s pela liberacao
  _grace=60
  _waited=0
  while [ "$_waited" -lt "$_grace" ]; do
    if ! kill -0 "$_pid" 2>/dev/null; then
      break  # processo encerrou graciosamente
    fi
    sleep 2
    _waited=$((_waited + 2))
  done

  # Se ainda vivo apos grace, force-acquire (fallback)
  if kill -0 "$_pid" 2>/dev/null; then
    stderr "aviso: onda corrente nao respondeu SIGTERM em ${_grace}s; force-acquire do lock"
  fi
fi

# Force-acquire do lock (mesmo se PID encerrou graciosamente, normalize estado).
# `--force-abandoned` (nao `--force`) porque derrubar onda VIVA e exatamente o
# que o abort faz: o `--force` simples recusa quando ha onda aberta no estado
# (issue #182 — o dono do lock e um shell efemero, "pid morto" nao prova onda
# encerrada). O override fica auditado como
# `DIAG|warning|lock-force-abandoned-override`. Pre-condicao contratual ja
# cumprida acima: SIGTERM + grace period.
state-lock.sh acquire --state-dir "$AGENTE_00C_STATE_DIR" --force-abandoned

Read the full file on GitHub · 192 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. 3d ago Changed · +6 lines 790295c5deee
  2. 7d ago First seen · 186 lines · 54 tokens per session scan C 6c0c2b6c7a10

Subscribe to this mod's changes

feature-00c-abort is a command published in the GitHub repository JotJunior/cstk (23 stars, last pushed 3d ago), licensed MIT. It adds 54 tokens to every session and 1,875 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.