sdd-reverse-analyze

sdd-reverse-analyze is a command for Claude Code from zekiriabd/SDD-Pro. It costs 99 tokens per session (1,364 once invoked), scanned A, original, Apache-2.0.

A technical analysis step that documents one functional unit of a legacy codebase. A functional unit is a stable group of related code identified during inventory.

In plain words
What is it for?
Use it to produce a technical analysis for one inventory unit, including its relevant code and dependencies, as the first step toward reverse-engineering user stories and features.
Why use it?
It creates a faithful description of how the old code works before anyone interprets its business meaning or rewrites it.

Command for Claude Code

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.

agentmods
npx agentmods add commands/zekiriabd/sdd-pro/sdd-reverse-analyze
Clone the repo
git clone --depth 1 https://github.com/zekiriabd/SDD-Pro

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 sdd-reverse-analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/zekiriabd/sdd-pro/sdd-reverse-analyze.svg)](https://agentmods.dev/commands/zekiriabd/sdd-pro/sdd-reverse-analyze)
Your own site
<a href="https://agentmods.dev/commands/zekiriabd/sdd-pro/sdd-reverse-analyze"><img src="https://agentmods.dev/badge/commands/zekiriabd/sdd-pro/sdd-reverse-analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 99 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,364 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00099 $0.01364
Opus 5 $0.00049 $0.00682
Sonnet 5 $0.00020 $0.00273
Haiku 4.5 $0.00010 $0.00136

Measured 5d ago against content hash 4977e02672cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sdd-reverse-analyze 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 5d 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/sdd-reverse-analyze.md · 82 lines

How it starts

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

/sdd-reverse-analyze {U-N} [--json]

Rôle

Lancer la Phase 3a (premier barreau de l'escalier reverse) : transformer une unité fonctionnelle (Phase 1) en analyse technique legacy — photo fidèle du code, sans interprétation métier. Une seule unité par invocation.

code source --[3a /sdd-reverse-analyze]--> plans/{n}-{FeatName}.analysis.md
            --[3b /sdd-reverse-stories]--> us/{n}-{m}-{Name}.md
            --[3c /sdd-reverse-feat]------> feats/{n}-{FeatName}.md

En mode pré-alloué (L5, preallocate_feats exécuté), plusieurs invocations peuvent tourner en parallèle borné (§8.2 rules/reverse-engineering.md) ; sans pré-allocation, séquentiel strict (ADV-2 §8.1). 3a possède l'allocation (n, FeatName) que 3b/3c réutilisent.

Args

Arg Type Description
{U-N} string requis Identifiant U-N stable (ex. U-3) — résolu via inventory.json.units[]
--json flag Émet le rapport d'analyse en JSON

Pré-conditions

  1. workspace/old/{P}/.sys/inventory.json existe ET passe gate ADV-23 (schemaVersion == 1, _allocatedNames + _featAllocations présents). Sinon → ERROR [REVERSE_INVENTORY_SCHEMA_STALE] + suggérer /sdd-reverse-inventory --refresh.
  2. units[id="{U-N}"] existe. Sinon → ERROR [REVERSE_UNIT_NOT_FOUND].
  3. .sdd/python/sdd_reverse/analysis.reverse.template.md présent (ADV-9). Sinon → ERROR [REVERSE_TEMPLATE_MISSING].
  4. (Mode legacy uniquement) Lock workspace/feats/.alloc.lock libre OU stale > 30 min (TTL 1800s). Sinon → ERROR [REVERSE_LOCK_HELD]. En mode pré-alloué, aucun lock (C5).

Actions

  1. Résoudre le projet legacy : lire workspace/old/*/.sys/inventory.json pour trouver lequel contient units[id={U-N}]. Plusieurs matchs → ERROR ambiguïté, demander --project {P}. Le nom retenu est {P}toutes les étapes suivantes l'utilisent, jamais un re-glob.
  2. Routage de tier (déterministe, ADR governance-reverse-complexity-ladder) — sur le projet {P} résolu en 1 :
    python .sdd/python/sdd_reverse/code_unit_complexity.py \
        --project workspace/old/{P} --unit {U-N} --rung 3a
    
    → imprime balanced si l'unité est simple, deep si complex (rubrique docs/rubrics/reverse-complexity-routing.md). Fail-safe câblé : toute erreur (inventory absent/illisible, {U-N} inconnu) imprime deep sur stdout ET la raison sur stderr, exit 0 — le doute coûte une passe deep, jamais un traceback ni une sous-analyse.
  3. Spawn unique Agent(reverse-tech-analyst) avec args = {U-N} ET model_tier = le tier routé en 2 (override au spawn, borné par tier_floor/tier_ceiling de l'agent — l'agent est inchangé, seul son tier d'exécution varie ; no-spawn préservé).
  4. L'agent suit STEP 0 à 7 de .sdd/agents/reverse-tech-analyst.md.
  5. Émission ligne chat finale [REVERSE] {U-N} → analyse 3a {n}-{FeatName} ({modèle}, ...). (PROGRESS%).

Read the full file on GitHub · 82 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. 5d ago First seen · 82 lines · 99 tokens per session scan A 4977e02672cd

Subscribe to this mod's changes

sdd-reverse-analyze is a command published in the GitHub repository zekiriabd/SDD-Pro (191 stars, last pushed 2d ago), licensed Apache-2.0. It adds 99 tokens to every session and 1,364 once invoked, about $0.0005 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.