discover

discover is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 25 tokens per session (7,673 once invoked), scanned D, original, MIT.

A read-only onboarding command for an existing codebase. It maps the technologies and structure, checks whether the project builds and runs, records its current health, and creates a project profile.

In plain words
What is it for?
Use it when taking over an older project with incomplete documentation, specifications, or tests. For a product split across several service repositories, run it separately in each repository before creating a system-wide map.
Why use it?
It gives you a reliable starting picture before you change unfamiliar code. This helps avoid guessing about the stack, layout, or current problems.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions subagents; names the AskUserQuestion tool.

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is **Multi-repo microservices:** `/discover` is **repo-scoped** — run it (+ the rest of Phase A) **per service repo**. To then understand how the services fit toge.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 discover

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/discover.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/discover)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/discover"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/discover.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,673 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.1 $0.00025 $0.07673
Opus 5 $0.00013 $0.03837
Sonnet 5 $0.00005 $0.01535
Haiku 4.5 $0.00003 $0.00767

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

Security

Grade D, and why

discover scanned grade D with 3 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 6d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- **(a) Install the engine CLI** — show the **exact command** for the platform's standard package manager (`brew install libpq` · `mongosh` · `mysql-client`, Oracle Instant Client…) and ask for approval; **on explicit ap

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- [ ] **No credential leaked** — grep the produced artifacts (`CODEBASE_MAP.md` — health snapshot included as a section, `.claude/PROJECT_PROFILE.md`, any `db/schema-snapshot/**`) for password-like segments (`Password=`,

Makes network callslowCapability

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

- **(a) Install the engine CLI** — show the **exact command** for the platform's standard package manager (`brew install libpq` · `mongosh` · `mysql-client`, Oracle Instant Client…) and ask for approval; **on explicit ap
.claude/commands/discover.md · 205 lines

How it starts

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

/discover — Legacy Codebase Onboarding

"Map the territory before you change it."

Purpose

The first step when taking over a legacy repo (brownfield). Survey the system read-only to: understand stack & structure, confirm it builds/runs, take a health snapshot, and generate the Project Profile — the foundation every subsequent command uses to know which mode and which peripheral stack it is operating in.

This is Phase A of the brownfield pipeline: /discover/spec (reverse) → /arch (reverse) → /infra (reverse-bootstrap).

Multi-repo microservices: /discover is repo-scoped — run it (+ the rest of Phase A) per service repo. To then understand how the services fit together, run /discover-system once over a workspace of all repos (it aggregates each repo's Phase A output, one-way). See ../references/microservices-multirepo.md.

When to Use

  • Taking over an existing codebase for the first time, with missing docs/spec/tests.
  • Before reverse-engineering the spec & architecture.
Situation Command
Unfamiliar legacy repo, need to understand + establish baseline /discover
Baseline already exists, continue development /spec (delta) → …
Greenfield (building from scratch) /spec (design) — DO NOT use /discover

Boundary — READ-ONLY

/discover does not modify source code, does not add/upgrade dependencies or install new global tooling, and does not run migrations that write to the DB. (One narrow exception, added deliberately: installing a database client CLI during the §Phase 1b ladder — only after the exact command has been shown and the user has explicitly approved it, and only once the no-machine-change paths have failed. It is recorded in the health snapshot because the machine changed.) Restoring the project's already-declared dependencies to build/test for observation is fine. It only reads, builds/tests to observe, and produces documentation. All code changes belong to flow B.

Read the full file on GitHub · 205 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. 6d ago First seen · 205 lines · 25 tokens per session scan D 774fb7603cd9

Subscribe to this mod's changes

discover is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 7d ago), licensed MIT. It adds 25 tokens to every session and 7,673 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it D with 3 findings (downloads and executes remote code, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.