discover

A full scan of a codebase that creates maps of its structure, architecture diagrams, database schemas, and API contracts. API contracts describe the endpoints and data a service exposes.

In plain words
What is it for?
Use it to scan the whole project or focus on a directory or area such as authentication.
Why use it?
It gives an agent a documented view of an unfamiliar project instead of requiring it to inspect every file manually.

Command

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/greppable/greppable-cc-plugin/discover
Clone the repo
git clone --depth 1 https://github.com/greppable/greppable-cc-plugin
Per session 28 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,884 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.00028 $0.01884
Opus 5 $0.00014 $0.00942
Sonnet 5 $0.00006 $0.00377
Haiku 4.5 $0.00003 $0.00188

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

Security

Grade A, and why

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

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.

commands/discover.md · 165 lines

How it starts

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

/greppable:discover — Full Codebase Scan

Scan the project structure and generate GDL artifacts that document the codebase.

Arguments

$ARGUMENTS contains optional path or focus area:

  • Empty: scan entire codebase
  • Path (e.g., src/auth/): focus scan on that directory
  • Description (e.g., "authentication layer"): focus scan contextually

Pre-Flight

  1. Read config from .claude/greppable.local.md to determine active layers and gdl_root. If no config, use defaults: all layers enabled, gdl_root=docs/gdl.

  2. Run bridge detection pre-scanner:

    bash "${CLAUDE_PLUGIN_ROOT}/scripts/gdl-prescan.sh" <target_dir> --json
    

    This detects which bridge tools can generate skeletons automatically (code maps via src2gdlc, schema maps via sql2gdls/prisma2gdls/db2gdls).

  3. Report scope and bridge plan:

    Scanning project structure...
    
    Bridge detection found:
      - TypeScript: 142 files → src2gdlc (automatic code maps)
      - Python: 24 files → src2gdlc (automatic code maps)
      - SQL migrations: 3 files → sql2gdls (automatic schema maps)
      - OpenAPI specs: 2 files → openapi2gdla (automatic API contracts)
      - GraphQL schemas: 1 file → graphql2gdla (automatic API contracts)
    
    Discover will:
      1. Run bridge tools for automatic skeleton generation (fast, scripted)
      2. Agent enriches skeletons with descriptions and relationships
      3. Generate architecture diagrams (.gdld) from codebase understanding
      4. Synthesize: concept anchors, overview diagram, and proposed coding rules
    
    This is a token-intensive process. Proceed? [yes / cancel]
    
  4. Run bridge tools (scripted, fast): For each bridge detected by prescan, execute the recommended command with actual paths substituted:

    # Example: Code maps
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/src2gdlc.sh" <target_dir> --output=<gdl_root>/code --recursive --lang=typescript
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/src2gdlc.sh" <target_dir> --output=<gdl_root>/code --recursive --lang=python
    # Example: Schema maps (iterate over individual files)
    for f in <migrations_dir>/*.sql; do bash "${CLAUDE_PLUGIN_ROOT}/scripts/sql2gdls.sh" "$f" --output=<gdl_root>/schema; done
    for f in <schema_dir>/*.prisma; do bash "${CLAUDE_PLUGIN_ROOT}/scripts/prisma2gdls.sh" "$f" --output=<gdl_root>/schema; done
    # Example: API contracts
    for f in <api_dir>/*.json <api_dir>/*.yaml; do bash "${CLAUDE_PLUGIN_ROOT}/scripts/openapi2gdla.sh" "$f" --output=<gdl_root>/api; done
    for f in <schema_dir>/*.graphql; do bash "${CLAUDE_PLUGIN_ROOT}/scripts/graphql2gdla.sh" "$f" --output=<gdl_root>/api; done
    

    Track failures: if a bridge fails, log warning and continue with remaining bridges. Report both successful and failed bridges before proceeding.

Read the full file on GitHub · 165 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. yesterday First seen · 165 lines · 28 tokens per session scan A bd8cc559cd75

Subscribe to this mod's changes

discover is a command published in the GitHub repository greppable/greppable-cc-plugin (3 stars, last pushed 4mo ago), licensed MIT. It adds 28 tokens to every session and 1,884 once invoked, about $0.0001 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-31.