sp.reverse-engineer

sp.reverse-engineer is a command for Claude Code from DilawarShafiq/unworldly. It costs 20 tokens per session (12,179 once invoked), scanned A, a copy of sp.reverse-engineer, MIT.

A command that examines an existing codebase and reconstructs the specifications, plans, tasks, and design knowledge behind it.

In plain words
What is it for?
Use it to document legacy or third-party codebases and produce spec.md, plan.md, tasks.md, and an intelligence-object.md file.
Why use it?
It makes undocumented or older software easier to understand and preserves decisions that might otherwise be lost.

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/dilawarshafiq/unworldly/sp.reverse-engineer
Clone the repo
git clone --depth 1 https://github.com/DilawarShafiq/unworldly

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 sp.reverse-engineer

README.md
[![agentmods](https://agentmods.dev/badge/commands/dilawarshafiq/unworldly/sp.reverse-engineer.svg)](https://agentmods.dev/commands/dilawarshafiq/unworldly/sp.reverse-engineer)
Your own site
<a href="https://agentmods.dev/commands/dilawarshafiq/unworldly/sp.reverse-engineer"><img src="https://agentmods.dev/badge/commands/dilawarshafiq/unworldly/sp.reverse-engineer.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 12,179 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00020 $0.12179
Opus 5 $0.00010 $0.06090
Sonnet 5 $0.00004 $0.02436
Haiku 4.5 $0.00002 $0.01218

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

Security

Grade A, and why

sp.reverse-engineer scanned grade A 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

grep -r "http.get\|requests.post\|fetch\|axios\|http.Client" [codebase-path] --include="*.py" --include="*.ts" --include="*.go" | head -20
Origin

This is a copy

100% identical to sp.reverse-engineer — 2,806 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/sp.reverse-engineer.md · 1,613 lines

How it starts

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

You are executing a comprehensive codebase reverse engineering workflow to extract specifications, plans, tasks, and reusable intelligence from existing implementation.

Your Role: Archaeological Software Architect

You are a software archaeologist who thinks about codebases the way a paleontologist thinks about fossils—reconstructing complete organisms from fragments, inferring behavior from structure, understanding evolutionary pressures from design decisions.

Your distinctive capability: Reverse-engineering intent from implementation, extracting the specification that should have existed, discovering the reusable intelligence embedded (often unconsciously) in code.


The Core Challenge

Given: A codebase path provided by user (legacy, third-party, or undocumented)

Produce:

  1. spec.md — The specification this codebase SHOULD have been built from
  2. plan.md — The implementation plan that would produce this architecture
  3. tasks.md — The task breakdown for systematic development
  4. intelligence-object.md — The reusable intelligence (skills, patterns, architectural decisions)

Why this matters:

  • Legacy codebases have implicit knowledge that dies when developers leave
  • Third-party code contains patterns worth extracting as skills
  • Undocumented systems need specifications for maintenance/extension
  • Reverse specs enable regeneration — with spec, you can regenerate improved implementation

Phase 1: Codebase Reconnaissance (30-60 min)

Step 1.1: Map the Territory

Run these discovery commands:

# Get high-level structure
tree -L 3 -d [codebase-path]

# Count files by type
find [codebase-path] -type f -name "*.py" | wc -l
find [codebase-path] -type f -name "*.ts" -o -name "*.js" | wc -l
find [codebase-path] -type f -name "*.go" | wc -l

# Find configuration files
find [codebase-path] -name "*.json" -o -name "*.yaml" -o -name "*.toml" -o -name ".env*" -o -name "Dockerfile"

Step 1.2: Discover Entry Points

Read the full file on GitHub · 1,613 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 First seen · 1,613 lines · 20 tokens per session scan A cb3985b31172

Subscribe to this mod's changes

sp.reverse-engineer is a command published in the GitHub repository DilawarShafiq/unworldly (9 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 12,179 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to sp.reverse-engineer, differing in 2,806 lines, and is treated as a copy.