discover-system

discover-system is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 30 tokens per session (3,577 once invoked), scanned A, original, MIT.

A read-only command that builds a map of a product spread across multiple repositories and services. A microservices product is an application whose parts run as separate services; the map lists those services, their calls, and cross-service user journeys.

In plain words
What is it for?
Use it at the workspace root when all service repositories are checked out together. It aggregates each repository's discovery results and creates system-level documentation; single-repository projects should use the regular discovery command.
Why use it?
It shows how separate codebases fit together before you change one service. This reduces the risk of breaking communication or workflows across the product.

Command for Claude Code

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

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is **One-way by design.** `/discover-system` reads per-repo output → produces `architecture/system/` as **documentation to understand the system**. Individual serv.

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-system

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/discover-system.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/discover-system)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/discover-system"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/discover-system.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,577 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.1 $0.00030 $0.03577
Opus 5 $0.00015 $0.01788
Sonnet 5 $0.00006 $0.00715
Haiku 4.5 $0.00003 $0.00358

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

Security

Grade A, and why

discover-system 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 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.

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/discover-system.md · 159 lines

How it starts

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

/discover-system — System-Level Map (Multi-Repo)

"Understand the whole product before changing one service."

Purpose

For a microservices product spread across many repos, build a system-wide map by aggregating the per-repo discovery artifacts. This is the system-scope counterpart of /discover (which is repo-scope). Read-only · run once + incremental.

Workspace Mode: this is the ONE command that runs AT the workspace root itself — do not scope it to a member repo.

One-way by design. /discover-system reads per-repo output → produces architecture/system/ as documentation to understand the system. Individual services keep developing + testing independently; they do NOT take a runtime dependency on the system layer. Cross-service safety = backward-compat discipline (rules/brownfield.md). Full convention: ../references/microservices-multirepo.md.

When to Use

  • Onboarding an existing multi-repo microservices product (one-time), or refreshing the map after services were added/changed.
  • NOT for a single-repo project — use /discover.

Prerequisites

  • A workspace: all service repos checked out under one parent folder (clone them side by side if they live in separate repos — Pattern B in the reference).
  • Per-repo Phase A done for each service — every repo has:
    • docs/CODEBASE_MAP.md (from /discover)
    • specs/SPEC.md with @US ids (from reverse-/spec)
    • architecture/ARCHITECTURE.md + architecture/api/openapi.yaml + §Service Contracts (from reverse-/arch — see arch.md §3.2)
    • a Service id declared in its Project Profile.

A repo missing any of the above → list it in the catalog as ⚠️ incomplete; do NOT fabricate its boundary/contracts.

Boundary — READ-ONLY

/discover-system reads per-repo artifacts and writes only architecture/system/. It does NOT modify any service repo's source, spec, or architecture. It reads compact artifacts (CODEBASE_MAP rows, §Service Contracts tables, openapi, SPEC @US), NOT full service code.

Read the full file on GitHub · 159 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 · 159 lines · 30 tokens per session scan A a024876eeadd

Subscribe to this mod's changes

discover-system is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 7d ago), licensed MIT. It adds 30 tokens to every session and 3,577 once invoked, about $0.0002 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.